Code Examples
  Home arrow Code Examples arrow Page 4 - Understanding the CompressedFolder Class
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
CODE EXAMPLES

Understanding the CompressedFolder Class
By: Nilpo
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-03-18

    Table of Contents:
  • Understanding the CompressedFolder Class
  • Examining the Properties
  • More on Properties
  • Examining the Exposed Methods

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Understanding the CompressedFolder Class - Examining the Exposed Methods


    (Page 4 of 4 )

    The CompressedFolder class has quite a few methods.  They break down into three groups: exposed methods, internal methods, and support methods.  The exposed methods are the public methods exposed by the class object.  These simply point to methods in the second group.  The internal methods are the ones that perform the actual work of creating the folder, adding and extracting files, and so forth.  The last group is the support methods.  These are the extra functions and subroutines that are used by the internal methods.

    Public Sub Open(strFile)

       FullName = strFile

    End Sub

     

    Public Sub Create(strFile)

       If objFso.FileExists(strFile) Then objFso.DeleteFile(strFile)

       FullName = strFile

       NewCompressedFolder FullName

    End Sub

     

    Public Sub Add(strFile, blnKeepOriginal)

       AddFile FullName, strFile, blnKeepOriginal

    End Sub

     

    Public Sub AddMultiple(varSource, blnKeepOriginal)

       AddFiles FullName, varSource, blnKeepOriginal

    End Sub

     

    Public Sub Extract(strFolder)

       ExtractAll FullName, strFolder

    End Sub

    Here is the first group of publicly exposed methods.  You can see that these methods simply accept user input and use it to call another internal method.  This is a good coding practice for a couple of reasons, but in my case there was one reason that really stood out.

    I wanted to be able to control functionality using the class object’s properties.  Since most of these properties would at some point be used as parameters for my methods, I created a simple public method with pertinent parameters, and then passed them along with the others to my internal methods.  In this way, even though an internal method might have three or four required parameters, the user will only need to supply one or two in their code.  The rest would be predetermined by the object’s properties.

    While you won’t see very extensive use of this practice in this code class, I did want to leave that flexibility in place for demonstration purposes, as well as for future upgrades.  I have several additional features that I plan on adding to this class in the future.

    Unfortunately, I’m out of space for this article.  So far you’ve seen all of the parts that are exposed through the class’s object.  Be sure to stop back for part two of this series to see the continued explanation of this class.  In my next article, we’ll be examining the internal methods used by this class, as well as its implementation.  Until next time, keep coding!


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

    CODE EXAMPLES ARTICLES

    - Bipartite Graphs
    - Connectivity in Graphs
    - The Ford-Fulkerson Algorithm
    - Critical Paths
    - The Bellman-Ford and Roy-Floyd Algorithms
    - Shortest Path Algorithms in Graphs
    - Minimum Spanning Tree
    - Articulation Edges and Vertexes
    - Circles and Connectivity in Graphs
    - Depth-First Search in Graphs
    - Breadth-First Search in Graphs
    - The Prufer Code and the Floyd-Warshall Algor...
    - An Insight into Graphs
    - Coding a Custom Object with WSC
    - Creating a Custom Object with WSC





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek