Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

☕ Advanced Programming (Java)

Coursework for the Advanced Programming course — a progression from Java basics to OOP, GUIs, concurrency, design patterns, and reflection.

  • Author: Mohammad Javad Maheronnaghsh
  • Instructor: Dr. Mohammad Amin Fazli — Computer Engineering Department, Sharif University of Technology
  • Language: Java (Maven · JUnit · JavaFX)

📘 New to these topics? Each assignment below has a "💡 In plain English" note explaining the key concept it teaches, so the repo doubles as a learning resource.


🗺️ Course at a glance

The course is built around 4 practical assignments (no theory assignments), each raising the bar:

flowchart LR
    A1["A1 · Java basics<br/>algorithms & logic"] --> A2["A2 · OOP<br/>classes & systems"]
    A2 --> A3["A3 · Advanced Java<br/>testing · GUI · threads · patterns"]
    A3 --> A4["A4 · Reflection<br/>inspecting code at runtime"]
Loading
# Assignment Focus Key concepts
1 Basics Core Java I/O, arrays, logic, algorithms
2 OOP Systems Object-oriented design Classes, encapsulation, a console game
3 Advanced Java Real applications Unit testing, JavaFX, threads, design patterns
4 Reflection Metaprogramming Java Reflection API

1️⃣ Assignment 1 — Java Fundamentals

Five standalone problems (Q1.javaQ5.java) solving algorithmic tasks with core Java — input parsing, arrays, grids, and control flow.

💡 In plain English: the warm-up — getting comfortable with Java syntax, reading input, and translating logic into working code.

📂 Assignment 1/


2️⃣ Assignment 2 — Object-Oriented Design

Two larger programs built from cooperating classes:

  • Q1 — Confectionery (sweet-shop) management: models a shop with Customer, Sweet, Warehouse, Transaction, and a Confectionary/ProgramController to tie it together.
  • Q2 — Console game: an anti-aircraft–style game with a Player, Shop, MainMenu, MapHome, and game-loop logic.

💡 In plain English — what is OOP? Object-Oriented Programming organizes a program around objects (a Customer, a Sweet, a Player) that bundle their own data and behavior. This makes large programs easier to reason about and extend than one giant block of code.

📂 Assignment 2/


3️⃣ Assignment 3 — Advanced Java (four mini-projects)

The centerpiece of the course — four independent Maven projects, each teaching a professional Java skill.

🧪 Abbas BooAzar — Unit Testing

A shape/Board drawing model (Drawable, Circle, custom exceptions) paired with JUnit tests (BoardTest2, RandomShape2).

💡 In plain English — unit testing: automated checks that verify each small piece of code behaves correctly. Run them after every change and they instantly tell you if something broke.

👾 Real Pacman — JavaFX GUI

A graphical Pac-Man game with login/registration, a procedurally generated maze (CreateMaze), scoreboard, settings, and profile — built with JavaFX (FXML views + CSS).

💡 In plain English — JavaFX: Java's toolkit for desktop apps with windows, buttons, and graphics. FXML describes the layout (like HTML), while controller classes handle the behavior.

💬 Telegram — Networking & Patterns

A console messaging app with user accounts and port-based commands (createUser, login, sendMessage, setPort, …), parsed through a command-pattern layer (MainMenuPatterns).

💡 In plain English — design patterns: reusable, battle-tested solutions to common programming problems (e.g. how to cleanly route user commands), so you don't reinvent the wheel.

🏦 ThreadPool — Concurrency

A Bank/ATM simulation driven by a custom thread pool: requests become Tasks (create account, deposit, move balance…) that worker threads execute concurrently, returning typed Results, with rich exception handling.

💡 In plain English — a thread pool: instead of starting a brand-new thread for every job (slow and wasteful), you keep a small crew of reusable worker threads and hand them a queue of tasks.

flowchart LR
    R[ATM requests] --> Q[Task queue]
    Q --> W1[Worker thread 1]
    Q --> W2[Worker thread 2]
    Q --> W3[Worker thread 3]
    W1 --> Res[Results]
    W2 --> Res
    W3 --> Res
Loading

📂 Assignment 3/


4️⃣ Assignment 4 — Reflection

An Agent class that uses the Java Reflection API to inspect and manipulate other objects at runtime — listing their methods, and reading/writing private fields — across sample models (Person/Son, Animal/Cat/Lamb, …). A Judge test validates it.

💡 In plain English — reflection: code that can examine and modify itself (or other classes) while the program is running — discovering an object's methods and fields without knowing its type in advance. It's the magic behind many frameworks (testing tools, dependency injection, serializers).

📂 Assignment 4/


🚀 Building & Running

  • Assignments 1 & 2 are plain Java files — compile and run directly:
    javac "Assignment 1/Q1.java" && java Q1
  • Assignment 3 & 4 projects use Maven:
    cd "Assignment 3/ThreadPool/121212"
    mvn compile        # or: mvn test  to run the unit tests
    The JavaFX project (Real Pacman) runs via the JavaFX Maven plugin / your IDE.

🛠️ Concepts Covered

Core Java · OOP · Unit Testing (JUnit) · JavaFX & FXML · Multithreading / Thread Pools · Design Patterns · Networking · Reflection · Maven

🎮 A larger course project (a Yu-Gi-Oh! game) lives in a separate repository.

About

Java - advanced topics in oop

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages