Is N-Tier Architecture only the physical separation of code or there is something more to it?
What sorts of coding do we put in Presentation Layer, Application Layer, Business Logic Layer, User Interface Logic, Data Access Layer, Data Access Object,?
Can all the layers mentioned above give a fully functional N-tier architecture?
One case:
Whenever a user clicks a button to load a content via AJAX, they we do coding to fetch a particular HTML output and then update the element, so does this JavaScript coding also lie on a different tier? Because If N-tier Architecture is really about physical separation of code, than i think Its better to separate the JavaScript coding also.
Tiers and Layers are completely different things.
N-tier is less about code separation and more about scalability. The idea being that you can easily scale out different “tiers” as necessary. Most websites are 2 tier: web server and database server. Sometimes they go to 3, with a Service Oriented Architecture.
Layers is all about code separation and reusability. MVC is a good example of layered code.
Beyond all of that and before you go happily putting up barriers between different portions of your code, you really need to ask yourself two questions: What are you Separating and Why are you Concerned about it? If you can’t give rock solid answers to both of those (particularly the second), then I’d say stop what your doing and back away from the keyboard. And by a rock solid answer, I don’t mean “because bob said this is the way it should work.”
Take the time to really understand what is going on, how both the code and your sanity will be impacted by putting up these barriers. If they help, great; if they don’t, well..