• Plugin Argument • Use Cases Implementation Guided By Tests • Ports and Adapters Explained • The User Interface is a Detail • Frameworks are Details • Sample Application • Wrapping up • References
Layer MediatR and AutoMapper Data Layer Entity Framework and Dapper Database and Messaging SQL Server and RabbitMQ IDE and Tools Visual Studio, Resharper and .NET Framework 4 @ivanpaulovich
Layer MediatR and AutoMapper Data Layer Entity Framework and Dapper Database and Messaging SQL Server and RabbitMQ IDE and Tools Visual Studio, Resharper and .NET Framework 5 @ivanpaulovich Not a Software Architecture!
Follows the Ports and Adapters pattern (Hexagonal Architecture). • Implementation is guided by tests. • Decoupled from technology details. • Lots of Principles (SAP, SDP, SOLID..) • Pluggable User Interface @ivanpaulovich
pre-ordered tickets Order tickets Customer Movie Catalog Order System Credit Processing Use Cases • Use Cases are delivery independent. • Show the intent of a system. • Use Cases are algorithms that interpret the input to generate the output data. • Primary and secondary actors. 8 @ivanpaulovich
Presenters D evices W eb UI DB External Interfaces @ivanpaulovich •Abstractness increases with stability. •Depend in the direction of stability. •Classes that change together are packaged together.
/ NoSQL <<interface>> 2nd Fake Storage 1st Development Order 19 @ivanpaulovich • The dependencies point in the direction of the abstract components. • The simplest component version are implemented first.
/ NoSQL Fake Storage Cloud Storage Development Order • The dependencies point in the direction of the abstract components. • The simplest component version are implemented first. • Defer decisions. Keep the options open as long as possible! <<interface>> 1st 2nd 3rd 20 @ivanpaulovich
the first consumers implemented. • Design the Use Cases with Single Responsibility Principle in mind. • Fake implementations are the first delivery mechanisms implemented. • Test Cases help you design fine grained Use Cases (Interface Segregation Principle). Test Cases Use Cases Fake Persistence Core Layer Infrastructure Layer Test Suite 21 @ivanpaulovich
the first consumers implemented. • Design the Use Cases with Single Responsibility Principle in mind. • Fake implementations are the first delivery mechanisms implemented. • Test Cases help you design fine grained Use Cases (Interface Segregation Principle). 22 @ivanpaulovich
needs and are implemented and tested in isolation. 2. Components could be replaced, upgraded or decommissioned with minimum Core business impact. 3. Good components are loosely coupled. Test Cases Infrastructure Layer Test Suite SQL Storage 24 @ivanpaulovich
be under control. • Hide 3rd party libraries, use them behind core interfaces. • The .NET Framework is a detail. • Keep outside the Business Layer: Reflection, Linq, Entity Framework, MVC, Data Annotations, WCF. 34 @ivanpaulovich
and the use cases are the central organising principle. • Use cases implementation are guided by tests. • The User Interface and Persistence are designed to fulfil the core needs (not the opposite!). • Defer decisions by implementing the simplest component first. 45 @ivanpaulovich