Please enable JavaScript.
Coggle requires JavaScript to display documents.
JAVA - Desig Pattern (2.Prototype Pattern (Project (Swing Window (Create…
JAVA - Desig Pattern
2.Prototype Pattern
Project
Rabbit clonnable
Rabbit Clonnable with Clonnable Owner
Swing Window
Create Rabit
Clone Rabbit
Set Name,Age
Get Name,Age
Override method
1.Singletron Builder
When it use?
Window managers
Database connectors
File managers
Ui dialogs
Resource allocators
Projects to practice
Implement singletron pattern
Multithreading with SingleTron - Print spooler
syncronized prevent work simoultaniously
Java Collection Class
Immutible
3.Factory Method Pattren
When to use?
When we don`t know that types of object we need to create.
Candy. But what type of candy?
Ex. Chocholate, but what type of Chocolate?
white
Projects explenations
Candy Shop
Candy Factory
GetCandy
GetCandyPackage
Chocolate extends Candy
Dark Chocolate
White
HardCandy extends
Lolipop
CandyCane
4.Abstract Factory Method
When to use?
When we create bycicle and should create different parts of different bycicle types
Mountian
Tire
getDescription()
HandleBar
getDescription()
Road
Tire
getDescription()
HandleBar
getDescription()
Project Explenations
Implement extendible factories
BikeFactory
Create BikePart(String type)
MountianBikeFactory exdends BikeFactory
If Tire -> return MountianBikeTire
If HandleBar -> return MountianBikeHandleBar
CreateFactory(type)
HandleBar extends BikePart
Create HanleBar
(HadnleBar) BikeFactory.create("HandleBar")
HandleBar.getDescription();
Tire extends BikePart
Create TireFront or TireBack
(Tire) BikeFactory.create("Tire")
TireFront/TireBack.getDescription();
MountianBikeTire Extends Tire
Override GetDesrciption()