473,796 Members | 2,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How Do you Organize your Code?

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?

Jul 13 '07 #1
6 2201
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.

--
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!
*************** *************** *************** ***
"Larry Bud" <la**********@y ahoo.comwrote in message
news:11******** **************@ 57g2000hsv.goog legroups.com...
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?

Jul 13 '07 #2
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
"Larry Bud" <la**********@y ahoo.comwrote in message
news:11******** **************@ 57g2000hsv.goog legroups.com...
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?

Jul 13 '07 #3
"Peter Bradley" <pb******@uwic. ac.ukwrote in message
news:eO******** ******@TK2MSFTN GP02.phx.gbl...
* A Data Layer solution
* One project per Typed DataSet
Really? Every DataSet has its own separate project?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 13 '07 #4
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

"Larry Bud" wrote:
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?

Jul 13 '07 #5


"Mark Rae [MVP]" <ma**@markNOSPA Mrae.netwrote in message
news:e0******** ******@TK2MSFTN GP05.phx.gbl...
"Peter Bradley" <pb******@uwic. ac.ukwrote in message
news:eO******** ******@TK2MSFTN GP02.phx.gbl...
>* A Data Layer solution
* One project per Typed DataSet

Really? Every DataSet has its own separate project?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
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
Jul 13 '07 #6
"Mythran" <ki********@hot mail.comwrote in message
news:26******** *************** ***********@mic rosoft.com...
>>* 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...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 13 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
11071
by: Bruce W...1 | last post by:
I've been learning about PHP for a couple of weeks. With includes, PHP scripts, and HTML I can see where a large and complex website could easily turn in to a big hairy mess with files all over the place. Are there any adopted standards, recognized recommendations, or best practices on how all the code should be organized? I haven't found any websites that discuss this. Can anyone point me to information on this? If not then what do...
3
2282
by: _andrea | last post by:
I'd like to write a web-application with other people. It is the first time I write code together other person. I'd like to ask you some advices: 1)have an advice? 2)wich program to use for VCS (for windows)? 3)how to organize the work? Thank you in advance, Andrea.
1
1936
by: Rudderius | last post by:
Hey, I'm working on a winform app in VS 2005. I'm wondering if someone knows some best practices on how to organize the toolstrips. I have a menuToolStrip and some other toolstrips. As in many apps, the functionality of the toolstrip en the menubar overlap. (e.g. cut & copy etc) The commands I'm using for my application are more complex off course than just a copy and a paste.
1
1132
by: ASP Developer | last post by:
I have a user control with exposed properties. I have about 100 properties. I would like to organize them so they are easier for other programmers to peruse. Is it possible to organize the misc section and add +/- sections to make it easier to read?
5
2601
by: Daniel N | last post by:
I am new to .net and want to organize my code better. I am writing in vb.net 2003 and the code for my main form is nearing 50-60 pages and would like to create another file like a class, module or code file that SHARE sub procedures, and declarations as if it were with the rest of the code (So I can orginize it in 2 or 3 .vb files). When I create a new class I can; Inherits Project.MainForm
2
3533
by: key9 | last post by:
Hi all look at the organize tree main.c ------ #include lib_adapter.c main() { foo();
1
1895
by: Thomas Wittek | last post by:
Hi! Is there any possibility/tool to automatically organize the imports at the beginning of a module? I don't mean automatic imports like autoimp does as I like seeing where my objects/functions really come from. For the same reason I don't like "from foo import *". The downside is that you have a rather verbose import section at the
0
1157
by: Dudeja, Rajat | last post by:
Hi, I'm learning Python to write a GUI application using Tkinter & Tk. I've evaluated Eclipse and Pydev. With the help of Fabio Zadrozny I successfully installed Eclipse and PyDev. Thanks. Now, I'm learning Eclipse and PyDev. And my problem is that I don't have an understanding of how the code in
2
2480
by: Fredrik Lundh | last post by:
Dudeja, Rajat wrote: A Python program consists of a script file (the py file you run to start the program), and usually one or more additional module files (py files that you import). The latter can be organized in packages, where appropriate. There's also a search path (sys.path) that you can modify in various ways (including from within the program) if you want to fetch modules from different locations.
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9531
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10237
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10187
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10018
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7553
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.