469,926 Members | 2,025 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,926 developers. It's quick & easy.

Multiple Projects Desing Question

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.
Nov 16 '05 #1
2 1586
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." <Ed_P.@discussions.microsoft.com> wrote in message
news:AC**********************************@microsof t.com...
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.

Nov 16 '05 #2
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." <Ed_P.@discussions.microsoft.com> wrote in message
news:AC**********************************@microsof t.com...
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.

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

22 posts views Thread by Matthew Louden | last post: by
1 post views Thread by David L?pez | last post: by
3 posts views Thread by Shikari Shambu | last post: by
3 posts views Thread by Claudio Pacciarini | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.