Question
The objective of this homework is to give you experience applying the Template Design pattern concept, using the Ruby language. This is a design project,
The objective of this homework is to give you experience applying the Template Design pattern concept, using the Ruby language. This is a design project, so each of you should have a unique design. You are allowed to discuss your approaches with each other, but you may not share designs.
The Problem:
A travel agency needs an application so they can manage a series of trip packages. All trips will contain some common behavior, which would suggest that a Template Design pattern can be used. Each trip contains the basic steps:
- Transport from hotel to meeting place
- Arrival Introduction meeting & brunch
- Day1AfternoonActivity
- Day2Activity
- Day3Activity
- Day4Activity
- Trip Conclusion Social
- Transport back to hotel.
The travel agency has four packages, Package A through Package D, that have different excursion options. Use your imagination to specify the excursions.
You can develop the application using a base class which provides default activities, such as self-directed tours and shopping and the common activities that are not unique to each package. Then, use subclasses to specify the different excursions that would be part of each package.
The example starting on page 62 of the Design Patterns in Ruby is an excellent guide on how you can implement this application. Below is a class diagram will illustrates the basic scheme.
What to submit: Please submit a copy of your Ruby source code file and a text, Word, or PDF file(s) that includes a product description and an associated UML class diagram.
Abstract Class +templateMethod0: void +primitive OperationA0 void +primitive OperationB0 void ConcreteClass +primitiveOperationA0:void +primiti public final void tem plateMethod(X primitiveoperationA(X primit OperationAXStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started