Giter Club home page Giter Club logo

cab-booking-application's Introduction

CabBookingApplication

Cab Booking Application using Design Patterns

This is a simple Cab Booking application implemented in Java. The application uses various design patterns such as Singleton, Abstract Factory, Strategy, and Proxy to manage different aspects of the booking process.

Table of Contents

Introduction

The Cab Booking Application is designed to provide users with a convenient way to book different types of cabs, including Prime Sedan, Mini, and Auto. The application incorporates design patterns to enhance modularity, extensibility, and maintainability.

Features

  • User authentication with regular and subscription pricing strategies.
  • Booking of Prime Sedan, Mini, and Auto vehicles.
  • Different features available for each vehicle type.

Design Patterns

The application leverages the following design patterns:

  • Singleton Pattern: Ensures that there is only one instance of the BookingManager class to manage cab bookings.

  • Abstract Factory Pattern: Provides an interface for creating families of related or dependent objects. Factories include PrimeSedanFactory, MiniFactory, and AutoFactory.

  • Strategy Pattern: Defines a family of algorithms, encapsulates each algorithm, and makes them interchangeable. Strategies include pricing strategies (RegularPricing and SubscriptionPricingStratergy) and features strategies (ACStratergy, noFeaturesStratergy, wifiandACStratergy).

  • Proxy Pattern: Acts as a surrogate or placeholder for another object to control access to it. The ProxySubscriber class is used to authenticate and apply pricing strategies based on the user's subscription status.

Usage

  1. Clone the repository:

    git clone https://github.com/your-username/cab-booking-app.git
  2. Compile and run the application:

    cd cab-booking-app
    javac cabBook.java
    java cabBook
  3. Follow the on-screen prompts to authenticate, choose a vehicle type, and book a cab.

Dependencies

  • Java SDK (version X.X.X)
  • Scanner class (standard Java library)

Output

-Image below shows that the user is a subscriber and has discount applied on cab rides Screenshot 2023-11-22 093423

-Image below shows that the user is not a subscriber Screenshot 2023-11-22 093510

cab-booking-application's People

Contributors

amanj10 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.