3

Consider this mock-up of a software stack designed with layered architecture in mind :

Basic example of a layered-structured software stack.

Every application layer is decoupled through API calls, but a memory handling library is used throughout. All layers need to copy, allocate or somehow affect memory.

Is this bad use of the layered architecture pattern, or is it one of its pitfall ? On one hand, trying to force the pattern upon the library calls, perhaps by adding memory handling wrappers to every application layers, would create a lot of boilerplate code. On the other hand, letting layers, through library calls, create arbitrary entry points into different layers seems to contradict the very rationale behind layered architecture.

Mobius
  • 51
  • 4

1 Answers1

4

Layered Architecture speaks to the flow of business-related data between layers. It has nothing to say about utility libraries; every layer can potentially access a given utility library, just like you have done.

Robert Harvey
  • 198,589
  • 55
  • 464
  • 673
  • 1
    Very true. Otherwise, where would a language's standard library (STL, JFC, etc) fit in? Are only certain layers allowed to use strings? That would be ludicrous. –  Apr 28 '14 at 19:46
  • Agree. altought, its common that Utility Libraries are more applied to inner layers. – umlcat Oct 27 '14 at 17:15