×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

C# Modular Application

C# Modular Application

C# Modular Application

(OP)
Hello Friends,

I am moving from Microsoft Visual Foxpro towards C#. I am still in the learning process, gathering some 'best practices' to grant me a good foundation.

After I am comfortable with my learning I intend to start migrating my numerous Foxpro applications to C#/MsSQL.

My dilemma:

In my Foxpro development I have the main application called MAINAPP.EXE. Within this application there are menu items that call specific modules eg. DEBTORS.APP, CASHBOOK.APP, PAYROLL.APP.

These .APPs are complete modules doing specific functions. They are compiled separately but they run under MAINAPP.EXE as they are called.

My question may be vague but I am looking for directions on how to implement the same structure in a C# application. Any links, information will be highly appreciated.

Thanks in advance.

Benson

RE: C# Modular Application

Welcome to the C# world. Jump in. The water is just fine.

When you structure your project, add folders to your Visual Studio solution for each those areas, so you'll end up with folders for Debtors, Cashbook, Payroll, etc. Each will then get compiled to its own DLL.

Craig Berntson
MCSD, Visual C# MVP, www.craigberntson.com/blog

RE: C# Modular Application

(OP)
Hi Craig,

Thanks for welcoming me!

The modules have a GUI. Will they really work if compiled as a DLL? Again friend, I am still navigating the uncharted waters, so my questions may appear quite uninformed, but I must learn. Any helpful information will be highly appreciated.

Benson

RE: C# Modular Application

No GUI in a DLL was an artificial limitation imposed by VFP. It was there because the DLL libraries didn't have any UI code in them.

There is nothing stopping you from doing it in .Net.

Craig Berntson
MCSD, Visual C# MVP, www.craigberntson.com/blog

RE: C# Modular Application

(OP)
I did not know this. New knowledge to me. And this is considered 'good practice'? Thanks again.

RE: C# Modular Application

Yes, it is considered good practice as it allows you to separate concerns.

Craig Berntson
MCSD, Visual C# MVP, www.craigberntson.com/blog

RE: C# Modular Application

To elaborate a bit...

If the project needs to be highly modular, you'll probably want to create interfaces that define the pattern that modules need to use. That way the modules can be compiled as DLLs which use the interface, but don't have to know anything else about about the main application beyond whatever hooks you provide it.

Then, once its all done, you can make the main application scan the directory for DLL files, when it finds one, check to see if it is of the interface type that defines modules, and then load it. This way you end up with a system where the modules are now plugins, independent of the main program (and its very easy to simply drop in a new DLL when you need to extend functionality). Plus, it also provides an easy path for other developers to extend your program later on; they don't have to understand how the main applications does things, they just have to know how the subset that lets them interface works.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close