1、DDD?CONTENTS01?02DDD?03?X?MonolithsEDALayered architectureModular monolithsMicrokernelSOAService-based architecturesMicroservices?FP?MicroKernelMVCLayered ArchitectureHexagonal ArchitectureOnion ArchitectureScreaming Architecture?BDD?George Fairbanks?Pattern-oriented Software Architecture?+?VS?VSDDD
2、?VS?-?+Software reuse is more like an organ transplant than snapping together Lego blocks.John D.Cook?VS?-?VS?-?CONTENTS01?02DDD?03?+?+?购买 预订 团购 拼团 预打死包 预打半活包 活包 购物车 门票 跟团 酒景 机酒 零售 代理 自营 预约 预售 演出 特产 旅游用车 搭售 分销特产?单品?-?1-?+?-?1-?-?-?1-?-?-?1-?-?-?1-?-?+?-?1-?-?1?2?3?4?-?1-?-?*11*11*1111?1*1*?1*?*1?1*1
3、*?1*?*1?1*?-?1-?-?+?+?-?1-?-?123?-?1-?from Millett S.,Tune N.-Patterns,Principles,and Practices of Domain-Driven Designfrom?-?Enforce linguistic boundaries to protect the validity of a domain term.Linguistic boundaries are bounded context boundaries.?+?2PTS?2PTSbusiness capabilities are often strong
4、 indicators of linguistic boundaries?-?1-?-?Product?+?+?+?+?-?1-?-?Product Product?Product?Product?-?1-?-?+?+?-?2-?/?1?2?-?2-?+?-?-?2-?-?-?2-?-?-?2-?-?-?2-?-?-?2-?UUU?DDDUDDUUDUDDUUDUDUDUDDU?UDUUDDDUDUDUD?-?2-?-?-?-?2-?-?UUU?DDDDDUUDUDDUUDUDUDUDDU?UDDUDUDUUUUDD?-?2-?-?UUU?DDDDUUDUDDUUDUDUDUDDU?DDUDU
5、DUUDUDUDUD?DUUDUDU?UUUUDDDD?-?2-?+?1?2?CONTENTS01?02DDD?03?Module?Component?service?library?Bounded Context?Domain?MicroService?Architectural Quantum?Architectural Style?Problem Space?Solution Space?Architectural Pattern?Design Pattern?Architecture?Module?Bounded Context?Component?service?library?Mi
6、croService?Architectural Quantum?Code?Application architecture?Integration architecture?Architectural Style?Layered architecture monoliths?Modular monoliths?Service-based architectures?Microservices?Architectural Granularity?from Building evolutionary architecture?-?ISPSRPLSPOCPDIPCCPREPCRPADPSDPSAP
7、Agile Software Development,Principles,Patterns,and Practices,First EditionClean Architecture A Craftsmans Guide to Software Structure and DesignRobert C.MartinPackage PrinciplesComponent Principles?OO?ReusabilityMaintainabilityDeployability?Extensibility Deployability?Maintainability?-?ISPSRPLSPOCPD
8、IPCCPREPCRPADPSDPSAP?Driving Force?OO?Group for maintenanceAvoid unneeded releasesGroup for reusers?-?Robert C.MartinPolicyDetail?Eric Evans?DBIOCommunication ProtocolsFrameworksMessagingTransaction Persistence?-?-?Third Party APIMiddle LayerThird Party APIThird Party APIApplicationMiddle LayerClien
9、tClientClientApplication LayerApplication Layer?123User Interface LayerThird Party APIMiddle LayerClientApplication Layer4User Interface Layer?DIP?-?-?Application LayerInfrastructure LayerThird Party APIUser Interface LayerClientDIP4Application LayerInfrastructure LayerThird Party APIUser Interface
10、LayerClientDIP5DIPApplication LayerInfrastructure LayerThird Party APIUser Interface LayerClientDIP6Domain LayerDIPDIP?-?Application LayerInfrastructure LayerThird Party APIUser Interface LayerDomain LayerClientDomainApplicationAdapterThird Party APIThird Party APIClientAdapterAdapterAdapterEntities
11、Use CasesControllersGatewaysPresentersDevicesUIDBExternal InterfacesWeb?Client-Alistair Cockburn-Robert C.Martin-Vaughn Vernon?+DIP?-?-?Application LayerInfrastructure LayerThird Party APIUser Interface LayerDomain LayerClientDomainApplicationAdapterThird Party APIThird Party APIClientAdapterAdapter
12、AdapterEntitiesUse CasesControllersGatewaysPresentersDevicesUIDBExternal InterfacesWeb?Client-Alistair Cockburn-Robert C.Martin?+DIP-Vaughn Vernon?Policy-Eric Evans-Robert C.Martin?-?-?Application LayerInfrastructure LayerThird Party APIUser Interface LayerDomain LayerClientSeparation of Concerns:se
13、parate changes at different rates,for different reasons.SRPLSPBuild Software systems from interchangeable parts.OCPProtect Client from changes in DomainProtect Policy from changes in DetailsDIPPolicy depend on Detail Detail Depend on PolicyThe Axis of Change responsible for the creation of Architectural Boundaries.?