Skip to content

About

Coursework for the 2nd year COMP 009 (Object-Oriented Programming) course in PUP Manila.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

COMP009 Coursework

Under the AilurusLabs Study Projects (Java)

By Gabriel Virrey (first published 2025-10-26)

A collection of coursework in partial fulfillment of the second year course COMP009, Object-Oriented Programming (in Java) of the BSCS program at the Polytechnic University of the Philippines, Manila.

These programs, though small and perhaps trivial, are made with the goal of applying the principles and features of modern, idiomatic Java, in order to make them robust, extensible, and hopefully, well-designed.

To-do:

[x] Prepare repository (initial commit, README, branch rulesets)

[ ] Improve activity7 exit flow.

Project Ideologies:

  • Engineer, don't just code.

    I aim to make this repository my training ground for building robust and well-designed systems. Every activity in this repo could have been solved in a far simpler way; all of them could've been done in one file. But my goal here is to equip myself with the sense to develop good systems, applying lessons I've learned and continue to learn.

  • No code completion

    At least, not yet. Code completion is honestly great, and I have used it plenty of times before. But at this stage of learning, I want to familiarize myself with the language first and rediscover the patterns and principles I learned about independently. To achieve this, I completely disabled inline and cloud completions on IntelliJ (my preferred IDE). I also stopped all Copilot completions.

  • AI for feedback and tutoring, never code generation.

    The only time I can use AI is if I'm seeking feedback on my code or trying to learn a new concept (like I did for Maven).

  • Have fun!

    I may be the only person who is insane enough to admit that I really love Java and OOP. I find it really fascinating and natural.

Design Choices You'll See:

  1. Dependency Injection

    Really fancy term, but is such an elegant and fundamental paradigm. You'll see DI in the GameManager classes for activities 6 and 7. On activity 7, the RockPaperScissorsGame class depends on two implementations of the abstract Player class. On instantiation, these two Players get passed into our game object.

  2. Strategy Pattern

    Closely tied with DI, this is what makes the abstract Player class work. We defined two implementations, CPUPlayer and HumanPlayer, both with a shared single abstract method, play(), but have different implementations for it. This allows the game class to couple to the abstraction and call the abstract play() method without caring about what's happening underneath the hood.

  3. Arming for Testability

    Though as of the time of writing (2025-10-26), I have not implemented any tests yet (rather, I don't know how yet), the programs within this project are built with testing in mind.

  4. and more, maybe!

    I expect that most of the programs in this project will use at least these design patterns, but as we build more activities, I might use more patterns as they're needed!

Prerequisites:

  • Java 24 or newer

    I had considered going to Java 25, but for this project to play nicely with environments that do not have Java 25 yet, I ultimately decided to stay on Java 24. The new, compact syntax of Java 25 is certainly great, though, and moving up to Java 25 shouldn't be too much of a pain.

  • Apache Maven (3.9 or newer)

    I switched to a Maven-managed project to centralize all my future coursework and simplify cross-module dependencies (case in point: my reusable util.InputManager record, which I am quite happy about). It also simplifies building and creating executable uber-JAR files, which I can submit to my instructor for grading.

Building from Source:

  1. Clone the repository:
git clone https://github.com/ppgabe/comp009-coursework
  1. Navigate to the cloned directory:
cd comp009-coursework
  1. Run the Maven clean package command:
mvn clean package

This will clean, validate, compile, test, and package all modules in the project. Uber JAR files will be automatically generated by the Maven Shade plugin. You can find the packaged JAR files for each module in their respective target/ directory.

How to Run:

You can run executable JAR files using the java -jar command. Example for the activity7 module:

cd activity7/target/
java -jar activity7-1.0-SNAPSHOT.jar

You may also include arguments, if needed. In the case of the activity6 module:

cd activity6/target/
java -jar activity6-1.0-SNAPSHOT.jar 5 100

Contributing:

NOTICE: To uphold my academic integrity, I will not be using external contributions in any of my course submissions. By the time I upload an activity here, it would have been submitted already.

Even though this is primarily intended to be a centralized repo for my COMP 009 coursework, you are more than welcome to make your own contributions! I will be more than happy to engage in discussions and learn from fellow developers.

About

Coursework for the 2nd year COMP 009 (Object-Oriented Programming) course in PUP Manila.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages