Impact of Agile Methodology on Software Architecture Hessam Modaberi | Software Architecture course
Agenda 01 | Agility through Scrum Framework 02 | Architectural Agility 03 | Dependency Injection
01 | Agility through Scrum Framework
Why Agile? Two potential waterfall problems Freeze Requirements Building an architecture for emergent problem space is difficult Considerable effort before delivering any feature to user
What is Agile development ? Agile SDLC model is a combination of iterative and incremental process model Requirements
Definition of Scrum Scrum (n): A framework within which people can address complex adaptive problems, while productively and creatively delivering products of the highest possible value.
Scrum Theory Scrum is founded on empirical process control theory, or empiricism Three pillars: Transparency (definition of DONE) Inspection Adaptation
The Sprint The heart of Scrum, a time-box of one month or less during which a “Done”, useable, and potentially releasable product Increment is created. (Iteration)
Product Backlog and Spring Backlog PBI The Product Backlog lists all features, functions, requirements, enhancements, and fixes that constitute the changes to be made to the product in future releases. The Sprint Backlog is the set of Product Backlog items selected for the Sprint. Product Backlog
Scrum Team Product Owner - is the sole person responsible for managing the Product Backlog Development Team – 3 to 9 team members Scrum Master - is responsible for ensuring Scrum is understood and enacted Two Scrum team characteristics : self-organizing cross-functional
Scrum Events Sprint Retrospective All events are time-boxed events Duration: 3 hours All events are time-boxed events One month sprint Spring planning Duration: 8 hours Sprint Review Duration: 4 hours Daily Scrum Duration: 15 min Input to this meeting: Product backlog Latest product increment Capacity of dev team Any impediments?
02 | Architectural Agility
The Challenge The critical role of the underlying architecture is often overlooked Enhancement Agility: the ability to keep adjusting the product to emerging needs through the addition of new features. Agile approach has its shortfalls stemming mainly from dependency analysis: Individual stories cannot be regarded in isolation Stories have dependencies upon the architectural elements of the system.
Problem Demonstration (Example) Authentication and Authorization with ACL, leads to change Security Arc component Business need (Sprint 1): System users have different accesses based on their roles
Problem Demonstration (2) Business need changes (Sprint 2): Users have access based-on their permissions
Result of preceding approach Too-familiar situation features gradually take longer and longer to implement code becomes more and more buggy Eventually, the system must be scrapped and rewritten “from scratch”
Architectural Agility A Thesis from Carnegie Mellon University and Software Engineering Institute (SEI) Architectural Agility allows architectural development to follow a “just-in-time” model. A steady and consistent focus on continuing architectural evolution in support of emerging customer-facing features (instead of myopic focus on user stories).
Architectural Agility (2) Without Architectural Agility, Enhancement Agility cannot be reliably sustained. Truly optimizing user value requires teams to look ahead and anticipate future needs The architecture should not over-anticipate emergent needs, delaying delivery of user value and risking development of overly complex and unneeded architectural constructs
Architectural Agility (3) Architectural anticipation must be “informed. “informed anticipation” can be achieved through: Dependency Analysis Real-option Analysis Technical debt
Agile Release Planning Architectural Elements in Agile Iteration planning
Architecture Dependency Management Dependency Structure Matrix (DSM) Domain Mapping Matrices (DMM)
Real-option Analysis and Technical debt Management Technical debt: The extra development work that arises when code that is easy to implement in the short run is used instead of applying best overall solution. In agile release planning, real options analysis is a way to look at the allocation of architectural elements to releases based on their dependencies from the perspective of future value.
Architecture Heuristics while not required for the current release, should potentially be incorporated into the current release in anticipation of future stakeholder goals.
03 | Dependency Injection
Why Dependency Injection? Often, Agile projects are rapidly fielded! Ward Cunningham: “ Dependency injection is a key element of agile architecture”
Data Access Object (DAO) Presentation CostomerService addCustomre(..) Has following dependencies : createCustomer(..) createAuthority(..) doTask3(..) doTask4(..) Business Layer Service CustomerDao createCustomer(..) Data Layer Data Access Object (DAO) AuthorityDao createAthority(..) DB
Dependent Classes Bridge Design Pattern Interface A Class 2 implements Class 1 uses class 2 through Interface A Class 1 Class 2 Class 1 depends on Class 2 Server Client These two classes are loosely coupled classes
Dependency Injection Explanation public class TextEditor { private SpellChecker spellChecker; public TextEditor() { spellChecker = new SpellChecker(); }
Dependency Injection Explanation (2) public class TextEditor { private SpellCheckerInterface spellChecker; public TextEditor(SpellCheckerInterface spellChecker ) { this.spellChecker = spellChecker; }
DI in Java Spring IoC Container Context Dependency Injection (Oracle Standard)
Thank you!