Question

A GeneralPath collects shapes and is itself a shape. What design pattern does it exemplify?

A GeneralPath collects shapes and is itself a shape. What design pattern does it exemplify?

Homework Answers

Answer #1

Ans ).

Composite Pattern.

because if you remember composite pattern condition which says "Clients treat a composite object as a primitive object.". Here primitive object means the root object itself, which in our case is shape. That is A generalPath collects shape(a composite object) ans is itself a shape (as a primitive object). Therefore, it is definitely Compostion Pattern.

Hope it helped! Feel free to ask any doubt in comments. Don't forget to upvote if it helped :).  

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
How does the usual shape of the total revenue curve for a monopolist differ from the...
How does the usual shape of the total revenue curve for a monopolist differ from the shape of the marginal revenue curve for a perfect competitor? Briefly explain the difference in the two shapes
Design E shape microstrip patch array antenna in ansys for a frequency and write the matlab...
Design E shape microstrip patch array antenna in ansys for a frequency and write the matlab code for it. a) Find S parameters. b)Find Gain,Beamwidth,all pattern. i need this all with matlab code.if you are able to do then try or else leave it for other.
What is epigenetics? How does its inheritance pattern differ from nuclear inheritance pattern?
What is epigenetics? How does its inheritance pattern differ from nuclear inheritance pattern?
Is a prison a society unto itself? What does it mean to say that there is...
Is a prison a society unto itself? What does it mean to say that there is a prison subculture? What types of characteristics make up this subculture? Where do the values of prison society come from?
what is meant by real shocks and nominal shocks? what does "real" and "nominal" itself mean...
what is meant by real shocks and nominal shocks? what does "real" and "nominal" itself mean in economics?
How does J affect the multiplet pattern in NMR spectroscopy? What does the magnitude of J...
How does J affect the multiplet pattern in NMR spectroscopy? What does the magnitude of J tell you about the molecule?
In what ways does the federal or state government involve itself in public health initiatives?
In what ways does the federal or state government involve itself in public health initiatives?
What are complementary genes? Does this inheritance pattern obey Mendel’s second law?
What are complementary genes? Does this inheritance pattern obey Mendel’s second law?
What are complementary genes? Does this inheritance pattern obey Mendel’s second law?
What are complementary genes? Does this inheritance pattern obey Mendel’s second law?
for Dependency Injection, Iterator, Observer, Strategy, Factory Method, Abstract Factory, Adapter, Builder, Façade design patterns Does...
for Dependency Injection, Iterator, Observer, Strategy, Factory Method, Abstract Factory, Adapter, Builder, Façade design patterns Does project design has the conditions for implementing the design pattern? Why or why not?