Code Structuring Guidelines for .net Projects

I usually use the IoC pattern in my projects, which are mostly based. Are there any guidelines on how to structure projects in a common three-layer UI + BL + Data Access project. I want to know more about how to create folders where constants within each layer must be maintained (I store all strings like query string parameters, stored procedure parameter, etc. in a file named Constants, which is a singleton). How to create classes that interact with the data access layer from the business layer etc. and all such code structure issues.

Is there any guide or book on this?


source to share

2 answers

Microsoft has a lot of information on this. I used Microsoft .NET: Enterprise Application Archiving as my bible for software architecture.

Check also MSDN manual

Also, see examples of some application frameworks like Sharp Architecture for examples

Many NHibernate tutorials demonstrate software development principles that can be applied to any solution



@robbymurphy has a great answer. I would add that I keep most of the constants and interfaces in a separate project / assembly altogether. I call this my "main" assembly and define interfaces that allow me to pass data from the top of the stack to the bottom without tightly coupling them.

It's not much where they are used, but what purose is for. I once studied at a seminar where the instructor pounded "high cohesion, low cohesion" over and over again.

Store things that are in the real world together, but reduce dependencies between objects when possible.

This is a cohesion issue, and also a communication issue: if constants are indeed internal to the class, make them private static members (i.e., and an internal enumeration of states). If they are indeed internal to the project, create a class for them and make them internal (database constant in your data layer). Otherwise, place them in a public class in your own project.



All Articles