Question: Use Abstract Factory pattern to design and implement a Build Your Vehicle application. Each vehicle includes an Engine , a Transmission and 4 Wheel objects

Use Abstract Factory pattern to design and implement a Build Your Vehicle application.

  • Each vehicle includes an Engine, a Transmission and 4 Wheel objects.
    • User can choose whether to have an AirBag and/or a ABS object included in the vehicle.
    • When user runs the application, you need to allow user to Specify the vehicle that the user wants to build
        • Sedan uses one 2Liter4Cylinder engine object, one 4SpeedAutomatic transmission object, and four 16inch wheel objects.
        • Van uses one 3Liter6Cylinder engine object, one 6SpeedAutomatic transmission object, and four 16inch wheels.
        • BasicTruck uses one 3Liter6Cylinder engine object, one 6SpeedManualtransmission object, and four 18inch wheels.

HINT Use Factory Method pattern here to create ONE vehicle (Sedan, Van, or BasicTruck) object based on users selection. Each vehicle object will know and decide which other related objects (engine, transmission, and wheel) to create.

    • When each of the vehicle object is created, your application needs to display appropriate message.
      • For example, if a Van's Engine (3Liter6Cylinder ) object is created, it will display a message A 3 liter Van Engine with 6 cylinder object is used.
    • User can change to build a new vehicle anytime while the application is running
      • Once user selected a new vehicle, your application will create the related objects and display appropriate messages
        • For example, when Van is selected with driver and passenger airbag, your application will show Van with a 3Liter6Cylinder engine object, 6SpeedAutomatic transmission object, 4 16inch wheel objects and an AirBag object.

Draw your design in UML Class Diagram using Rational Rhapsody.

Implement your design with the requirements using Java following Abstract Factory Pattern design.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!