The development course and popularization experience of DDD and Dddlib in Heng Tuo Open source

Source: Internet
Author: User
Tags reflection

The concept of domain-driven design (DDD) originates from the book published by 2004 famous modeling expert Eric Evans: "Domain-driven design–tackling complexity in the Heart of Software" (Chinese translation: domain-driven design-the core complexity of software solutions), Chi Jianqiang in an article published in 2011, "Domain-driven design and practice", which describes DDD:

The domain-driven design is in fact an extension and extension of the Ooad, DDD based on object-oriented analysis and design technology, the technical framework of the layered planning, at the same time for each class strategy and classification.

This article is mainly about why we promote DDD in Heng Kai Open source, how we develop dddlib and koala tools to improve this process, the promotion process encountered what problems, and how we solve this problem.

Why to choose DDD

The biggest advantage of the traditional model is that developers are very familiar with the low cost of development, but there are some problems:

Prior to adopting the DDD development model, traditional development models were the most popular model-dao-service-ui development models, usually based on the implementation of transaction scripts (Transaction script) and table module (table modules) patterns, This pattern is usually to design a table, then model, to implement some features that are easy to rely on a particular table, such as stored procedures. A table-based design pattern can easily lead to the following issues:

Business modeling is simply a copy of the table and cannot truly reflect the business

Core business scattered everywhere, very dangerous, it is difficult to modify the expansion, and difficult to read

This development pattern is suitable for small and medium sized projects with little demand and subsequent maintenance and expansion requirements, but in the case of large enterprise-level systems or products, extended maintenance or large demand variables, the disadvantages are obvious.

DDD, by contrast, has the following four benefits:

Object-oriented, model real reflects business reality: Using the DDD domain driver design, the model is usually the real reflection of the business, the business is concentrated in the domain rather than in the service, is conducive to the business understanding.

Use the Domain Unified Modeling Language: conducive to business communication and modeling: DDD Advocates modeling the business first, not the design of the table or script; In the modeling process, because the domain itself is the reflection and modeling of the real business, it is easier to communicate with the business experts and break down the communication barrier between the technology and the business.

High reusability: DDD, the domain layer as the core, each domain object is a relatively complete cohesive business object description, so can form a direct reuse. The design based on domain modeling does not rely on specific databases and features, which can be completely reused and without technical conflict.

The more complex the business, the more obvious the advantages of DDD: Domain models using OO design, by assigning responsibilities to the corresponding model object or service, can well organize the business logic, when the business becomes complex, the domain model shows great advantages.

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.