builder.txt 743 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. @startuml
  2. /' BUILDER '/
  3. class Director {
  4. - builder
  5. + construct()
  6. + setBuilder(Builder)
  7. + Product getProduct()
  8. }
  9. interface Builder {
  10. # buildPartA()
  11. # buildPartB()
  12. # buildPartC()
  13. }
  14. class ConcreteBuilderFirst {
  15. + buildPartA()
  16. + buildPartB()
  17. + buildPartC()
  18. + getResult()
  19. }
  20. class ConcreteBuilderSecond {
  21. + buildPartA()
  22. + buildPartB()
  23. + buildPartC()
  24. + getResult()
  25. }
  26. Director *- Builder
  27. Builder <|-- ConcreteBuilderFirst
  28. Builder <|-- ConcreteBuilderSecond
  29. note as N1
  30. <b><color:royalBlue>Builder</color></b>
  31. <b>Type:</b> Creational
  32. Permet la séparation des méthodes
  33. de construction - un objet complexe
  34. peut avoir différentes représentations.
  35. end note
  36. @enduml