Solved

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

Posted on 2006-06-12
1
306 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 500 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now