Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

919 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

22 Experts available now in Live!

Get 1:1 Help Now