Professional Documents
Culture Documents
● Creational
● Structural
● Behavioural
IntelliJ (Java)
Coupling
How a class can be affected by another class
In this example the main class in couple/depended on the user class
Encapsulation
Setter/Getter
Bundling the data and methods than operate on the data within one unit or class and hiding
the values or state of an object inside the class
*It’s not necessary to write this. besides the getter method of balance because as it not have
any parameters would not confuse balance with them
Abstraction
Reduce complexing by hiding unnecessary details in our classes
Make methods private -> SendEmail() called connect(),sendEmail(), and disconnect()
Polymorphism
The ability of an object to take many forms
- (-) Minus sign defines that the method was declared private
- (+) Plus sign defines that the method was declared public
- If we don’t add ; (semicolon) to the method it’s because it doesn’t return any value
Relationships between classes
Dependency Relationship
Memento Pattern
Declare variable as final means once initialized we cannot accidentally change it on our
program
State Pattern