Agile Software Development

Slides:



Advertisements
Similar presentations
Welcome to. Who am I? A better way to code Design Patterns ???  What are design patterns?  How many are there?  How do I use them?  When do I use.
Advertisements

18-1 Verifying Object Behavior and Collaboration Role playing – the act of simulating object behavior and collaboration by acting out an object’s behaviors.
General OO Concepts and Principles CSE301 University of Sunderland Harry R. Erwin, PhD.
Lecture 9 Improving Software Design CSC301-Winter 2011 – University of Toronto – Department of Computer Science Hesam C. Esfahani
05/26/2004www.indyjug.net1 Indy Java User’s Group June Knowledge Services, Inc.
Dept. of Computer Engineering, Amirkabir University of Tech. 1 Design Patterns Dr. Noorhosseini Introduction.
Design Patterns CS is not simply about programming
Design Patterns. What are design patterns? A general reusable solution to a commonly occurring problem. A description or template for how to solve a problem.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Design Patterns.
Developed by Reneta Barneva, SUNY Fredonia Component Level Design.
Design Patterns Module Name - Object Oriented Modeling By Archana Munnangi S R Kumar Utkarsh Batwal ( ) ( ) ( )
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
Vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie Idioms and Patterns polymorphism -- inheritance and delegation idioms -- realizing.
Design Patterns Standardized Recurring model Fits in many location Opposite of customization Fundamental types of pattern Choose and use as desired and.
Todd Snyder Development Team Lead Infragistics Experience Design Group.
05 - Patterns Intro.CSC4071 Design Patterns Designing good and reusable OO software is hard. –Mix of specific + general –Impossible to get it right the.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
Introduction to SOLID Principles. Background Dependency Inversion Principle Single Responsibility Principle Open/Closed Principle Liskov Substitution.
Design Patterns CSCI 5801: Software Engineering. Design Patterns.
18 April 2005CSci 210 Spring Design Patterns 1 CSci 210.
Software Design Patterns (1) Introduction. patterns do … & do not … Patterns do... provide common vocabulary provide “shorthand” for effectively communicating.
Design Patterns Façade, Singleton, and Factory Methods Team Good Vibrations (1)
ECE450S – Software Engineering II
Design Patterns CSIS 3701: Advanced Object Oriented Programming.
Introduction to Design Patterns. Questions What is a design pattern? Who needs design patterns? How different are classes and objects in APL compared.
What to know for the exam. Smalltalk will be used for questions, but there will not be questions about the grammar. Questions might ask – how particular.
Proxy.
Behavioral Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-1 PS95&96-MEF-L10-1 Dr. M.E. Fayad Creationa.
Software Design Patterns Curtsy: Fahad Hassan (TxLabs)
Design Patterns. 1 Paradigm4 Concepts 9 Principles23 Patterns.
Five design principles
Design Patterns Introduction
Using Software Design Patterns Bill Anderson. About me Fox developer since 1987 Fox developer since 1987 Program Director, Los Angeles Visual Foxpro Developers.
Design Patterns SE464 Derek Rayside images from NetObjectives.com & Wikipedia.
1 Chapter 5:Design Patterns. 2 What are design pattern?  Schematic description of design solution to recurring problems in software design and,  Reusable.
Object-Oriented Programming © 2013 Goodrich, Tamassia, Goldwasser1Object-Oriented Programming.
Design Patterns in Context ©SoftMoore ConsultingSlide 1.
CHAPTER 3 MODELING COMPONENT-LEVEL DESIGN.
SOLID Design Principles
Five Minute Design Patterns Doug Marttila Forest and the Trees May 30, 2009 Template Factory Singleton Iterator Adapter Façade Observer Command Strategy.
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
Design Patterns CSCE 315 – Programming Studio Spring 2013.
Design Engineering 1. Analysis  Design 2 Characteristics of good design 3 The design must implement all of the explicit requirements contained in the.
Mantas Radzevičius ifm-2/2
The Object-Oriented Thought Process Chapter 15
Software Architecture & Difference from Design
Chapter 10 Design Patterns.
Chapter 5:Design Patterns
MPCS – Advanced java Programming
Design Patterns Lecture part 2.
Introduction to Design Patterns
CMPE 135: Object-Oriented Analysis and Design October 24 Class Meeting
Copyright © by Curt Hill
Distribution and components
Software Quality Engineering
Design Patterns with C# (and Food!)
object oriented Principles of software design
Adaptive Code Umamaheswaran Senior Software Engineer
Software Engineering Lecture 7 - Design Patterns
Tools of Software Development
Informatics 122 Software Design II
Object-Oriented Design
DESIGN PATTERNS : Introduction
CMPE 135 Object-Oriented Analysis and Design March 21 Class Meeting
Informatics 122 Software Design II
Chapter 8, Design Patterns Introduction
Object Oriented Design & Analysis
Dependency Inversion principle
Chapter 10 – Component-Level Design
Presentation transcript:

Agile Software Development And how Patterns and Practices constitute

Agenda Why and what “Agile Software Development” Writing SOLID code Framework Design Guidelines Design Patterns Practices Real life

Why and what “Agile Software Development”

Why “Agile Software Development” Customers: Don’t know what they need Define requirements based on existing systems Need to be able to change requirements even late in the process Developers: Don’t know what customers need Interpret requirements based on their experience Must deliver working software

Results The Dutch government looses four up to five billions of euro’s every year! € 5.000.000.000 a year == € 1.585,49 per second € 296,72 per resident

What is “Agile Software Development”? Agile software development is a group of software development methods based on iterative and incremental development, where requirements and solutions evolve through collaboration between self-organizing, cross-functional teams. It promotes adaptive planning, evolutionary development and delivery, a time-boxed iterative approach, and encourages rapid and flexible response to change. It is a conceptual framework that promotes foreseen tight iterations throughout the development cycle.

Agile Manifesto Individuals and interactions over Processes and tools Working software over Comprehensive documentation Customer collaboration over Contract negotiation Responding to change over Following a plan That is, while there is value in the items on the right, we value the items on the left more The Agile Manifesto In February 2001, 17 software developers met at the Snowbird, Utah resort, to discuss lightweight development methods. They published the Manifesto for Agile Software Development to define the approach now known as agile software development. Some of the manifesto's authors formed the Agile Alliance, a non-profit organization that promotes software development according to the manifesto's values and principles.

Writing SOLID code

What is SOLID code Single Responsibility Principle (SRP) Open/Closed Principle (OCP) Liskov Substitution Principle (LSP) Interface Segregation Principle (ISP) Dependency Inversion Principle (DIP) SOLID (Single responsibility, Open-closed, Liskov substitution, Interface segregation and Dependency inversion) is a mnemonic acronym introduced by Michael Feathers for the "first five principles" named by Robert C. Martin in the early 2000s that stands for five basic principles of object-oriented programming and design. The principles, when applied together, intend to make it more likely that a programmer will create a system that is easy to maintain and extend over time. The principles of SOLID are guidelines that can be applied while working on software to remove code smells by causing the programmer to refactor the software's source code until it is both legible and extensible. It is part of an overall strategy of agile and adaptive programming.

Single Responsibility Principle A class should have only a single responsibility Only one potential change in the software's specification should be able to affect the specification of the class single responsibility principle states that every class should have a single responsibility, and that responsibility should be entirely encapsulated by the class. All its services should be narrowly aligned with that responsibility.

Open/Closed Principle Software should be open for extension, but closed for modification. Open/Closed Principle Abstractions are abstract base classes, and the unbounded group of possible behaviors is represented by all the possible derivative classes. It is possible for a module to manipulate an abstraction. Such a module can be closed for modification since it depends upon an abstraction that is fixed. Yet the behavior of that module can be extended by creating new derivatives of the abstraction.

Liskov Substitution Principle Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program Substitutability is a principle in object-oriented programming. It states that, in a computer program, if S is a subtype of T, then objects of type T may be replaced with objects of type S (i.e., objects of type S may substitute objects of type T) without altering any of the desirable properties of that program (correctness, task performed, etc.). More formally, the Liskov substitution principle (LSP) is a particular definition of a subtyping relation, called (strong) behavioral subtyping, that was initially introduced by Barbara Liskov in a 1987 conference keynote address entitled Data abstraction and hierarchy. It is a semantic rather than merely syntactic relation because it intends to guarantee semantic interoperability of types in a hierarchy, object types in particular.

Interface Segregation Principle No client should be forced to depend on methods it does not use Many client-specific interfaces are better than one general-purpose interface The interface-segregation principle (ISP) states that no client should be forced to depend on methods it does not use. ISP splits interfaces which are very large into smaller and more specific ones so that clients will only have to know about the methods that are of interest to them. Such shrunken interfaces are also called role interfaces. ISP is intended to keep a system decoupled and thus easier to refactor, change, and redeploy.

Dependency Inversion Principle High-level modules should not depend on low-level modules. Both should depend on abstractions. Abstractions should not depend on details. Details should depend on abstractions. Dependency Inversion Principle In conventional application architecture, lower-level components are designed to be consumed by higher-level components which enable increasingly complex systems to be built. When following this principle, the conventional dependency relationships established from high-level, policy-setting modules to low-level, dependency modules are inverted (i.e. reversed), thus rendering high-level modules independent of the low-level module implementation details.

Result of writing SOLID code Your code will be: Maintainable Extensible Reusable Testable To be able to response to the changes that occur in agile projects all of the above are required!

Framework Design Guidelines

Framework Design Guidelines The Framework Design Guidelines are defined in the book “Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries” by Krzysztof Cwalina and Brad Abrams. These guidelines can also be found at the MSDN site: http://msdn.microsoft.com/en-us/library/ms229042(v=vs.110).aspx The goal of the Framework Design Guidelines is to help library designers ensure API consistency and ease of use by providing a unified programming model that is independent of the programming language used for development. We recommend that you follow these design guidelines when developing classes and components that extend the .NET Framework. Inconsistent library design adversely affects developer productivity and discourages adoption.

What is described in these guidelines? (1) Naming Guidelines Provides guidelines for naming assemblies, namespaces, types, and members in class libraries. Type Design Guidelines Provides guidelines for using static and abstract classes, interfaces, enumerations, structures, and other types. Member Design Guidelines Provides guidelines for designing and using properties, methods, constructors, fields, events, operators, and parameters. Designing for Extensibility Discusses extensibility mechanisms such as subclassing, using events, virtual members, and callbacks, and explains how to choose the mechanisms that best meet your framework's requirements.

What is described in these guidelines? (2) Design Guidelines for Exceptions Describes design guidelines for designing, throwing, and catching exceptions. Usage Guidelines Describes guidelines for using common types such as arrays, attributes, and collections, supporting serialization, and overloading equality operators. Common Design Patterns Provides guidelines for choosing and implementing dependency properties and the dispose pattern.

Result of writing code that aligns with the Framework Design Guidelines It is much more likely that the resulting code will be SOLID Your code will be much more readable and understandable by anyone that is familiar with the .NET framework To be able to work with a development team in agile projects all of the above are required!

Design Patterns

What is a design pattern? A design pattern is a general reusable solution to a commonly occurring problem within a given context in software design

23 basic design patterns by the GoF. Creational Abstract Factory, Builder, Factory Method, Prototype, Singleton Structural Adapter, Bridge, Composite, Decorator, Façade, Flyweight, Proxy Behavioral Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, Visitor

Singleton Ensure a class only has one instance, and provide a global point of access to it

Proxy Provide a surrogate or placeholder for another object to control access to it

Chain of Responsibility Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it

Result of using Design Patterns Assists in writing SOLID code Prevents reinventing the wheel Speeds up development Allows others to understand your design Allows you to understand the designs of others To deliver a working solution with a team of developers on every sprint all of the above are required!

Practices

What do I mean with practices? Being a good developer Think first, then do Really… think first, then do Follow the framework design guidelines Use existing patterns where possible Design your code (pen and paper, visio, or Visual Studio class designer) Spent extra time on naming conventions Test your code Write secure code (apply STRIDE) Think about logging / error handling Etc.

Result of following these practices? Your code will be: Maintainable, Extensible, Reusable, Testable, Debuggable, Secure, Understandable Allows for much faster development while maintaining decent quality It allows for agile development!

Real life

Understanding code MembershipProvider, ProfileProvider, ClaimsProvider HttpContext.Current, SPContext.Current DbProviderFactories, DbProviderFactory, SqlDbConnection, OleDbConnection, SqlDataAdapter Trace -> Listeners -> EventLogTraceListener, TextWriterTraceListener XmlWriter.Create(…) System.Web.UI.WebControls SPItemEventReceiver.OnAdded … OnAdding... SPItemEventProperties.Cancel

Sample NewsReaderWebPart User story defines a news reader web part that displays news from an RSS Feed

Issues with this design Web Part has to many responsibilities Get data, display the data, store properties Testable nor extensible

Changes in the user story Customer likes to display Atom feeds as well and choose a different view Bad design requires us to change the web part and this goes against the open/closed principle of solid design While the new NewsReaderWebPart in the design below can display multiple feed types the same issues are still there

Results of the previous design Our code implements the SOLID design principles (mostly) If the customer wants news from yet another source, we can extend our solution by creating two new objects f.e. SharePointNewsProviderFactory and SharePointNewsAdapter If we want to implement tests, we can create a TestNewsProviderFactory and TestNewsAdapter Anyone that knows the basic design patterns or has experience with the .NET framework can understand our solution by just looking at the class diagram and the names of the classes By first creating this basic design we are able to generate the code in a very short amount of time

Sample Client Information User story defines a web part that displays and allows for editing client information from Microsoft CRM Initial thought was to fetch the data through BCS in order to be able to also display external lists

Issues with this design Web Part has to many responsibilities again Get data, display the data, store properties Testable nor extensible Web Part has a direct dependency on BCS Calling BCS from code relies on reflection BCS is not strongly typed

Progressive insight BCS could not deliver enough performance to display external lists Client did not actually need external lists The web part rendered to slow 19-9-2018

If it was designed like this in the first place

We could change the design to this

Or even this…

Conclusion Agile development is a farce if the code is not designed with the patterns and practices in mind If you want to be a good developer you need to know the basic patterns and the framework design guidelines Must reads Framework Design Guidelines Design Patterns: Elements of Reusable Object-Oriented Software Writing Secure Code Code Complete 2nd Edition