Skip to content

A robust Java-based command-driven contest quiz platform demonstrating advanced object modeling, clean architecture, command pattern, and best practices in software design. Features contest and question management, leaderboard, and powerful command interface.

Notifications You must be signed in to change notification settings

Anant-Saini/ME_OBJECT_MODELING_V2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

38 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ ME_OBJECT_MODELING_V2_MODULE_CONTROLLER

Java Gradle License

A robust command-driven coding game platform implementing modern object-oriented design patterns and best practices.

๐Ÿ“‹ Table of Contents

๐ŸŽฏ Overview

ME_OBJECT_MODELING_V2_MODULE_CONTROLLER is a Java-based application that demonstrates advanced object modeling concepts through a coding game platform. The project showcases clean architecture principles, command pattern implementation, and separation of concerns.

What This Project Does

  • User Management: Register and manage users with different skill levels
  • Contest Management: Create and manage coding contests with varying difficulty levels
  • Question Management: Handle coding questions with different difficulty ratings
  • Leaderboard System: Track and display user performance
  • Command-Driven Interface: Execute operations through a flexible command pattern

โœจ Key Features

  • ๐Ÿ—๏ธ Clean Architecture: Follows separation of concerns with distinct layers (entities, repositories, services, commands)
  • ๐ŸŽฏ Command Pattern: Extensible command-based operation system
  • ๐Ÿ’พ In-Memory Repository: Fast data access with repository pattern implementation
  • ๐Ÿ”ง Dependency Injection: Loose coupling through constructor-based DI
  • ๐Ÿ“Š Data Transfer Objects: Clean data flow between layers
  • ๐Ÿงช Test Coverage: Comprehensive unit tests for all components
  • ๐Ÿ“ Type Safety: Strong typing with Java generics

๐Ÿ›๏ธ Architecture

The application follows a layered architecture:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         Application Layer           โ”‚
โ”‚         (App.java)                  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         Command Layer               โ”‚
โ”‚    (Command Pattern Implementation) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         Service Layer               โ”‚
โ”‚    (Business Logic)                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         Repository Layer            โ”‚
โ”‚    (Data Access)                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚         Entity Layer                โ”‚
โ”‚    (Domain Models)                  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Setup Instructions

Prerequisites

  • Java Development Kit (JDK): Version 11 or higher
  • Gradle: Version 7.x or higher (or use the included wrapper)
  • Git: For cloning the repository

Installation Steps

  1. Clone the repository

    git clone <repository-url>
    cd anantsaini-india-ME_OBJECT_MODELING_V2
  2. Build the project

    ./gradlew build
  3. Run tests

    ./gradlew test
  4. Run the application

    ./gradlew run

    Or alternatively:

    java -jar build/libs/ME_OBJECT_MODELING_V2.jar

๐Ÿ’ป Usage

Running the Application

The application reads commands from input.txt file:

./gradlew run < input.txt

Input Format

The application accepts commands in the following format:

CREATE_USER <name> <score>
CREATE_QUESTION <title> <level> <score>
CREATE_CONTEST <name> <level> <creator> <questionIds>
LIST_CONTEST <level>
ATTEND_CONTEST <contestId> <userName>
RUN_CONTEST <contestId> <userName>
LEADERBOARD <order>

Example Usage

CREATE_USER Ross 1500
CREATE_USER Monica 1800
CREATE_QUESTION Binary_Search LOW 100
CREATE_CONTEST June_Challenge LOW Ross Q1,Q2
LIST_CONTEST LOW

๐Ÿ“ Folder Structure

anantsaini-india-ME_OBJECT_MODELING_V2/
โ”‚
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ main/
โ”‚   โ”‚   โ””โ”€โ”€ java/
โ”‚   โ”‚       โ””โ”€โ”€ com/
โ”‚   โ”‚           โ””โ”€โ”€ crio/
โ”‚   โ”‚               โ””โ”€โ”€ codingame/
โ”‚   โ”‚                   โ”œโ”€โ”€ App.java                    # Application entry point
โ”‚   โ”‚                   โ”œโ”€โ”€ appConfig/                  # Application configuration
โ”‚   โ”‚                   โ”œโ”€โ”€ commands/                   # Command implementations
โ”‚   โ”‚                   โ”‚   โ”œโ”€โ”€ CreateUserCommand.java
โ”‚   โ”‚                   โ”‚   โ”œโ”€โ”€ CreateQuestionCommand.java
โ”‚   โ”‚                   โ”‚   โ”œโ”€โ”€ CreateContestCommand.java
โ”‚   โ”‚                   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”‚                   โ”œโ”€โ”€ dtos/                       # Data Transfer Objects
โ”‚   โ”‚                   โ”œโ”€โ”€ entities/                   # Domain models
โ”‚   โ”‚                   โ”‚   โ”œโ”€โ”€ User.java
โ”‚   โ”‚                   โ”‚   โ”œโ”€โ”€ Question.java
โ”‚   โ”‚                   โ”‚   โ”œโ”€โ”€ Contest.java
โ”‚   โ”‚                   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”‚                   โ”œโ”€โ”€ exceptions/                 # Custom exceptions
โ”‚   โ”‚                   โ”œโ”€โ”€ repositories/               # Data access layer
โ”‚   โ”‚                   โ”‚   โ”œโ”€โ”€ IUserRepository.java
โ”‚   โ”‚                   โ”‚   โ”œโ”€โ”€ UserRepository.java
โ”‚   โ”‚                   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”‚                   โ””โ”€โ”€ services/                   # Business logic
โ”‚   โ”‚                       โ”œโ”€โ”€ UserService.java
โ”‚   โ”‚                       โ”œโ”€โ”€ ContestService.java
โ”‚   โ”‚                       โ””โ”€โ”€ ...
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ test/
โ”‚       โ””โ”€โ”€ java/
โ”‚           โ””โ”€โ”€ com/
โ”‚               โ””โ”€โ”€ crio/
โ”‚                   โ””โ”€โ”€ codingame/                     # Unit tests
โ”‚
โ”œโ”€โ”€ build.gradle                                       # Build configuration
โ”œโ”€โ”€ gradlew                                            # Gradle wrapper (Unix)
โ”œโ”€โ”€ gradlew.bat                                        # Gradle wrapper (Windows)
โ”œโ”€โ”€ input.txt                                          # Sample input file
โ”œโ”€โ”€ songs.csv                                          # Sample data file
โ””โ”€โ”€ README.md                                          # This file

๐Ÿ“ Sample Code

Creating a User

// Using the UserService
UserService userService = new UserService(userRepository);
User user = userService.create("John Doe", 1500);
System.out.println("Created user: " + user.getName());

Creating a Contest

// Using the ContestService
ContestService contestService = new ContestService(
    contestRepository,
    questionRepository,
    userRepository
);

Contest contest = contestService.create(
    "Summer Challenge",
    Level.MEDIUM,
    "creator123",
    Arrays.asList("Q1", "Q2", "Q3")
);

Executing Commands

// Command pattern implementation
CommandInvoker invoker = new CommandInvoker();
CreateUserCommand command = new CreateUserCommand(userService);
invoker.executeCommand("CREATE_USER Alice 2000", command);

๐ŸŽฎ Commands

Command Description Example
CREATE_USER Create a new user CREATE_USER Ross 1500
CREATE_QUESTION Create a new question CREATE_QUESTION BinarySearch LOW 100
CREATE_CONTEST Create a new contest CREATE_CONTEST JuneContest LOW Ross Q1,Q2
LIST_CONTEST List contests by level LIST_CONTEST LOW
ATTEND_CONTEST Register for a contest ATTEND_CONTEST C1 Ross
RUN_CONTEST Participate in contest RUN_CONTEST C1 Ross
LEADERBOARD Display leaderboard LEADERBOARD ASC
WITHDRAW_CONTEST Withdraw from contest WITHDRAW_CONTEST C1 Ross

๐Ÿค Contributing

We welcome contributions to improve the project! Here's how you can help:

Getting Started

  1. Fork the repository

    git fork <repository-url>
  2. Create a feature branch

    git checkout -b feature/amazing-feature
  3. Make your changes

    • Write clean, documented code
    • Follow existing code style and patterns
    • Add tests for new functionality
  4. Commit your changes

    git commit -m 'Add some amazing feature'
  5. Push to the branch

    git push origin feature/amazing-feature
  6. Open a Pull Request

Code Style Guidelines

  • Follow Java naming conventions
  • Use meaningful variable and method names
  • Write JavaDoc comments for public methods
  • Keep methods focused and concise
  • Maintain test coverage above 80%

Testing

Ensure all tests pass before submitting:

./gradlew test
./gradlew build

๐Ÿ“„ License

This project is part of the Crio.Do learning platform.

๐Ÿ“ž Contact & Support

  • Issues: Please report bugs and issues through the GitLab issue tracker
  • Questions: Reach out through the Crio.Do platform

๐Ÿ™ Acknowledgments

  • Built as part of the Crio.Do ME_OBJECT_MODELING_V2 module
  • Special thanks to all contributors and maintainers

Made with โค๏ธ by Crio.Do Learners

Last Updated: October 2025

About

A robust Java-based command-driven contest quiz platform demonstrating advanced object modeling, clean architecture, command pattern, and best practices in software design. Features contest and question management, leaderboard, and powerful command interface.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages