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
What variables associated with the object itself does the moment of inertia depend on? Does your...
What variables associated with the object itself does the moment of inertia depend on? Does your investigation show a pattern that illustrates the dependence of the moment of inertia on mass, size, or shape of the object?
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?
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT