Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

How Do you Organize your Code?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Larry Bud - 13 Jul 2007 13:39 GMT
Been working with .net 2 since January, and am in the middle of my
first large project.

It's becoming obvious that one must organize their code well in a
large project to make maintenance easier.  So what's your process?

Do you stick everything in one Class file?  Do you have a separate
class file for each "type" of function.. i.e. one for all data access,
another for general math, another for string function, etc.

Or something I haven't thought about?
Cowboy (Gregory A. Beamer) - 13 Jul 2007 15:02 GMT
I generally start with a prototype to get the basic idea down, test
patterns, etc. I then move to organizing the framework of my application.
This is the most time consuming part, but it is a worthwhile exercise.

If you do not have time to do it all yourself, you can shortcut with other
people's frameworks. For example, you can purchase the .NET Design Framework
cheaply from www.dofactory.com. It has a reference application included,
which will help you get started. I am not in agreement with the entire
setup, for my implementation, but it does have you set up the code in a way
that is highly maintainable.

Signature

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************

> Been working with .net 2 since January, and am in the middle of my
> first large project.
[quoted text clipped - 7 lines]
>
> Or something I haven't thought about?
Peter Bradley - 13 Jul 2007 15:46 GMT
It's hard to generalise, but I guess a typical project for us would go
something like this:

*  A Presentation Layer Solution containing
   *  The Web site project
   *  Another project for the classes used by the callbehind code,
representing the state of the objects in the presentation layer.
*  A business Layer Solution
   *  One project for each object in the business layer (because, for us,
they are single call SAOs.  The project contains not only the object itself,
but also various test classes as well as the service host code and the code
for the remote object's interface.
*  A Data Layer solution
   *  One project per Typed DataSet

There are also other projects that are not necessarily a part of the
particular solution, such as the project holding the Exception classes.
These could be contained in a project in the solution, but may equally be
added to an Exceptions solution (that holds custom exceptions for stuff that
will possibly be shared).

We generally stick to one class per file (although we might include more if
they are trivial), but might have many classes in an assembly if that's
appropriate.

HTH

Peter

> Been working with .net 2 since January, and am in the middle of my
> first large project.
[quoted text clipped - 7 lines]
>
> Or something I haven't thought about?
Mark Rae [MVP] - 13 Jul 2007 16:14 GMT
> *  A Data Layer solution
>    *  One project per Typed DataSet

Really? Every DataSet has its own separate project?

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Mythran - 13 Jul 2007 18:46 GMT
>> *  A Data Layer solution
>>    *  One project per Typed DataSet
>
> Really? Every DataSet has its own separate project?

I liked the part where he says "...but might have many classes in an
assembly...".  Pretty much all my non small console-based apps have many
classes :)

Mythran
Mark Rae [MVP] - 13 Jul 2007 19:00 GMT
>>> *  A Data Layer solution
>>>    *  One project per Typed DataSet
>>
>> Really? Every DataSet has its own separate project?

> I liked the part where he says "...but might have many classes in an
> assembly...".  Pretty much all my non small console-based apps have many
> classes :)

Quite so! I can (just about imagine) having a separate class for each
DataSet, but an entirely separate project...?

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Peter Bromberg [C# MVP] - 13 Jul 2007 17:02 GMT
If you visit (for example) Codeplex.com you can find numerous downloadable
solutions that you can play with and inspect, to get a very good idea about
how professional developers arrange their solutions / folders/ classes/ etc.  
Just pick one that "sounds similar" to the one you are undertaking.
-- Peter
Site:  http://www.eggheadcafe.com
UnBlog:  http://petesbloggerama.blogspot.com
BlogMetaFinder(BETA):    http://www.blogmetafinder.com

> Been working with .net 2 since January, and am in the middle of my
> first large project.
[quoted text clipped - 7 lines]
>
> Or something I haven't thought about?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.