Designing with Patterns - Essay Example

Only on StudentShare

Extract of sample
Designing with Patterns

In the new system, Booking can be done through box office, Telephone or internet and payment can be done online also. So, we can do reservation through boxoffice booking and booking decorator. Booking decorator again consists of telephone booking and internet booking. In the main diagram, decorator class has been shown through blue lines.
Sometimes in object oriented programming we deal with collections. Iterator pattern uses iterators and access the elements of the aggregate objects without exposing their underlying methods and put them in iterator object. It also allows modifying the collection without making changes outside the collection. For traversing different collections, it provides uniform interface. It works on the principle of encapsulation. Collection is traversed sequentially. In this case, we have made two aggregate objects Screen and Seating Plan. In Screen, Show and Show schedule have been aggregated together and iterators iterate through shows for all screens of different cinemas. In Seating Plan, rows and seats have been aggregated together so that iterators can iterate through each seat to check its availability and booking. In the main diagram, iterator pattern is shown using red lines. ...
Download paper

Summary

Decorator pattern is used to provide flexibility to the existing class diagram by adding new behavior dynamically. We can stack multiple decorators on top of each other. It is an alternative to subclassing. In an object oriented programming, classes can be created at compile time only, but it helps in extending the functionality of classes at run time…
Author : catalinamurray

Related Essays

Computational Fluid Dynamics
Due to the advancements in almost every field CFD and its application is a rapidly developing discipline due to the continuous development in the capabilities of commercial software and the growth of computer power. The system has been a success and therefore CFD is already widely used in industry and its application is set to spread.
...
8 pages (2008 words) Essay
Designing a game
sport and games like Rise of the nations refers to war like situations. The main aim of game design is to create a game according to a set of constraints that could be technical, production, the choice of the targer, ethical, cultural and political.
...
5 pages (1255 words) Article
Web accessibility and the Internet - Cultural Issues.
Thus the efficiency of such exercises in converting the efforts into quantified business transactions would finally result in the final success of such initiatives. Most of the leading advertisement groups like interacting advertising Bureau (IAB), Price water Coopers (PwC) and Kelsey Group repots an estimated rise of about 25% in online advertisements across one year. The general perception of the internet based information dissemination is often mixed. Some of them are of the view that these initiatives could bring significant benefits to the viewers while the other group are of the opinion...
8 pages (2008 words) Essay
Designing in Adobe Flash CS3
So, we started with an audio of people saying," Hurry!" along with a zooming image of a finished cake. Then we presented the mixing, baking, and decorating steps of the cake making process along with appropriate images and text. We close our media with the "hurray" and zooming cake image.
...
3 pages (753 words) Assignment
Got a tricky question? Receive an answer from students like you! Try us!