8. 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
11. Requirement?
It’s a
specific thing
Your
system
has to do
to
work 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,
15. Nothing ever stay the same
No matter how much you like your
Right now, it’s probably going to ch
Tomorrow…
Good design = flexible and resilien
16. Design principles
Techniques that can be applied for designing or writing code to
make that code more Mantainable, flexible or extensible
OCP
Open-closed princople
DRY
Don’t repeat yourself
SRP
Single responsibility
principle
Classes are open for extension
And closed for modification
Avoid duplicate code by abstracting
Things that are common
Every object in your project
should have a single responsabil
17. 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
18. 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
20. 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