Top Banner
Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 1 Evolutionary Architecture and Design Pradyumn Sharma Pragati Software Pvt. Ltd. www.pragatisoftware.com [email protected]
39

Evolutionary Architecture And Design

Jan 28, 2015

Download

Technology

Naresh Jain

A story of how Evolutionary Architecture was practiced to build an in-house mini-ERP.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 1

Evolutionary Architecture and Design

Pradyumn SharmaPragati Software Pvt. Ltd.

[email protected]

Page 2: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 2

Presenter: Pradyumn Sharma

• CEO, Pragati Software (www.pragatisoftware.com). • 25 years in IT industry.• Training and consulting:

Agile Methodologies, OOAD, UML, Design Patterns, Programming Logic.

Page 3: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 3

About Pragati Software

• IT training and consulting.• About 100 employees. About 30 full-time trainers. • Wide range of subjects, clients.• In-house software development team.

Page 4: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 4

About Pragati Software

Bangalore Chennai

Hyderabad

Mumbai

Pune

Ahmedabad

Vadodara

New Delhi

Shimla

Bhopal Kolkata

Thiruvananthapuram

Page 5: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 5

Our Story…

• Home-grown, ERP application.• CIS = Corporate Information System.• Key modules:

CRM and sales: ClientsLocationsPersons InquiriesProposals Visitsetc

Training operations: Work ordersTraining planningTraining executionFeedback analysisetc

Financial accounting:

Billing CollectionsPaymentsTDSMIS reportsetc.

Page 6: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 6

CIS : Corporate Information System

• Backbone of the organization.• From transactional, operational work …• … to analysis, forecasting tool, strategic tool for decision-

makers.• Currently, a team of 8 people, including one tester.• Technologies: VB.NET, ASP.NET, Oracle, Crystal Reports.• Using a combination of XP and Scrum practices.

Page 7: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 7

Disclaimer

• No single right way of doing things.

• Each project is different, following agile practices based on heresay / a book is not being agile.

Page 8: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 8

Architecture

• What is architecture?• Do we need an architecture for a system?• When? How?

Page 9: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 9

A Traditional Approach…

• Create and document a detailed architecture of the system• Create an application framework• Identify appropriate architecture and design patterns and

apply them to the architecture• Review the architecture• etc.

Page 10: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 10

The Other Extreme…

• No architecture?• Just start coding and refactor?

Page 11: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 11

Architecture and Design Evolution in CIS

• Envision the architecture.• But, incrementally evolve the architecture and design. • Architecture and application framework implemented

through implementation of stories, and refactoring.• Various architectural and design patterns applied over

multiple sprints, through refactoring.

Page 12: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 12

Sprint Zero: Kick Start

• Product vision: Integrated, home-grown mini-ERP application, consisting of CRM,

sales, training operations, and financial accounting.

• Creation of minimal, initial Product Backlog. Examples: Companies, locations. Persons. Also persons within a company. Search, merge options. Company classifications, person classifications. Work orders: General data, venue details, plan dates, execution,

participants’ feedback. Cross-cutting requirement: maker-checker cycle. Cross-cutting requirement: audit trail (change history).

Page 13: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 13

Cross-Cutting Requirement: Change History

Page 14: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 14

Cross-Cutting Requirement: Change History

Page 15: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 15

Sprint Zero: Kick Start

• Product vision• Creation of minimal, initial Product Backlog• Architecture envisioning. Examples:

Layered, Distributed Architecture Model-View Separation Database Platform Independence Creation of an Application Framework to handle common behavior,

cross-cutting requirements Concurrency Performance Security User Interface

Page 16: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 16

First Sprint: Plan

• Goals: Establish development environment. Implement one story (Cities master). Using this story, establish a layered and distributed architecture. Also using this story, implement the maker-checker cycle and audit

trail. Build a miniscule, but deployable product.

• No time-boxing. No effort estimation.• Only two developers initially.

Page 17: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 17

First Sprint: Execution

• Acceptance tests• UI design, approval from

end-users.• Started with a typical form-

centric implementation, no architecture.

Page 18: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 18

Form-Centric Design

Form_load: fetch data from Cities table populate the gridNew_click: display blank entry form //…on return from the entry form re-populate the grid from Cities tableetc.

OK_click: validate data INSERT into Cities values … exit formetc.

Page 19: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 19

First Sprint: Execution

• Acceptance tests• Started with a typical form-centric implementation, no

architecture. • Refactored into a layered architecture.

Page 20: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 20

Layered Architecture

CityUIManager

CityBrowseForm

CityEntryForm

CityController

City

CityDataStore

DDAATTAABBAASSEE

Page 21: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 21

First Sprint: Execution

• Acceptance tests• Started with a typical form-centric implementation, no

architecture. • Refactored into a layered architecture.• Refactored into a distributed architecture.

Page 22: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 22

Distributed Architecture

CityUIManager

CityBrowseForm

CityEntryForm

CityController

City

CityDataStore

DDAATTAABBAASSEE

Page 23: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 23

First Sprint: Execution

• Acceptance tests• Started with a typical form-centric implementation, no

architecture. • Refactored into a layered architecture. • Refactored into a distributed architecture.• Architecture stability and state of completeness: low.• Demo to end-users on its functioning. Feedback from them

on UI and functionality.

Page 24: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 24

Second Sprint: Plan

• Goal: Establish an application framework through refactoring of the existing story and implementation of two more stories.

• Stories selected: Users master and Companies master. • No time-boxing again. No estimation.

Page 25: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 25

Second Story: Companies

Page 26: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 26

Framework Evolution

CityUIManager CityController City

UIManager

CompanyUIManager

Controller

CompanyController

Entity

Company

Page 27: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 27

Framework Evolution

CityUIManager

UIManager

CompanyUIManager

Common behavior in the framework’s classes (such as UIManager), with hook methods for story-specific implementation.

Page 28: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 28

Cross-Cutting Requirement: Change History

• Implemented in one story.• Took up a second story to implement.• Refactored the first story to move the related code to the

application framework.

Page 29: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 29

Second Sprint: Execution

• Refactoring and framework evolution was initially confusing for the inexperienced developer.

• Took about three weeks to accomplish.• Demo to end-users.• End-users were curious and excited too. They were seeing

early results! They were beginning to see the benefits of iterative development, end-user collaboration.

Page 30: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 30

Third Sprint: Plan

• Goal: Deploy a minimal but genuinely usable product.• End-user agreement to start using the system.• Two stories selected for implementation:

Company-Locations Persons master

• Estimation attempted for the first time. Value-driven plan. Estimated time: 14 working days.

Page 31: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 31

Third Sprint: Execution

• Using the framework made this iteration’s implementation much easier.

• Architecture and framework continued to evolve.• Actual time: 17 working days.• Demo to end-users.• Actual deployment for the first time. End-users started using

the system. • Many suggestions for changes in UI and functionality.• Data migration from old system to the new one.• Formal retrospective for the first time.• Even had a retrospective with the end-users.• Fixed sprint duration to three weeks for all subsequent

iterations.

Page 32: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 32

Incremental Architecture and Design

• Evolution across iterations, through implementation-refactoring.

• More architecture work in earlier iterations.

Page 33: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 33

Example: Incremental Design and Implementation

• Complex stories with complex functionality / innovative UI are split, designed and implemented across Sprints. Example: Trainers’ tracking chart.

Page 34: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 34

Architecture and Design Evolution

Page 35: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 35

Architecture and Design Evolution

• Static grid with hard-coded data. Simple navigation keys.• Dynamic grid, data retrieval from database.• Cache table. Auto-refresh. Comments in cells. Navigation

across months.• Cut, Copy, Paste, Excel export options.• Options to add / edit work orders from the grid.• Tracking of incremental changes.

Page 36: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 36

Was Everything Perfect?

• Made wrong decisions occasionally. • Produced waste also. Example:

maker-checker cycle.• Lesson learned: Avoid architecture /

design decisions that stakeholders don’t expressly see value in.

Page 37: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 37

Points to Ponder

• Is UML evil?• Is documenting architecture evil?• Have a separate architect role?

Page 38: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 38

Summary of Principles Followed

• Envision architecture requirements early.• Evolve architecture through implementation of real stories.

Reduces technical risks.• Deliver value to the customer early, while also validating the

architecture and design.• Just-in-time design.• Use before reuse.• Simple models are often the best models.• Apply design patterns / architecture patterns gently.• Prefer architecture that is well-understood rather than well-

documented. Keep your models publicly visible.

Page 39: Evolutionary Architecture And Design

Pragati Software Pvt. Ltd., 312, Lok Center, Marol-Maroshi Road, Marol, Andheri (East), Mumbai 400 059. www.pragatisoftware.com 39

Thank You