Multiple Projects Desing Question

G

Guest

Hello,

Up to this point, I've been using C# to create simple applications that only use on Project to store Windows Forms and other Files. The project has been complied into an EXE. The exe file that is generated has balooned to about 500kb, which is something I don't want to happen!

Although this has approach has been ok for the small applications I've built so far I'd like to move to using the "One Solution with Multiple Projects" method to help me with building the application. However I have some questions as to how I should divide the projects.

My initial idea was to create a project for the GUI and one for the DB Access Logic (such as connection to and getting data from a Access Database). However, the GUI will consist of about 7 Windows Forms which leads me to this question: Should I create one project for each Windows form? If I do this, I am thinking of compiling the projects to DLL files and then just reference them in my start up project?

I also want to be able to organize my projects so that I can seperate the different components of the application (presentation layer, data access layer, etc.). Here is a structure of what I am thinking I should use, your feedback/advice is welcomed:

Solution Name (ComputerTracker)
1. Project1 - GUI
MainWindow.cs (Windows Form)
CreateComputer.cs (Windows Form)
SearchComputers.cs (Windows Form)
etc...
2. Project2 - DataAccess
Database.cs

Project1 Will be Compiled to an EXE file and will be the start up project
Project 2 Will be compiled to a DLL File.

Again, any feedback/advice will be welcomed. One of the reasons why I wish to do this is so that the EXE that will be generated will be small, but to also see if this can help out with performance with the application. And also to improve the overall desing of the application.

One last thing to ask, if anyone can point to any resources on the net or any examples of C# applications that use the "One Solution and Many Projects" method will be greatly appreciated! I've tried but have not been successful in finding anything on the net, and since I am new to this I don't really know what to look for specifically!

Thanks,

Ed_P.
 
G

Guest

Generating your presentation layer in the .exe and your data access in a
separate .dll is generally a reasonable design, but there is a lot more to
good design than this simple step and there's no way I can explain it all in
a simple e-mail. You really ought to read some books on software engineering
or check out some of the sites on application design. There are tons of them
out there.

Why are you so concerned with the size of the .exe? Breaking the application
into a .EXE and .DLL is just going to create two files that together, are
probably going to be larger than the original .EXE. It's unlikely you'll see
a performance increase simply from separating your data access from the
presentation layer. If you're having performance problems, it probably has
to do with the current design of your algorithms, and maybe that's what you
need to be looking at. It could also be with the design of your database.
Maybe they're not indexed properly. Maybe the design isn't properly
normalized. These are things you probably want to research first.

7 forms is not that many for an application.

I'm not trying to discourage you from making the design change, I just don't
want you to get your hopes up that suddenly your application is going to run
a lot faster because of it, if that's your real goal. If it is, then you
really need to look at other possible probelms. You may find an application
profiler will help you determine where the bottlenecks are in your app. Do a
search on google. There are a few for .NET apps.

Pete

Ed_P. said:
Hello,

Up to this point, I've been using C# to create simple applications that
only use on Project to store Windows Forms and other Files. The project has
been complied into an EXE. The exe file that is generated has balooned to
about 500kb, which is something I don't want to happen!
Although this has approach has been ok for the small applications I've
built so far I'd like to move to using the "One Solution with Multiple
Projects" method to help me with building the application. However I have
some questions as to how I should divide the projects.
My initial idea was to create a project for the GUI and one for the DB
Access Logic (such as connection to and getting data from a Access
Database). However, the GUI will consist of about 7 Windows Forms which
leads me to this question: Should I create one project for each Windows
form? If I do this, I am thinking of compiling the projects to DLL files and
then just reference them in my start up project?
I also want to be able to organize my projects so that I can seperate the
different components of the application (presentation layer, data access
layer, etc.). Here is a structure of what I am thinking I should use, your
feedback/advice is welcomed:
Solution Name (ComputerTracker)
1. Project1 - GUI
MainWindow.cs (Windows Form)
CreateComputer.cs (Windows Form)
SearchComputers.cs (Windows Form)
etc...
2. Project2 - DataAccess
Database.cs

Project1 Will be Compiled to an EXE file and will be the start up project
Project 2 Will be compiled to a DLL File.

Again, any feedback/advice will be welcomed. One of the reasons why I
wish to do this is so that the EXE that will be generated will be small, but
to also see if this can help out with performance with the application. And
also to improve the overall desing of the application.
One last thing to ask, if anyone can point to any resources on the net or
any examples of C# applications that use the "One Solution and Many
Projects" method will be greatly appreciated! I've tried but have not been
successful in finding anything on the net, and since I am new to this I
don't really know what to look for specifically!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top