Web Application Organization

How do you guys organize your asp.net web applications? Do you have classes in the app or in a separate class library? How do you divide your classes into namespaces, by type, function, level? I have a great working application, but the codes are a bit messy, I want to take a look at the best way to organize it.

+4
source share
5 answers

I organize my classes in layers.

In small projects, I have a class library for accessing data, a class library for business objects, a class library for utility classes, including my reusable code and a web application project.

Namespaces are as follows:

  • MyProjectName.DAL
  • MyProjectName.BLL
  • MyProjectName.Utility
  • MyProjectName.Web

I never add classes to a web application project.

+4
source

I make it simple.

App_code - contains classes that are grouped into folders

Controls - Contains user controls grouped in folders

images - contains images

styles - contains css

js- contains javascript

Folders for any additional page grouping where this makes sense. Example: admin pages are in the admin folder. The admin home page will also be located in this folder.

+1
source

I'm with ScarletGarden on this one. My preference is to create separate class libraries for logical components and save classes from a web application where possible. If you need to reuse libraries, port the functionality to another technology (desktop, mobile, etc.) Or write unit tests against your logic, it really comes in handy to have them as stand-alone units.

0
source

main components, library components, module components, templates and configuration / environment / boot file

/includes

/core /lib /modules /templates config enviornment 

is the basis of my application structure, the actual application has one entry point, so almost everything is controlled from this or subdirectories.

0
source

I usually use a combination of what Brian and Scarlet Garden said. I like to have my business logic and data access in a separate class library, but utility web classes, page base classes, etc. Enter the folders in the web project. If I think that my user controls will be reused, I will also give them a separate project.

0
source

All Articles