1

If we have a strictly layered architecture, can we allow outside components to interact directly with the lower layeres?

More specifically:

In my lower layers, I am providing a service, and in the top most layer I have a layer called Applications which is basically various set of applications that can use that service. Users (which are considered entities outside the system) can interact with the Application layer through standard protocols. Pretty much similar to what happens in the Internet's architecture. Now if I have users of different types, say admins, ordinary users, ...; do they have to do all the interactions with the system through application layer or can we allow some types of the users to directly interact with the lower layers as well?

1

"Layered Architecture" is a discipline you impose on yourself and other developers.

So yes its quite possible for you or anyone with access to skip the layers.

This can happen by accident if a developer misinterprets the guidelines.

By design e.g. you let a certain application which runs complex queries to access the database directly instead of using the service interface.

By malice, hackers seldom follow the architectural guidelines.

  • Yes, my question is do guidelines say it is not right to do so? I understand that in practice one can do anything with the code in his possession. The question is meant; if someone wants to follow the guidelines, should he give direct access to lower layers. – hwat Sep 11 '15 at 15:02
  • Well there are quite a lot of "By Design" cases where a layered architecture becomes too clumsy to implement. The "complex query" example is perhaps the most common, but, others include interfacing with a packaged application, interfacing with a external service (think paypal) etc. – James Anderson Sep 11 '15 at 15:06
  • Can you elaborate a bit more about the by design case? Is the by design case ideal or just out of desperation? It seems the complex query example is an act of desperation because of clumsy rules of the layered architecture. – hwat Sep 11 '15 at 15:25
  • 1
    Not out of desperation - more just lets get it done the best way. For a wholly internally written project layered / service is the way to go but the outside world will hit you with requirements that just will not fit. The good news is that if you have a clear architecture and a solid structure to your application you can cope with these "out of architecture" requests. – James Anderson Sep 12 '15 at 6:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.