Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

OM perspective: Integrated main function or in a separate Driver class?

Posted on 2006-06-12
1
Medium Priority
?
313 Views
Last Modified: 2010-04-16
What is better from an OM perspective: having a separate Driver class with just a Main function which will instantiate the Worker class (say Archiver), or integrating this Main function into the Worker class (say Archive())? As for the second option, if the Archive main function is static, how does it instantiate the class it's part of?

Thanks
0
Comment
Question by:gromul
1 Comment
 
LVL 18

Accepted Solution

by:
Ravi Singh earned 2000 total points
ID: 16890804
I would think the first approach is best as it seperates concerns, keeping the main function in a seperate class would be a more neater and maintainable solution. However, if you do go for your second idea, then its just a simple case of creating an object of the current class...

public class Archive
{
    public static void Main(string[] args)
    {
        Archive a = new Archive(...);
        a.SomeMethod();
   }

    public Archive(...)
    {
    }

    public void SomeMethod()
    {
        ...
    }
}
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Screencast - Getting to Know the Pipeline

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question