Bhante Sujatha is a Theravada Buddhist Monk from Sri Lanka. His work to share the teachings of the Buddha and the message of healing through loving kindness has taken him across the world. 2:1 ratio. His story is one of extensive experience, sincere concern for the well being of others, and tireless energy.

Member 14118759 15-Jan-19 5:11 15-Jan-19 5:11 Hi Snesh, Thanks for your article, it really helped me. My question is about how we should proceed if we know that the Director is likely to need new steps in the future. For example, suppose we know that manufacturers are planning to include a new feature, e.g. A bell, on some bicycles.

We also think they might add more new features in the future. In other words, we think that the Director needs to be open for extension. Using the example you provided, for each new feature we would need to add a new method to the interface IBicycleBuilder, e.g. This means that every single one of the concrete builder classes would have to be amended to implement the new method, even though most of them won't need it. This doesn't seem right to me. I'm just learning about object oriented programming, so please correct me if I'm wrong, but I think the Director doesn't follow the Open/Closed principle.

Zhiri

I also think the example I've given means we are in danger of creating a 'fat' interface. Am I right in thinking that one would only use the Builder pattern if it's very unlikely that they would need to add to the steps defined in the interface? I hope you can take the time to answer this! I've been looking all over the internet and read several books but no one seems to mention this as a drawback of the builder pattern and I'm desperate for an answer! Thank you, Andi.

Popular Posts

  • Bhante Sujatha is a Theravada Buddhist Monk from Sri Lanka. His work to share the teachings of the Buddha and the message of healing through loving kindness has taken him across the world. 2:1 ratio. His story is one of extensive experience, sincere concern for the well being of others, and tireless energy.

    Member 14118759 15-Jan-19 5:11 15-Jan-19 5:11 Hi Snesh, Thanks for your article, it really helped me. My question is about how we should proceed if we know that the Director is likely to need new steps in the future. For example, suppose we know that manufacturers are planning to include a new feature, e.g. A bell, on some bicycles.

    We also think they might add more new features in the future. In other words, we think that the Director needs to be open for extension. Using the example you provided, for each new feature we would need to add a new method to the interface IBicycleBuilder, e.g. This means that every single one of the concrete builder classes would have to be amended to implement the new method, even though most of them won\'t need it. This doesn\'t seem right to me. I\'m just learning about object oriented programming, so please correct me if I\'m wrong, but I think the Director doesn\'t follow the Open/Closed principle.

    \'Zhiri\'

    I also think the example I\'ve given means we are in danger of creating a \'fat\' interface. Am I right in thinking that one would only use the Builder pattern if it\'s very unlikely that they would need to add to the steps defined in the interface? I hope you can take the time to answer this! I\'ve been looking all over the internet and read several books but no one seems to mention this as a drawback of the builder pattern and I\'m desperate for an answer! Thank you, Andi.

    ...'>Tusau Keser Zhiri Pesnya(09.04.2019)
  • Bhante Sujatha is a Theravada Buddhist Monk from Sri Lanka. His work to share the teachings of the Buddha and the message of healing through loving kindness has taken him across the world. 2:1 ratio. His story is one of extensive experience, sincere concern for the well being of others, and tireless energy.

    Member 14118759 15-Jan-19 5:11 15-Jan-19 5:11 Hi Snesh, Thanks for your article, it really helped me. My question is about how we should proceed if we know that the Director is likely to need new steps in the future. For example, suppose we know that manufacturers are planning to include a new feature, e.g. A bell, on some bicycles.

    We also think they might add more new features in the future. In other words, we think that the Director needs to be open for extension. Using the example you provided, for each new feature we would need to add a new method to the interface IBicycleBuilder, e.g. This means that every single one of the concrete builder classes would have to be amended to implement the new method, even though most of them won\'t need it. This doesn\'t seem right to me. I\'m just learning about object oriented programming, so please correct me if I\'m wrong, but I think the Director doesn\'t follow the Open/Closed principle.

    \'Zhiri\'

    I also think the example I\'ve given means we are in danger of creating a \'fat\' interface. Am I right in thinking that one would only use the Builder pattern if it\'s very unlikely that they would need to add to the steps defined in the interface? I hope you can take the time to answer this! I\'ve been looking all over the internet and read several books but no one seems to mention this as a drawback of the builder pattern and I\'m desperate for an answer! Thank you, Andi.

    ...'>Tusau Keser Zhiri Pesnya(09.04.2019)