ooad presentation

21
Object- Oriented Analysis and Design

Upload: joel-correa

Post on 05-Dec-2014

699 views

Category:

Technology


8 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Ooad presentation

Object-Oriented

Analysis and Design

Page 2: Ooad presentation

How do you write great software every

time?

Page 3: Ooad presentation

Great software?

Page 4: Ooad presentation

The software must do what the customer wants it to do

Page 5: Ooad presentation
Page 6: Ooad presentation

Make your code smart

Well-DesignedWell-Coded

Easy to mantain

Easy to reuseEasy to extend

Page 7: Ooad presentation

Great software satisfies the customer and the programmer

Page 8: Ooad presentation

Programmers are satisfied when:

Their apps can be REUSED Their apps are FLEXIBLE

Customers are satisfied when:

Their apps WORK Their apps KEEP WORKING

Their apps can be UPGRADED

Page 9: Ooad presentation

Ok but… what shall the software do?

Page 10: Ooad presentation

Gathering requirements

Pay attention to what the system needs to

You can figure out how later

Page 11: Ooad presentation

Requirement?

It’s a specific thing

Yoursystemhas to do

towork correctly

Usually a single thing, and you can test that thing to make sure you fullfilled the requirement

The complete app or project you are working on

2 - so if you leave out a requirement or even if they forget to mention sth your system isnt working correctly

1 - The customer decides when a system works correctly,

Page 12: Ooad presentation

Your software has a context

Page 13: Ooad presentation

Developers viewpoint(the perfect world)

Real world

Page 14: Ooad presentation

+ Analysis =

Real world context

Textual analysis = nouns / verbsUse cases

Diagrams

Page 15: Ooad presentation

Nothing ever stay the same

No matter how much you like your softwareRight now, it’s probably going to changeTomorrow…

Good design = flexible and resilient design

Page 16: Ooad presentation

Design principles

Techniques that can be applied for designing or writing code to make that code more Mantainable, flexible or extensible

OCPOpen-closed

princople

DRYDon’t repeat

yourself

SRPSingle

responsibility principle

Classes are open for extensionAnd closed for modification

Avoid duplicate code by abstractingThings that are common

Every object in your project should have a single responsability

Page 17: Ooad presentation

Open-closed principle

class Printer{public final void print(Printable p){

…}

}

class SquarePrinter extends Printer{public void print(Square s){

…}

}OPEN = Extending functionality

ClOSED = NO OVERRIDES

Page 18: Ooad presentation

Single responsibility principle

public class MobileCaller{

public void callMobile(MobileNo mobileNo){ ... }}

public class ValidationService{

public static boolean validateMobileNumber(MobileNo mobileNo){ ... }

}

Responsibility #1: Call

Responsibility #2: validate number

Page 19: Ooad presentation

DRY – Don’t repeat yourself

Page 20: Ooad presentation

By Contract / Defensive

programming

programming

defensively means you’re making sure the

client gets “safe” response, no matter what the client wants to have happen

Programming by contract means you are working with a client code

to agree on how you’ll handle problem situations

Page 21: Ooad presentation

Defensive programming