Abbiamo il nostro splendido Domain Model, e possiamo passare la vita a definire DTO per usarlo in modo “sostenibile”. Oppure possiamo metterlo (un po’) in disparte ed adottare CQRS, ammesso che non ci venga mai da dire: “che spreco”. Oppure possiamo optare per una terza via idiomatica: Layered Expression Trees. Parliamone.
CQRS, ovvero: 2 stack, uno per "leggere" e l'altro per "scrivere". Se per "scrivere" abbiamo l'imbarazzo della scelta (Domain Model, Command, Event Sourcing, ...) per leggere, invece, apparentemente c'è poco da dire. "Apparentemente", appunto. Parliamone :-)
Introduzione al Domain Driven Design (DDD)DotNetMarche
In questa sessione si approfondirà il concetto di Domain Driven Design, un principio di progettazione che può essere visto come una “forma-mentis” per aiutare a concepire e modellare applicazioni enterprise che fanno un forte uso del Domain Model. Questa metodologia, introdotta da Eric Evans, mette in risalto il dominio applicativo di un progetto, costituendo quindi il collante tra il modello analitico e il modello implementativo e trovando la sua naturale applicazione in ambienti di sviluppo agili come Extreme Programming. Come completamento della sessione verranno esaminate alcune tecniche di Layering e pattern architetturali che ben si sposano con questa tecnica.
This presentation talks about structural design patterns. In software engineering, structural design patterns are design patterns that ease the design by identifying a simple way to realize relationships between entities. In particular in the slides are described the following patterns:
- Decorator
- Proxy
- Facade
- Adapter
Design patterns are presented using examples in Java, Scala and Javascript.
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
CQRS, ovvero: 2 stack, uno per "leggere" e l'altro per "scrivere". Se per "scrivere" abbiamo l'imbarazzo della scelta (Domain Model, Command, Event Sourcing, ...) per leggere, invece, apparentemente c'è poco da dire. "Apparentemente", appunto. Parliamone :-)
Introduzione al Domain Driven Design (DDD)DotNetMarche
In questa sessione si approfondirà il concetto di Domain Driven Design, un principio di progettazione che può essere visto come una “forma-mentis” per aiutare a concepire e modellare applicazioni enterprise che fanno un forte uso del Domain Model. Questa metodologia, introdotta da Eric Evans, mette in risalto il dominio applicativo di un progetto, costituendo quindi il collante tra il modello analitico e il modello implementativo e trovando la sua naturale applicazione in ambienti di sviluppo agili come Extreme Programming. Come completamento della sessione verranno esaminate alcune tecniche di Layering e pattern architetturali che ben si sposano con questa tecnica.
This presentation talks about structural design patterns. In software engineering, structural design patterns are design patterns that ease the design by identifying a simple way to realize relationships between entities. In particular in the slides are described the following patterns:
- Decorator
- Proxy
- Facade
- Adapter
Design patterns are presented using examples in Java, Scala and Javascript.
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
Enterprise Spring and Flex applicationsmarcocasario
SpringSource ha recentemente annunciato Spring BlazeDS Integration, un nuovo progetto open source per permettere una facile integrazione tra il framework Spring e Adobe BlazeDS, una tecnologia open source basata su server Java remoting e Web messaging.
Il plugin di SpringSource fornisce un approccio più semplice ed intuitivo agli sviluppatori Spring e Java per creare Enterprise Rich Internet Applications utilizzando il framework Adobe Flex, una pietra miliare della Flash Platform.
In questa sessione ai partecipanti verrà fornita una panoramica del framework Flex e di BlazeDS, illustrando i vantaggi e le modalità di integrazione al framework Spring attraverso il plugin Spring BlazeDS.
Never Mind the Bollocks: here's the Domain Driven DesignAndrea Saltarello
La lettura del Blue Book può generare reazioni che vanno dal "Cargo cult" (a.k.a. "non avrai altro Modello all’infuori di me") a "’sta roba non mi serve: io faccio gestionali, non applicazioni che lanciano i razzi sulla Luna".
Previa una attualizzazione dei concetti del Blue Book, che ha ormai compiuto 10 anni, in questa sessione affronteremo leggende metropolitane e falsi miti e implementeremo DDD mostrando poche slide e tanto codice.
In data Mercoledì 13 Giugno 2012 in aula 4, dalle 9:00 alle 10:30,il dott. Alessandro Forte della T.&C. Systems Group s.r.l. ha tenuto un seminario sull'Object-Relational Mapping.
Il dott. Forte è attualmente SW Architect per la T.&C. Systems Group s.r.l. e speaker certificato Microsoft Italia.
Si è trattato di un'importante occasione per affacciarsi a nuovi argomenti di interesse del mondo produttivo e allo stesso tempo entrare in contatto con una società attiva sul territorio. Si ringrazia il prof. Antonio Maratea per l'occasione concessa e la disponibilità dimostrata.
This presentation talks about the main features of UML activity diagrams. The slides contain information about which are the main components of activity diagrams, how to use them to represent business processes and software algorithms.
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation talks about the main features of UML class diagrams. The slides contain information about how to represent a class, what is a classe feature, what are possible association types, class dependency, hineritance and subtyping.
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
Loosely Coupled Complexity - Unleash the power of your domain modelFrancesca1980
Common software architectures are full of well-established assumptions. But some of them are flawed, no longer valid or relevant. Changing the rules of the game using DDD, CQRS and Event Sourcing can lead to systems which are more scalable, maintainable and performing. And which are fun to code as well.
This presentation introduces the concept of design pattern in object oriented programming and design. The slides contain information about what a design pattern is, why should we use design pattern and how design patterns could be grouped togheter. The ideas presented in the slides are taken directly from GoF's book "Design Patterns".
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
Case study: un approccio modulare in un progetto legacyMariano Fiorentino
L'utilizzo di Zend Framework 1 all'interno del progetto Link, software usato da una 'fabbrica automobilistica torinese' per fornire servizi ai concessionari. Link è probabilmente il software in php più grande d'Europa con più di 6 milioni di righe di codice, nato nel 2003 utilizzando la versione 4 del linguaggio, Il talk illustrerà come negli anni si è passati dallo scriversi tutto in casa all'utilizzo dei moduli zend per abbassare i costi di sviluppo, migliorare la scalabilità e limitare le anomalie.">Case study: un approccio modulare in un progetto legacy
In questa sessione vedremo come realizzare un Data Access Layer basato su una implementazione del Repository pattern ed in grado di essere interrogabile mediante query LINQ, eventualmente delegate ad O/RM quali Entity Framework e/o NHibernate. Vedremo inoltre come fare utilizzo dei Code Contracts del FX4 per specificare "una tantum" le regole comuni a tutti i repository di un Domain Model.
The Fine Art of Time Travelling: implementing Event SourcingAndrea Saltarello
If there is a common practice in architecting software systems, it is to have them store the last known state of business entities in a relational database: this practice trades the easiness of implementation with the cost of losing the history of such entities. Event Sourcing provides a pivotal solution to this problem, giving systems the capability of restoring the state they had at any given point in time. Furthermore, injecting mock-up events and having them replayed by the business logic allows for an easy implementation of simulations and “what if” scenarios.
More Related Content
Similar to Layered Expression Trees: una terza via (idiomatica) verso il DDD
Enterprise Spring and Flex applicationsmarcocasario
SpringSource ha recentemente annunciato Spring BlazeDS Integration, un nuovo progetto open source per permettere una facile integrazione tra il framework Spring e Adobe BlazeDS, una tecnologia open source basata su server Java remoting e Web messaging.
Il plugin di SpringSource fornisce un approccio più semplice ed intuitivo agli sviluppatori Spring e Java per creare Enterprise Rich Internet Applications utilizzando il framework Adobe Flex, una pietra miliare della Flash Platform.
In questa sessione ai partecipanti verrà fornita una panoramica del framework Flex e di BlazeDS, illustrando i vantaggi e le modalità di integrazione al framework Spring attraverso il plugin Spring BlazeDS.
Never Mind the Bollocks: here's the Domain Driven DesignAndrea Saltarello
La lettura del Blue Book può generare reazioni che vanno dal "Cargo cult" (a.k.a. "non avrai altro Modello all’infuori di me") a "’sta roba non mi serve: io faccio gestionali, non applicazioni che lanciano i razzi sulla Luna".
Previa una attualizzazione dei concetti del Blue Book, che ha ormai compiuto 10 anni, in questa sessione affronteremo leggende metropolitane e falsi miti e implementeremo DDD mostrando poche slide e tanto codice.
In data Mercoledì 13 Giugno 2012 in aula 4, dalle 9:00 alle 10:30,il dott. Alessandro Forte della T.&C. Systems Group s.r.l. ha tenuto un seminario sull'Object-Relational Mapping.
Il dott. Forte è attualmente SW Architect per la T.&C. Systems Group s.r.l. e speaker certificato Microsoft Italia.
Si è trattato di un'importante occasione per affacciarsi a nuovi argomenti di interesse del mondo produttivo e allo stesso tempo entrare in contatto con una società attiva sul territorio. Si ringrazia il prof. Antonio Maratea per l'occasione concessa e la disponibilità dimostrata.
This presentation talks about the main features of UML activity diagrams. The slides contain information about which are the main components of activity diagrams, how to use them to represent business processes and software algorithms.
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation talks about the main features of UML class diagrams. The slides contain information about how to represent a class, what is a classe feature, what are possible association types, class dependency, hineritance and subtyping.
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
Loosely Coupled Complexity - Unleash the power of your domain modelFrancesca1980
Common software architectures are full of well-established assumptions. But some of them are flawed, no longer valid or relevant. Changing the rules of the game using DDD, CQRS and Event Sourcing can lead to systems which are more scalable, maintainable and performing. And which are fun to code as well.
This presentation introduces the concept of design pattern in object oriented programming and design. The slides contain information about what a design pattern is, why should we use design pattern and how design patterns could be grouped togheter. The ideas presented in the slides are taken directly from GoF's book "Design Patterns".
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
Case study: un approccio modulare in un progetto legacyMariano Fiorentino
L'utilizzo di Zend Framework 1 all'interno del progetto Link, software usato da una 'fabbrica automobilistica torinese' per fornire servizi ai concessionari. Link è probabilmente il software in php più grande d'Europa con più di 6 milioni di righe di codice, nato nel 2003 utilizzando la versione 4 del linguaggio, Il talk illustrerà come negli anni si è passati dallo scriversi tutto in casa all'utilizzo dei moduli zend per abbassare i costi di sviluppo, migliorare la scalabilità e limitare le anomalie.">Case study: un approccio modulare in un progetto legacy
In questa sessione vedremo come realizzare un Data Access Layer basato su una implementazione del Repository pattern ed in grado di essere interrogabile mediante query LINQ, eventualmente delegate ad O/RM quali Entity Framework e/o NHibernate. Vedremo inoltre come fare utilizzo dei Code Contracts del FX4 per specificare "una tantum" le regole comuni a tutti i repository di un Domain Model.
The Fine Art of Time Travelling: implementing Event SourcingAndrea Saltarello
If there is a common practice in architecting software systems, it is to have them store the last known state of business entities in a relational database: this practice trades the easiness of implementation with the cost of losing the history of such entities. Event Sourcing provides a pivotal solution to this problem, giving systems the capability of restoring the state they had at any given point in time. Furthermore, injecting mock-up events and having them replayed by the business logic allows for an easy implementation of simulations and “what if” scenarios.
When you use the Event Sourcing pattern in a .NET application, your data source just consists of persisted events. You don’t likely have a classic relational data store; all you store are events, and you store them sequentially as they occur in the domain. As you can guess, persisting events instead of a domain model has a significant impact on the way you organize the back end of the system. In this talk, we just develop a mini-ERP application that works out of distinct command and query stacks and persists just events. We also discuss how to rebuild state from events and see how to manage snapshot in order to speed up OLTP performances. Overall, this session presents a concrete example of an application architecture that for its inherent simplicity and maintainability is gaining momentum whether you have a complex business scenario to scale out or a just a CRUD system a bit more sophisticated than plain CRUD.
Applying DDD and CQRS can not only make the resulting design of our system simpler and more effective but, freeing us from the burdenof the “one model fits all” approach, also allows architects to adopt different strategies when it comes to business logic modeling. Though lot has been written about DDD and CQRS, missing working code publicly available seems to be the elephant in the room: in this talk, we’ll find out how to implement the “Command side of the Force” by means of a proper Domain Model and getting to the point of switching from an entity based modeling to an event based one.
Learn how to design a web solution that exploits the ASP.NET stack: in this talk we’ll find out how to set up an effective, idiomatic design that take advantage of both “out of the box” tools (e.g. MVC, Entity Framework) and bleeding edge, third party ones. Needing a SPA? We’ll understand how to take advantage of existing toolkits. Responsive design? Let’s talk Bootstrap looking at how it provides a useful and highly customizable taxonomy for UI elements. Having troubles implementing an efficient data access layer due to a lot of business rules? We’ll learn how to use LINQ as a mean to decompose those rules in simpler ones that can be composed in a flexible and efficient way. Are you concerned about performance and scalability issues? We’ll see how to implement CQRS in order to take advantage of ad hoc data models and introduce a service bus so to decouple front-end systems from back-end ones.
A prima vista, MVC “is all about the presentation layer”. In realtà, per trarre il massimo giovamento da questo toolkit è necessario progettare l’intera soluzione utilizzando criteri ad hoc.
Code Contracts and Generics: implementing a LINQ-enabled RepositoryAndrea Saltarello
In questa sessione vedremo come implementare il Repository pattern in modo da creare un Data Access Layer interrogabile mediante query LINQ, delegando l'effettiva esecuzione delle stesse ad O/RM quali Entity Framework e/o NHibernate.
Layered Expression Trees: una terza via (idiomatica) verso il DDD
1. Layered Expression Trees: una
terza via (idiomatica) verso il DDD
Andrea Saltarello
Software Architect @ Managed Designs
andysal@gmail.com
http://twitter.com/andysal74
http://blogs.ugidotnet.org/pape
http://creativecommons.org/licenses/by-nc-nd/2.5/ managed/designs
4. Architettura di DDD
è una layered architecture
i layer Presentation e Infrastructure compaiono
«per sport» nel diagramma
i layer Application e Domain costituiscono quella
che tipicamente chiamiamo «business logic»
Domain: logica invariante per i casi d’uso
Application: logica specifica ai casi d’uso
managed/designs
5. Application Layer: in teoria
Application Layer: defines the jobs the software is
supposed to do and directs the expressive domain
objects to work out problems. The tasks this layer is
responsible for are meaningful to the business or
necessary for interaction with the application layers
of other systems. This layer is kept thin. It does not
contain business rules or knowledge, but only
coordinates tasks and delegates work to
collaborations of domain objects in the next layer
down. It does not have state reflecting the business
situation, but it can have state that reflects the
progress of a task for the user or the program.
managed/designs
6. Application Layer: in pratica
E’ un catalogo di servizi in grado di effettuare il mesh
della logica presente nel domain layer esponendola
alla applicazione (es: presentation layer) in una
forma ad… alta digeribilità
managed/designs
7. Real world DDD
Avere a disposizione un domain layer «smart» è
bello, ma costoso:
Materializzazione degli oggetti
Mesh della business logic
Tipicamente, si finisce per passare la vita a «fare
DTO»:
Domain Layer <-> Application Layer
Application Layer <-> Presentation Layer
managed/designs
8. Layered Expression Trees (LET idiom)
Facciamo un gioco: invece di definire un «botto» di DTO,
facciamo che layer e servizi si scambino degli
IQueryable<YourFavouriteDomainEntity>, facendo
«emergere» la query e specificando la proiezione solo
all’ultimo momento?
L’espressione «Capra e cavoli» vi dice niente?
managed/designs
10. Books & Publications
[DDD] Domain Driven Design, Eric Evans , Addison-
Wesley
[P of EAA] Pattern of Enterprise Application
Architecture, Martin Fowler, Addison-Wesley
[NSK] NSK, http://nsk.codeplex.com
managed/designs
Editor's Notes
Abbiamo il nostro splendido Domain Model, e possiamo passare la vita a definire DTO per usarlo in modo “sostenibile”. Oppure possiamo metterlo (un po’) in disparte ed adottare CQRS, ammesso che non ci venga mai da dire: “che spreco”. Oppure possiamo optare per una terza via idiomatica: LayeredExpressionTrees. Parliamone.