Question

In: Computer Science

Discuss the overlap that you see in these last four GRASP patterns. Or, if you don't...

Discuss the overlap that you see in these last four GRASP patterns. Or, if you don't see overlap, then describe how they are different.

- Polymorphissm

- indirection

- Pure Fabrication

- Protected Variations

Solutions

Expert Solution

1. polymorphism :-
->polymorphissm is used to dynamically handle similar object types.when somethings like function , variable has a same name but different defination we will use polymorphism.
->it is also used to simulate plugable software type system.
-> it eliminate conditional statement.
-> In OO languages polymorphism is tied up with substitutability.
-> for that we design methods and we write client code that can operate on a set of types.

2.indirection :-
->it's avoid coupling between objects by separating them with an intermediate objects.
->Adapter is going to allow system objects to interact with external interfaces dynamically.
->example using GOF : Adapter , bridge , facade , observer ,mediator.
-> diffrence from pure fabrication is that low couoling is in indirection.

3.Pure fabrication :-
->if we creates object and that feel a need that has no real world counterpart , this is an
example of pure fabrication.
->And example is object that would only save the information , update information or delete information.
->example using GOF pattern is Adapter , command , strategy .
->information experts cause high coupling.

4.Protected variation :-
-> how do you design objects so that variation doesn't have bad effects ?
solution :- look for elements with coupling that may change and surround them with a stable interface.it is calles protected variation.
example :- suppose we have class sale,and it contains date,items,itemprice,purchesamount and calculatetax. we have one member is calculatetax which will change in future so we want to protect using protected variation. so we will use adapter. first we will create an interface call calculatetax. in which we slap diffrent tax using adapter.


Related Solutions

Discuss the different types of disease inheritance patterns one might see if a mutation was to...
Discuss the different types of disease inheritance patterns one might see if a mutation was to occur during: S phase, mitosis, and meiosis.
Check if any two intervals overlap among a given set of intervals, return true if they overlap and false if they don't.
USE JAVACheck if any two intervals overlap among a given set of intervals, return true if they overlap and false if they don't.Input:  arr[] = {{1, 3}, {5, 7}, {2, 4}, {6, 8}} Output: true The intervals {1, 3} and {2, 4} overlap
Identify and discuss the four primary purposes of a last will and testament?
Identify and discuss the four primary purposes of a last will and testament?
Plot the data on air travel delays. Can you see seasonal patterns? Explain. Use Megastat to...
Plot the data on air travel delays. Can you see seasonal patterns? Explain. Use Megastat to calculate estimated seasonal indices and trend. Which months have the most delays? The fewest? Is this logical? Is there a trend in the deseasonalized data? National Airspace Total System Delays, 2002-2006 Year Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec 2002 14,158 13,821 20,020 24,027 28,533 33,770 32,304 29,056 24,493 25,266 17,712 22,489 2003 16,159 18,260 25,387 17,474 26,544 27,413...
You were expecting the market to correct for the last couple of months and see that...
You were expecting the market to correct for the last couple of months and see that it is happening over the last few weeks. You are expecting to receive $20,000 from an external source that you are planning to buy the SPDR ETF next month but would not want to miss out on the current price levels (in case the S&P 500 levels go up). Explain how you will lock in the current levels using options. Use today’s price on...
Please answer all parts, it is not that lengthy. If you can't answer last parts, don't...
Please answer all parts, it is not that lengthy. If you can't answer last parts, don't attempt then . Leave for someone else A manufacturing process produces defective items 15% of the time. A random sample of 80 items is taken from the 3000 produced on a particular day, and each sampled item is tested to see if it is defective or not. In the context of this problem, identify each of the following: a. Population: b. Parameter of interest:...
Please discuss what you think is the difference between race and ethnicity. Do they ever overlap?...
Please discuss what you think is the difference between race and ethnicity. Do they ever overlap? How and why? Please use examples to support your discussion.
Discuss 3 facts about the patterns of juvenile correctional institutionalization. Are these patterns what you’d expect,...
Discuss 3 facts about the patterns of juvenile correctional institutionalization. Are these patterns what you’d expect, and how can we “improve” them?
Your political party received 40% of the votes in the last election. You want to see...
Your political party received 40% of the votes in the last election. You want to see if your level of support has changed since the election. You sample 235 voters, and find that 107 would vote for you if an election were held today. Perform a hypothesis test at the 0.01 level to test if your support has changed.
DISCUSS POTENTIAL SOURCES, DRIVERS AND PATTERNS OF ADOPTION OF INNOVATION
DISCUSS POTENTIAL SOURCES, DRIVERS AND PATTERNS OF ADOPTION OF INNOVATION
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT