Hy guys. i've been working with asp.net for some months now and i never really started a big project of my own. Now the chance for me to do so has come and i've got some questions about organising the project.
It'll start as a small project with two pages. I'm going to use Nhibernate and some css and javascript/jquery with 3 layers: interfaces, business and data layers.
Is there the best way to organise this kinda of project? I mean, dll's, layers, css files and such? Do you guys have a sugestion of an architecture to make this project? It's going to be an experimental project. Any book recomendations about project organisation
would be great.
I guess you guys could say that i know how to code and how asp.net works (not everything about it of course xD), but i suck at organisation.
Well wanting to improve is a big step in the right direction :)
A lot of developers aren't even aware that best-practices exist or that they are making a mess.
You can create a solution and add multiple projects in to it.
I assume by "interfaces" you mean the html/js/css not an interface as in the programming keyword.
By splitting the solution into three projects (one for each layer) you have a way of auto-enforcing your separation. This is because the UI layer should never have to speak directly to the data layer, all its communication should go through the business
layer. So you dont have to include a dependence on the data layer from the ui and if you ever find yourself trying to reach into it to get at something then you know you are compromising your design and this feature should be made available through the business
layer.
By having these two projects (business and data) in separate class libraries it also means that the code from these will compile into a .dll assembly and this can be integrated into a test project (test as in tdd) and code coverage tools etc.
I think you will know when something doesn't feel right. At that time you should come back and discuss the specific issue with us. There is no point in having a hugely complicated project thats overwhelming just for the sake of getting it right first time,
build it up and get to know it!
Hm...i thought of using dll's. I worked with one big project, and lots and lots of folders...i got used to it, but it wasn't organised at all.
And it would be like you said Harry:
Interfaces layer (UI)
Business Layer
Data Access Layer
I worked in a project that consisted of these 3 layers...but like i said, i never really implemented the architecture, just worked on the coding.
What about validation codes? Should them all be inside the business layer, or it could be in both UI and business layers? I've been told that every validation should be in business layers....it makes sense if you would like complete more separation in your
code.
What about validation codes? Should them all be inside the business layer, or it could be in both UI and business layers? I've been told that every validation should be in business layers....it makes sense if you would like complete more separation in your
code.
I would go for a separate component for validations - Data validations, logic validations and business validations...
I've read about it and it seems interesting....WebMatrix can be used to handle big webprojects? Or should i stick with the traditional code-behing model?
Skeith
Member
65 Points
74 Posts
How to organise an Asp.Net project?
Mar 02, 2012 01:20 PM|LINK
Hy guys. i've been working with asp.net for some months now and i never really started a big project of my own. Now the chance for me to do so has come and i've got some questions about organising the project.
It'll start as a small project with two pages. I'm going to use Nhibernate and some css and javascript/jquery with 3 layers: interfaces, business and data layers.
Is there the best way to organise this kinda of project? I mean, dll's, layers, css files and such? Do you guys have a sugestion of an architecture to make this project? It's going to be an experimental project. Any book recomendations about project organisation would be great.
I guess you guys could say that i know how to code and how asp.net works (not everything about it of course xD), but i suck at organisation.
Thanks in advance.
rtpHarry
All-Star
56620 Points
8958 Posts
Re: How to organise an Asp.Net project?
Mar 02, 2012 02:12 PM|LINK
Well wanting to improve is a big step in the right direction :)
A lot of developers aren't even aware that best-practices exist or that they are making a mess.
You can create a solution and add multiple projects in to it.
I assume by "interfaces" you mean the html/js/css not an interface as in the programming keyword.
By splitting the solution into three projects (one for each layer) you have a way of auto-enforcing your separation. This is because the UI layer should never have to speak directly to the data layer, all its communication should go through the business layer. So you dont have to include a dependence on the data layer from the ui and if you ever find yourself trying to reach into it to get at something then you know you are compromising your design and this feature should be made available through the business layer.
By having these two projects (business and data) in separate class libraries it also means that the code from these will compile into a .dll assembly and this can be integrated into a test project (test as in tdd) and code coverage tools etc.
I think you will know when something doesn't feel right. At that time you should come back and discuss the specific issue with us. There is no point in having a hugely complicated project thats overwhelming just for the sake of getting it right first time, build it up and get to know it!
Skeith
Member
65 Points
74 Posts
Re: How to organise an Asp.Net project?
Mar 02, 2012 02:38 PM|LINK
Hm...i thought of using dll's. I worked with one big project, and lots and lots of folders...i got used to it, but it wasn't organised at all.
And it would be like you said Harry:
Interfaces layer (UI)
Business Layer
Data Access Layer
I worked in a project that consisted of these 3 layers...but like i said, i never really implemented the architecture, just worked on the coding.
What about validation codes? Should them all be inside the business layer, or it could be in both UI and business layers? I've been told that every validation should be in business layers....it makes sense if you would like complete more separation in your code.
nideeshm
Participant
1069 Points
269 Posts
Re: How to organise an Asp.Net project?
Mar 02, 2012 05:21 PM|LINK
If business layer is webservices. It is even better. In future you can change the front end to a new technology.
Nideesh.S
Mark as answer, If it helps you.
ramiramilu
All-Star
97799 Points
14494 Posts
Re: How to organise an Asp.Net project?
Mar 03, 2012 12:13 PM|LINK
I would go for a separate component for validations - Data validations, logic validations and business validations...
Thanks,
JumpStart
Skeith
Member
65 Points
74 Posts
Re: How to organise an Asp.Net project?
Mar 05, 2012 01:49 PM|LINK
What do you guys have to say about WebMatrix?
I've read about it and it seems interesting....WebMatrix can be used to handle big webprojects? Or should i stick with the traditional code-behing model?