Difference between Abstract factory and builder?

前端 未结 3 816
遇见更好的自我
遇见更好的自我 2021-02-10 18:22

Sorry for asking again. I have searched over web but couldn\'t understand hence i have to put here. Here what I research by my self. I studied from head first design pattern.

3条回答
  •  旧巷少年郎
    2021-02-10 19:23

    In pizza example, if NYstore act as client then it get productA, produtB... etc from factory and can directly access, but if we treat NYStore as pizzachef (as suggested by tcarvin ) and client accces it to get complete pizza, it act as builder (pizzache as directore and ingredient class as builder) Following image can exact tell what is the exact difference note : I am putting this image so whoever visit this post can understand easily.

    NOW I AM HUNGRY also.

    enter image description here

    Thanks to liviu for this image.

提交回复
热议问题