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.
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"]
| # | 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 |
Five standalone problems (Q1.java … Q5.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.
Two larger programs built from cooperating classes:
- Q1 — Confectionery (sweet-shop) management: models a shop with
Customer,Sweet,Warehouse,Transaction, and aConfectionary/ProgramControllerto 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, aSweet, aPlayer) that bundle their own data and behavior. This makes large programs easier to reason about and extend than one giant block of code.
The centerpiece of the course — four independent Maven projects, each teaching a professional Java skill.
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.
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.
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.
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
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).
- Assignments 1 & 2 are plain Java files — compile and run directly:
javac "Assignment 1/Q1.java" && java Q1
- Assignment 3 & 4 projects use Maven:
The JavaFX project (Real Pacman) runs via the JavaFX Maven plugin / your IDE.
cd "Assignment 3/ThreadPool/121212" mvn compile # or: mvn test to run the unit tests
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.