Showing posts with label Domain Module. Show all posts
Showing posts with label Domain Module. Show all posts

Wednesday, October 25, 2017

Enterprise Application Architecture Design Patterns - Domain Logic Patterns, Session State Patterns, Data Source Patterns

Session State Patterns

 For standard enterprise application, session could be stored in:


Client Session State

it is commonly stored as Cookies in browsers.

Server Session State

it is commonly stored in a clustered cache such as ones provided by JBoss, WebSphere application servers.

Database Session State

It is a database or other data store. For big data solutions, optimized data stores such as Cassandra could be used to handle the high throughput and data volume that traditional databases may not be able to perform well.

Domain Logic Patterns

Transaction Script

Many financial applications may still use stored procedures that put business logic very close to data.
Some simple application may just put all business logic in scripts

Table Module

Some popular frameworks expose an UI that users may hook up tables easily. This kind of mechanisms usually are back up by Table Module that is a single instance that handles the business logic for all rows in a database table.

Domain Model and Service Layer

More complicated applications usually require to start with a domain model first, then a service layer is used to control the abstracted functions that are exposed as services.

Data Source Architectural Patterns

Table Data Gateway

encapsulate the data in a table and its queries in an object, then expose it as a POJO

Row Data Gateway

expose the data in a POJO without any query concerns

Active Record

Incorporate business logic into data access object

Data Mapper

In ORM frameworks, the mapping meta data between objects and tables are stored in separate XML files or annotations. The data is mapped to Entity and Value Object, and many times organized in an aggregate.

Object-Relational Metadata Mapping Patterns

Metadata Mapping

XML files or annotations

Query Object

Object oriented query language that is a wrapper over SQL

Repository

Manages data retrieving functions in a framework core component, in Hibernate/JPA, it is the EntityManager.