When is a Use Case layer needed?
In his blog post The Clean Architecture Uncle Bob suggests a 4-layer architecture. I understand the separation between business rules, interfaces and infrastructure, but I wonder if/when it’s necessary to have separate layers for domain objects and use cases. What added value will it bring, compared to just having the uses cases as “domain services” in the domain layer?
Processing a stream. Must layers be violated?
Theoretical situation:
One trillion foobars are stored in a text file (no fancy databases). Each foobar must have some business logic executed on it. A set of 1 trillion will not fit in memory so the data layer cannot return a big set to the business layer. Instead they are to be streamed in 1 foobar at a time, and have business logic execute on 1 foobar at a time. The stream must be closed when finished.
PHP – Data Access Layer
I am currently reviewing a code base and noticed that a majority of the calls (along with DB connections) are just buried inside the PHP scripts. I would have assumed that like other languages they would have developed some sort of data access layer (Like I would do in .Net or Java) for all of the communication to the DB (or implemented MVC, etc). Is this still a common pattern in PHP or is there alternative methodologies/patterns for this technology? I am just trying to understand why the subs would have developed it this way.
Do stored procedures violate three-tier separation?
Some colleagues of mine have told me that having business logic in stored procedures in the database violates the three-tier separation architecture, since the database belongs to the data layer whereas stored procedures are business logic.
When do domain concepts become application constructs?
I recently posted a question regarding recovering a DDD architecture that became an anemic domain model into a multitier architecture and this question is a follow-on of sorts.
Presentation VS Application layer in DDD
I have trouble drawing a clear line between Presentation and Application layer in Domain Driven Design.
Good practices to implement mappers in a multi-tier application
When you are working with a multi-tier application very often you run into task of converting objects in one layer to objects in another layer. This could be converting database objects into domain objects, service objects into domain objects, domain object into view models, etc.
How do the Application and Database Interface Layers interact at their boundary?
I was watching one of Uncle Bob’s videos and he brought up the Database Interface Layer. He had this diagram showing it:
Why doesn’t layered architecture translate easily to tiered architecture?
Basically, I’m trying to understand why layered and tiered are that different, and why they don’t translate easily to each other.
Why is it a good idea for “lower” application layers not to be aware of “higher” ones?
Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted. In a typical (well-designed) MVC web app, the database is not aware of the model code, the model code is not aware of the […]