Patterns of Enterprise Application Architecture, ARCHITECTURE

xiaoxiao2021-03-06  45

1, transaction script vs. Domain model (Transaction Script vs. Domain Model)

The author is different from the complexity of functionality to distinguish between two modes, but ignores another factor: the function increases

The domain model places functions and data in the same object. When you need to add new features, you can only be implemented by adding new methods to objects, which causes the object interface unstable and cannot be in the case where there is no source code. Under functional increase

The transaction script can be flexible to extends how to extends: add a Command Handler subclass, configure it into the system, do not need to change the object interface, do not need to modify the source code

Further, you can use the Visitor mode to bond the domain model and transaction script: core or common functionality domain model model, you can use subcatenization to eliminate complex logic judgment, and reserve an Accept (Visitor) interface to support functionality Expand

In short, when the data changes, the function is often increased (not the same functional logic complexity, but the increase in new functions), the transaction script cooperates with the Command mode with better scalability.

2, table module (Table module)

Is the "Manager" mode variant, managed is not a common memory object, but "actual or virtual table, the line", can be used to hide the data layer, even depending on the relationship between the tables, Can build a Table Module inheritance level

3, Service Layer

When you see the name, I thought it was the "Service Interface" model in "Enterprise.Solution.Patterns.using.microsoft.dot.Net", found that it is a model that I want to find out Because of the mixing of transaction scripts and domain models in their own projects (front 1, transaction script vs. domain models mentioned in the field model, is the problems and programs in their projects), always feel not Pure design, now find that the current design is basically similar to Service Layer, only need to clearly divide "domain logic" and "application logic"

4, Data Mapper (Data Mapper)

When resolving attribute issues only allowing a property problem, the author uses a state-based setter method in addition to the standard CTOR setting, which sets an internal state after the first call, and the subsequent call occurred. When the Assertion error will be thrown; the first author explains the deficiencies of this method: there is a method that does not allow most of the customer calls, otherwise, reflection-based approach will bypass Java's protection mechanism, and this is not recommended

I also often encounter such questions, usually I use "Friend Interface" to solve such problems, see The Programming Language IDIMS

5, inheritance mapper (inheritance mappers)

The author places the Find method in a specific mapper, rather than an abstract mapper, the reason is that the general OO language does not allow the return value type of the virtual function, and it will have to Downcast in the abstract mapper; C support Return value coordination, and Java has also supported return value from 5.0, so the author can modify this section, pull the Find method into the mapping base class; see "Resistance and Coordination [1]", "Resistance and Coordination [2]" 6, query objects (Query Object)

Basically similar to the conditions we use, see http://blog.9cbs.net/gonflow/archive/2004/12/11/212694.aspx

7, Front Controller

A application of Gateway, in addition to the web program, can be used in a message-oriented system

8, controller

Page Controller, Front End Controller, Application Controller

9, distribution mode

Remote appearance service layer service pile data transfer object control reversal, we built a stand-alone or embedded engine: it can be a stand-alone platform, through the web service and message system to respond to the outside request; Ordinary class library, embedded in other systems; changing a configuration item in the configuration file to switch two modes, greatly increase the speed and convenience of regression testing and continuous integration

10, data transmission object

The author explains the DTO serialization explained that .NET built-in custom binary sequence mechanism is superior to Java's built-in custom binary sequence: use dictionaries, enhanced the fault tolerance between different versions of the object, reducing serialization / Deverse sequential sequential dependence; however, the fault tolerance between different versions is to reduce the error of the program, or increase potential dangers?

11, server session status

The author has tested the performance difference between the stateful session bean and the stateless session bean, and the state session bean is not more efficient than the stateless session bean, hundreds of concurrency. The two is similar to the load; this means that performance is no longer a factor affecting the session bean type selection; this is basically similar to HERB SUTTER to "COW, COPY ON WRITE" performance myths subversion

12, entrance (GATEWAY)

In our system, at least the XML and message system uses Gateway or Wrapper Facade, saving a lot of time when the system is transplanted from .NET to J2EE.

转载请注明原文地址:https://www.9cbs.com/read-57054.html

New Post(0)