简体   繁体   中英

Is this a right implementation of Layered Architectural Pattern?

I wanna implement The Layered Architectural Pattern to my solution. Can anyone give me the recommendation what should be modified in my structure template? Does it look good with the Layered Architectural Pattern implementation? Thanks

Solution Implementation

Layered Architectural Pattern

Update

Referred to Peter Morlion post , there is Presentation Layer on top of them, but in my project I am not gonna have presentation layer.

So the idea is:

  • The Presentation Layer is where contains graphic design and handles user interaction.
  • The Business Layer is where to handle business logic.
  • The Application Layer is between Business Layer and Presentation Layer.
  • The Data Access Layer contains code to access database.
  • The Database Layer is used to define databases.

It looks fine from a typical MVC, n-tier architecture point of view, as used by standard frameworks like Ruby on Rails, Django, etc.

But you have tagged this question as "Domain-Driven Design," so I will answer from DDD principles. This code and dependency structure are not how you would design from a DDD perspective.

In DDD, your "Business layer", or the "Domain Model" as we usually call it, is at the center. It does not know or care about underlying infrastructure.

Concerns like Database, Cache, etc. are injected into the application layer dynamically through configuration, whenever necessary (even that can be avoided.) Outer layers including APIs, Controllers, Application Layer, Message brokers, etc. look inward into the Business Layer and use it to perform business

I suspect that all this might be difficult to understand outright from my simple statements. I would suggest you pick up a copy of Domain-Driven Design Distilled . It's a relatively small, concise book and gives a good intro into DDD.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM