Organizing Domain Logic
Domain Logic != Persistence Logic
Domain Logic = Calculations, Server Side Validations,
Persistence Logic = Filtering, Selecting and Projecting, Saving, Upgrading, Adding, Deleting the Data inside the Data Table
There are many different ways of organizing domain logic in Business Components that encapsulate calculations, validations, and other logic that drives the central functionality of an application.
Fowler defines three architectural patterns (here listed in increasing order of complexity) that designers use to organize domain logic.
Transaction Script.
This pattern involves creating methods in one or a few Business Components (classes) that map directly to the business functionality that the application requires.
The body of each method then executes the logic, often starting a transaction at the beginning and committing it at the end.
This technique is often the most intuitive but is not as flexible as other techniques and does not lead to code reuse.
This pattern tends to view the application as a series of transactions.
======================================
No comments:
Post a Comment