Transactional scripting-domain model

Source: Internet
Author: User

  

Martin Fowler is defined as:
transactional scripting, which organizes all the logic in a single process, makes direct database calls, each business request has its own transactional script, and is the public method of a class.
A domain model is a series of interrelated objects, each representing a meaningful set of independent bodies that can be co-operating together in a large-scale way or as small as a single line.

Transactional scripting overall: just like straight to the topic, straightforward, functional talk function, direct no room for manoeuvre; domain models give people a feeling like they're in the belly. But the domain model is like the literati poets, on a grade, will use the wonderful expression way, have leeway. such as Tang poetry: Qingming season rain, the road pedestrian to rains; Jiewen restaurant where there, the Shepherd points Heng Fa Chuen; This is the domain model description method, if the transaction script way is: qingming I am very sad, sad to drink.


Transactional scripting also uses classes, but not real face objects: Many people are using classes, but they are also using patterns, but their thinking is process-oriented, because there is nothing in their world except the process, how do they differentiate? In fact, it is the process-oriented and object-oriented distinction:
Transactional scripting: revolves around functionality, centered on functionality.
Domain model: Describes the domain classes and accomplishes the required functionality in collaboration between classes.

I understand that the difference between a script and a domain model is whether the class is dead or alive.
The thing script mode is still oriented to process programming, although many classes are defined to be hierarchical business logic, but the defined class is dead, mechanical, like a robot, without its own state, is for the function of the raw, fixed input, fixed output out.

The nature of the domain-driven model is that some classes work together, object-oriented programming, like living people, have their own state, behavior, a group of people work together.

If the project is too small, the two are not good to distinguish, for example, the function is too simple: express delivery, let the robot, or live people to complete the business, the results are the same, so the complexity of the function is too
Small, there is not much difference between the two.
The thing script is process-oriented programming, but with a slight object-oriented color, like a robot, or too mechanical rigid, a lack of a sense of living as a person.
Domain-driven is object-oriented programming, but in fact there is a process (any logic is a process), but at this time not to process-oriented, enhance the subjectivity of the object, it feels that work is not in order to complete the cause to win great achievements, but to meet the human sense of well-being sense of responsibility.


Reference: http://www.jdon.com/34056 domain model vs Transaction Script

Transactional scripting-domain model

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.