FS3-AQ Architecture

来源:互联网 发布:天下数据 编辑:程序博客网 时间:2024/04/29 17:37

1、About MerchantSpace Commerce 3
Q:What's MerchantSpace Commerce?
A:Good Architecture .

Architecture Explain:
JSP  <-  Struts      <->TO<->BA<->TO<->BO<->TO<->DAO->TO<->Hibernate<->MySQL
View     Controller         Local Applications               

Business Actions
Business actions are Plain Old  java Objects(POJOs) which act as “facades“ by orchestraing
business processes such as “Submit Order“ which involve other busniess actions as well as
more  fine-grained business objects(aka.domain.objects).All Java objects in MerchantSpace
are POJOs as we have deliberately chosen our architecture in order to avoid the use of Enterprise
Java Beans (EJBs) which have proven to be cumbersome and with excessively high overhead
for most applications which don't require distribute computing (remote method calls).

Business Objects
Business objects are fine grained POJOs which each represent a single domain model object such
as Order.Customer,Address,etc.Business objects may be composed of other business objects in
domain model,but are never composed of higher level business actions.Any business logic which is
isolated to a singel business object is encapsulated in that object resulting in low coupling.

Dao Access Objects
Data access object are POJOs used to abstract data access from the business logic tier.this allows
developers at a later date to replace any piece of our persistence layer(currently Hibernate+a relational database)
with any other persistence technology such as an LDAP reponsitory,a web service or an object database.

Transfer Objects
Transfer objects are POJOs used to carry data to and from diferent application tiers.Transfer objects are
very lightweight objects which only contains properties and accessors.Moving data through the application by
using transfer objects enforces consistency and makes application code much more readable than passing a large
number of arbitray method parameters.

2、About DTO
Q:How to use DTO?Where dose is live?
A:

  • DTOs along with the APIs for each layer help to define the 'Contractual Agreement' between architectural layers
  • DTOs may contain other DTOs or collections of DTOs.
  • DTOs should only contain mutators,accessors and constructors
  • DTOs should Not contain any logic
  • There are two main types of DTOs Database Persistent and Transient

原创粉丝点击