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
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
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
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
There is nothing stopping you from doing it in .Net.
Craig Berntson
MCSD, Visual C# MVP, www.craigberntson.com/blog
RE: C# Modular Application
RE: C# Modular Application
Craig Berntson
MCSD, Visual C# MVP, www.craigberntson.com/blog
RE: C# Modular Application
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.