educative.io

AircraftBuilder

Hi

As per the statement below,
The AircraftBuilder interface hides how a given aircraft gets built. The client is unaware of the classes F16Engine , F16Cockpit and similar classes for Boeing-747.

But the AircraftBuilder is not an interface. It is an abstract class.

Hi Avik_Dey,

This is Umair from educative. Thank you for reaching out! We are happy to hear from you.

We recently received a message from you on the course “Software Design Patterns”. We’ll be looking at your issue and let you know when this is fixed.

If you have any further queries, please let us know.

Best Regards,
Umair Cheema Developer Advocate

Hi Avik_Dey,

So I have looked at the query and I think you are confused amongst different examples from different patterns. Your queries are in bold and answers are given below.

The AircraftBuilder interface hides how a given aircraft gets built.

For the flyweight pattern, we don’t use an AircraftBuilder interface. The F16 class implements a IAircraft interface but that has been intentionally left out as it is not pertinent to the pattern. The idea is that there’s some interface that the F16 implements but is unrelated to its creation of its objects in the context of the pattern under discussion

The client is unaware of the classes F16Engine , F16Cockpit and similar classes for Boeing-747.

These classes belong to an example from another pattern and not flyweight pattern. I think the reader is confused here. Please ask her/him to give more details on their source of confusion.

But the AircraftBuilder is not an interface. It is an abstract class.

Again the flyweight pattern doesn’t use the AircraftBuilder class, its unrelated to the example in this pattern.

Thank you for reaching out to us. Please let us know if you have any further queries.

Hi Avik_Dey,

If you still have any ambiguity, you can directly reach out the author of this course. Email address is provided.

Author’s Email Id:
c-h-afzal@outlook.com

In the Builder Pattern, we have

public class Director {  
AircraftBuilder aircraftBuilder; 
...
}

AircraftBuilder is an abstract class. How can we create an object for this class?