Click here to Skip to main content
15,898,987 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Thanx for the reply of earlier question.
I need to consult your fabulous team for yet another question regarding the code organization in the project.

Actually, I'm from the Java Background, in J2EE, package name and code file are tightly integrated but in VS 2005, i can't get the same conformation of code and file name which led to too much complexity in code management. To illustrate the case, we have mainly five entities in the project. Each of these entity has various modules like Bussiness Object(POCO just like POJO in Java),DataAccess Objects, UI layer and finally reporting modules. In java we used to make something like com.radiant.domain.pojo for POJO. Similarly, com.radiant.domain.view for UI and so on....But i can't get the equivalent form in VS 2005. This causing a kindda chaos in the project.
Can u please provide some kind of relief?
Thanks in advance.
-Satyam
Posted
Updated 19-Jan-10 19:26pm
v2

Another way - you have multiple projects in a solution - each project maps to a dll (data layer, business layer etc).

I've had a look at some Visual studio and Eclipse projects and have noticed both can have very similar structures - so I'm not quite sure I understand your question correctly.
 
Share this answer
 
You can use namespaces, and you can nest namespaces. You can create folders to organize files (or folders) into. You can name files with the entire namespace and class name if you like. You can nest classes and you can split out the nested class into a separate file (thanks to partial classes). You can nest files under other files (but you have to modify the .CSPROJ file in Notepad in order to do that). You can split code between various projects (that are all combined into a single solution). You can also put projects in folders. You can make some classes private (if they are nested) or internal so that they do not show up when using Intellisense. You can also mark certain members of a class with attributes that hide them from Intellisense.

As you can see, there are a whole bunch of options for organizing your code when using Visual Studio (and, presumably, C#). If you are using C++, your options are mostly the same, although I don't know if Microsoft added the concept of partial classes to C++. Heck, you can even combine C++, VB, and C# in a single solution by putting them in separate projects.
 
Share this answer
 
In c# we have namespaces.

The tag for the question you've posted here is incorrect.
 
Share this answer
 
Of course we do have namespace, but it is not strongly associated with filename. Is there any alternative way of better code organization..?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900