GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Saiganesh224212/Advanced_Java_Lab: This repository contains all assignments, projects, and Java code for the Advanced Java Lab course, following SOLID principles, design patterns, and coding practices.

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
diffass3
diffass3
 
 
easy1
easy1
 
 
easy2
easy2
 
 
socket
socket
 
 
README.md
README.md
 
 

Repository files navigation

šŸ“Œ Advanced Java Lab - Assignments (UCSH-605)

This folder contains all the assignments for the Advanced Java Lab (UCSH-605) course, focusing on SOLID principles, Object-Oriented Design, and Java Coding practices.


šŸ“œ List of Assignments

Assignment Description Topics Covered
Assignment 1 Refactor a Poorly Designed Code (Apply SRP & OCP) Single Responsibility Principle (SRP), Open/Closed Principle (OCP)
Assignment 2 Implement Liskov Substitution Principle (LSP) Liskov Substitution Principle (LSP), Class Hierarchy Design
Assignment 3 Payment Processing System (Applying All SOLID Principles) SOLID Principles, Interface Segregation, Dependency Inversion
Assignment 4 Chat App using Socket Programming in Java 1) One-to-One 2) One-to-Many

šŸ”¹ Assignment 1: Refactor a Poorly Designed Code (SRP & OCP)

šŸ“Œ Problem Statement

The given Java code violates SRP (Single Responsibility Principle) and OCP (Open/Closed Principle).
Refactor the code to:

  1. Separate concerns properly (SRP)
  2. Make it extensible for new storage types without modifying the base class (OCP)

šŸ“Œ Files

  • easy1.java Original code violating SOLID principles → Refactored version following SRP & OCP.

šŸ“Œ Topics Covered

āœ… Single Responsibility Principle (SRP) – Ensure each class has a single responsibility.
āœ… Open/Closed Principle (OCP) – Allow extension without modifying existing code.


šŸ”¹ Assignment 2: Implement Liskov Substitution Principle (LSP)

šŸ“Œ Problem Statement

A Penguin class extends Bird, but Bird has a fly() method. This violates LSP because not all birds can fly.

šŸ“Œ Task

  1. Identify the issue in the hierarchy.
  2. Refactor the design to follow LSP.
  3. Ensure subclasses can replace the base class without breaking behavior.

šŸ“Œ Files

  • easy2.java
    • Before Refactoring → Penguin inherits fly(), violating LSP.
    • After Refactoring → Introduces Bird as an abstract class and CanFly interface.

šŸ“Œ Topics Covered

āœ… Liskov Substitution Principle (LSP) – Subclasses must be replaceable without altering system correctness.
āœ… Proper Class Hierarchy Design – Use abstraction to define capabilities correctly.


šŸ”¹ Assignment 3: Design a Payment Processing System (SOLID)

šŸ“Œ Problem Statement

Create a scalable and maintainable payment processing system supporting:

  • Credit Card
  • PayPal
  • Google Pay

šŸ“Œ Requirements

āœ… Follow SOLID Principles
āœ… Allow adding new payment methods without modifying existing code
āœ… Use dependency injection for flexibility

šŸ“Œ Class Structure

PaymentService (Interface)
   ā”œā”€ā”€ CreditCardPayment (Implements PaymentService)
   ā”œā”€ā”€ PayPalPayment (Implements PaymentService)
   ā”œā”€ā”€ GooglePayPayment (Implements PaymentService)
PaymentProcessor
PaymentLogger
PaymentServiceManager
Main

šŸ“Œ Files

diffass3.java Implements all SOLID principles in a payment system.

šŸ“Œ Topics Covered

āœ… Single Responsibility Principle (SRP) – Separate payment processing, logging, and transaction handling.
āœ… Open/Closed Principle (OCP) – Allow new payment methods without modifying existing code.
āœ… Liskov Substitution Principle (LSP) – Ensure each payment method behaves correctly as a PaymentService.
āœ… Interface Segregation Principle (ISP) – Keep interfaces minimal and focused.
āœ… Dependency Inversion Principle (DIP) – Depend on abstractions (PaymentService), not concrete implementations.

how_to_run: steps:

- step: Clone the repository
  command: |
    git clone https://github.com/Saiganesh224212/Advanced_Java_Lab.git

- step: Compile Java files
  commands:
    - javac easy1.java
    - javac easy2.java
    - javac diffass3.java

- step: Run Java programs
  commands:
    - java easy1
    - java easy2
    - java diffass3

šŸ”¹ Assignment 4: Design a Chat App using Sockets in JAVA

About

This repository contains all assignments, projects, and Java code for the Advanced Java Lab course, following SOLID principles, design patterns, and coding practices.

Topics

advanced-java-programmingdesign-patternsjavasolid-principles

Resources

Readme
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Ɨ600. No cookies required.