13 Sep

We learned about Design Patterns



□Flexible
change something that already exists
Desktop > Laptop


□Extensible
ability that adding one thing to current system
→Desktop
We can extend parts easily. For example, keyboard, software, screen, etc


□Destractors of Flexibility
- complex and uncreadable code
・bag name
 ex) char * c ×
    char * contact ○
We don't understand that what 'c' does mean.


- violation of single responsibility principle
ex) Fan has only the function of fan. So it should not have the function of
lighgt because it becomes complex in case of repair.
So one thing has one functionh.


- Repetition 

example is below↓


reeeiのブログ


Student class has the function of "sort()" and cource class also has the function of "sort()".

So to avoid repetion of "sort()", we make sorter class that has the function of "sort()". Then if we use the function of sort(), we refer sort from sorter class.

do not have to write sort() at student class and cource class.



□Design Decisions For Flexibility
- DRY
Do notrepeat yourself


- keep it simple


- loose coupling
・not tight nonnection
Car and Wheel are loosely coupled
Desktop is loosely coupled
Laptop is not loosely coupled


example is below↓



reeeiのブログ



f1(sedan c){
c.turn();
}

f2(sports car c){
c.turn();
}


↓


f1(car c){
c.turn();
}

We can use "turn()" both at sprts car and sedan.
⇒Polymorphism


- separating thing that change
if we mix curry and rice, we cannot remove each thing.



reeeiのブログ


Session 3


□activity diagrams

–step what we are doing something

–similar to flow chart

reeeiのブログ


□state machine diagram

–shows us change of state of one object as the object gets event come from outside

reeeiのブログ


□sequence diagram

–which object are going to interact each other while these steps are happening



□difference between sequence and activity diagrams

–sequence → has time sequence, sunny day scenario(everything is perfect)

–activity → has decision


high level overview of the steps






session2


I learned about the detailes of UML


UML

=(Booch+OMT)+OOSE

=managed by the OMG

=has own symbols(rules)



□UML diagrams

=structural diagrams

->how module(function) connect each other


=behavioral diagrams

->how will module behavior

ex) refresh press

->what happen inside?


=interaction diagrams



→three high level categories of diagram



□UML structural diagrams

–class diagram ->has connection, identify between the classes


reeeiのブログ

–object diagram ->what class our system contain

–component diagram ->grouping

–composite structure diagram

–package diagram


reeeiのブログ

–deployment diagram


□class

class has name, attributes and behavior



□UML behavior diagram

–use case diagram

–activity diagram (similar to flow chart)

–state machine diagram



□UML interaction diagrams

–sequence diagrams

–communication diagrams

–interaction overview diagrams



□use case


- one thing you can do with the system