Download presentation
Presentation is loading. Please wait.
Published byGodfrey Hunter Modified over 8 years ago
1
Aspect, Rich and Anemic Domain models in Enterprise Information Systems Karel Cemus 1, Tomas Cerny 1, Lubos Matl 1, Michael J. Donahoo 2 1 Czech Technical University, Czech Rep. 2 Baylor University, TX, USA SofSem 2016, Harrachov, Czech Republic, Jan 23-28, 2016 1
2
Motivation Research shows that maintenance of enterprise information systems consumes about 65-75% of the software development time and about 40-60% of maintenance efforts are devoted to software understanding. Comparing 3 design approaches: Anemic domain model Rich domain model Aspect domain model 2 SofSem 2016, Harrachov, Czech Republic, Jan 23-28, 2016
3
3 Enterprise Information Systems Large size and complex Long-time evolution Maintain data Model business processes Respect policies, securities, constraints → business rules Platforms Usually Java EE or.NET Also others cross-cutting concern Motivation SofSem 2016, Harrachov, Czech Republic, Jan 23-28, 2016
4
4/13 Objective Compare ability of common architectures to deal with business rules SofSem 2016, Harrachov, Czech Republic, Jan 23-28, 2016
5
5 Three-layered architecture Anemic Domain Model (ADM) Java EE,.NET MVC-like architecture Rich Domain Model (RDM) Nette for PHP, Django for Python, Rails for Ruby, and Play for Java/Scala ADM fails to address cross-cutting concerns Aspect-driven design approach (extension to ADM) Aspect Domain Model (AsDM) Considered approaches SofSem 2016, Harrachov, Czech Republic, Jan 23-28, 2016
6
6 Enterprise systems optimize business processes and maintain large amounts of data Data management involves User Interface and Web Services Various types of information Domain model, presentation widgets, page layouts, business (domain) rules, text localization… Most of these concerns apply to multiple locations Horizontal and vertical dimensions of the system What is the issue? SofSem 2016, Harrachov, Czech Republic, Jan 23-28, 2016
7
7 Cross-cutting concerns In terms of Aspect-Oriented Programming (AOP) Consider them tangling all 3-layeres 1.Input validation in the presentation layer 2.Business operations in the application layer 3.Constraint verification in the persistence layer Business Rules SofSem 2016, Harrachov, Czech Republic, Jan 23-28, 2016
8
8 In 3-layers architecture Persistence, application and presentation Only data in the domain model Transaction script - operations Functionality in upper layers – logic and constrains tangled Low cohesion High coupling Low encapsulation Anemic Domain Model SofSem 2016, Harrachov, Czech Republic, Jan 23-28, 2016
9
9 Everything in the model Complex field types Validators, renderers, labels Reduces impact of cross-cuts Low cohesion High coupling High encapsulation Rich Domain Model SofSem 2016, Harrachov, Czech Republic, Jan 23-28, 2016
10
10 Business rules as an aspect Described in DSL Single focal point Context-aware weaving High cohesion Low coupling Low encapsulation Aspect Domain Model SofSem 2016, Harrachov, Czech Republic, Jan 23-28, 2016
11
11 Issue tracking system Case Study SofSem 2016, Harrachov, Czech Republic, Jan 23-28, 2016
12
12 Issue tracking system 3 implementations Roles User/Admin CRUD 92 business rules 63 model constraints / 29 operations preconditions 3 layouts – desktop, tablet, cell phone Internationalization 2 sets of widgets Case Study SofSem 2016, Harrachov, Czech Republic, Jan 23-28, 2016
13
13 Anemic Domain Model Java EE 7 Aspect Domain Model Java EE7 JBoss Drools, AspectFaces, AspectJ Rich Domain Model Django / Python Case Study SofSem 2016, Harrachov, Czech Republic, Jan 23-28, 2016
14
14 Model efficiency Case Study SofSem 2016, Harrachov, Czech Republic, Jan 23-28, 2016
15
15 Concerns representation Coupling, cohesion and encapsulation ADM limited reuse AsDM introduces DSL to describe concerns Single focal point Harder to track relation of concerns Especial in context-aware execution RDM tangles all in the model Good encapsulation Single approach for all situations Case Study SofSem 2016, Harrachov, Czech Republic, Jan 23-28, 2016
16
16 Usage Efforts ADM straightforward to deploy AsDM needs many supportive tools/frameworks Compilers/interpreters/weaver Multiple languages in use Steep learning curve RDM central source for information No need for complex tools Single language, easy to learn Case Study SofSem 2016, Harrachov, Czech Republic, Jan 23-28, 2016
17
17 Threats to Validity Internal threats A Java expert design ADM / AsDM in Java EE platform A Python expert proposes RDM All designs are peer reviewed. Two peers conduct manual measurement of the results independently External threats Small representative of a real enterprise system All use cases, scenarios, and model classes create a core of production-size issue trackers Results are scalable to the production-size system We do not use anything specific to this domain Case Study SofSem 2016, Harrachov, Czech Republic, Jan 23-28, 2016
18
18 Anemic Domain Model Difficult maintenance, high error-proneness Aspect Domain Model ~ Rich Domain Model Similar results in the case study Aspect Domain Model Efficiently avoids repetitions and duplications High initial costs, steep learning curve, not production-ready Rich Domain Model Sufficient results for most but not all cases, easy to establish Requires repetitions and mappings to reduce restatement Conclusion SofSem 2016, Harrachov, Czech Republic, Jan 23-28, 2016
19
19 Reduce initial costs of Aspect Domain Model Tailor more efficient DSL Elaborate other transformations SofSem 2016, Harrachov, Czech Republic, Jan 23-28, 2016 Future Work
20
@ inproceedings {cemus2016, Title = {Aspect, Rich and Anemic Domain models in Enterprise Information Systems}, Author = { Cemus, K. and Cerny, T., and Matl, L. and Donahoo, M }, Booktitle = {SOFSEM2016: Theory and Practice of Computer Science}, Isbn = {978-3-662-49191-1}, Month = {January}, Year = {2016}, Pages = {445-456}, Volume ={9587}, Series ={Lecture Notes in Computer Science}, Publisher ={Springer Berlin Heidelberg}, } SofSem 2016, Harrachov, Czech Republic, Jan 23-28, 2016 20 Questions/Answers
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.