What you will learn

SENG 12233 Object-Oriented Programming is a compulsory 3-credit Year 1 course. It builds on SENG 11223 Programming Concepts and teaches you to design programs as collaborating objects, using Java.

Every lecture adds a feature to the same Library Management System (LMS). You meet each new idea twice: first in the lecture notes and slides, then in a weekly lab where you add it to your own copy of the project and commit it with Git.

12 Lectures · 9 Labs · 1 Midterm · 1 Final Project

Learning outcomes. After this course you can:
LO1 write Java programs using classes, objects and methods;
LO2 use Git to keep a project history and work on branches;
LO3 apply encapsulation, inheritance, polymorphism, abstraction, exceptions and generics;
LO4 build a graphical interface with Swing events and the MVC pattern;
LO5 store and retrieve data with JDBC.

I

Foundations of OOP

Lectures 01 – 05 · Classes, inheritance, abstraction and exceptions

Introduction to OOP & Git
Why objects? Your first class, and version control from day one
L01 · Week 1 · 3 h
01
  • Procedural vs object-oriented thinking: the four pillars at a glance
  • Classes, objects, fields, methods and constructors
  • Running Java: javac, java and your IDE
  • Git essentials: init, add, commit, branch, push, pull request
Classes, Objects & Encapsulation
Protect your data: private fields, getters, validation
L02 · Week 2 · Lab 1
02
  • Designing a class: state and behaviour
  • private fields, public methods, validation in setters
  • this, static members and object references
  • Starting the LMS: Book, Member and Library
Inheritance & Polymorphism
Reuse with extends; let the object decide at run time
L03 · Week 3 · Lab 2
03
  • extends, super, constructor chaining
  • Overriding vs overloading; @Override
  • Static vs dynamic binding; upcasting and instanceof
  • LMS: LibraryItem with Book, DVD and Magazine
Abstract Classes & Interfaces
Contracts that classes promise to keep
L04 · Week 4 · Lab 3
04
  • abstract classes and methods
  • interfaces, default methods, multiple interfaces
  • Choosing between abstract class and interface
  • LMS: Loanable, Reservable and Comparable<Member>
Exception Handling
When things go wrong: fail loudly and recover politely
L05 · Week 5 · Lab 4
05
  • try, catch, finally and try-with-resources
  • Checked vs unchecked exceptions
  • Writing your own exception classes
  • LMS: ItemNotAvailableException and MemberNotFoundException
II

Review & Midterm

Lectures 06 – 07 · Consolidate before the in-class midterm

Consolidation & Review
Join the pieces; practise before the midterm
L06 · Week 6 · No lab
06
  • Concept map of Weeks 1–5
  • Worked mini-problems that mix inheritance, interfaces and exceptions
  • Reading code and predicting output
  • Common mistakes and how the compiler reports them
Midterm Briefing
Format, topics and a sample paper
L07 · Week 7 · In-class midterm
07
  • What is examined and what is not
  • Sample questions with worked answers
  • Time management and checking habits
III

Graphical Interfaces

Lectures 08 – 09 · Swing, events and the MVC pattern

GUI I: Swing Layouts & Widgets
Give the LMS a window
L08 · Week 8 · Lab 5
08
  • JFrame, JPanel and the common widgets
  • BorderLayout, FlowLayout, GridLayout and nesting
  • JTable and DefaultTableModel
  • Starting Swing on the Event Dispatch Thread
GUI II: Events & MVC
Make buttons work, and keep the layers apart
L09 · Week 9 · Lab 6
09
  • Listeners and lambdas
  • JOptionPane for results and errors
  • Model, View and Controller
  • LMS: LibraryController connects window and model
IV

Data, Persistence & Concurrency

Lectures 10 – 12 · Generics, streams, JDBC and threads

Generics, Collections & Streams
One Repository<T> for everything
L10 · Week 10 · Lab 7
10
  • Generic classes and type parameters
  • List, Set and Map: choosing well
  • Optional and lambdas
  • Streams: filter, map, sorted, groupingBy
JDBC: Database Connectivity
The LMS remembers between runs
L11 · Week 11 · Lab 8
11
  • Tables, keys and SQL basics
  • Connection, PreparedStatement and ResultSet
  • SQL injection and why placeholders matter
  • The DAO pattern and a three-table JOIN
Multithreading & Final Integration
Responsive windows, safe shared data, and shipping v1.0
L12 · Week 12 · Lab 9
12
  • Threads, SwingWorker and the EDT
  • Daemon threads and invokeLater
  • Race conditions and synchronized
  • Final project, demo and README

Lab sheets

Each lab sheet lists the goal, the steps, a checklist and what to submit. Work on a new Git branch named as shown, and open a pull request when you finish. Weeks 1, 6 and 7 have no lab sheet: Week 1 is the Git guide, Week 6 is review and Week 7 is the midterm.

Classes, Objects & Encapsulation
Branch week2-encapsulation
Lab 1 · Week 2 · LO1, LO3
01
Inheritance & Polymorphism
Branch week3-inheritance-polymorphism
Lab 2 · Week 3 · LO3
02
Abstract Classes & Interfaces
Branch week4-abstraction-interfaces
Lab 3 · Week 4 · LO3
03
Exception Handling
Branch week5-exceptions
Lab 4 · Week 5 · LO3
04
GUI I: Layouts & Widgets
Branch week8-gui-layouts
Lab 5 · Week 8 · LO4
05
GUI II: Events & MVC
Branch week9-gui-events-mvc
Lab 6 · Week 9 · LO4
06
Generics, Collections & Streams
Branch week10-generics-streams
Lab 7 · Week 10 · LO3
07
JDBC
Branch week11-jdbc
Lab 8 · Week 11 · LO5
08
Multithreading & Final Integration
Branch week12-threads-final
Lab 9 · Week 12 · LO3–LO5
09

Build it step by step

The LMS guide walks you through the whole system in nine illustrated steps, one per lab. Each step shows the class diagram, the code to write, the command to run and the output or screenshot you should see.

Stuck? Compare with the reference solution, which contains the finished code at the end of every week and the complete final project.

Version control for your labs

The Git Support Guide takes you from installing Git to your first pull request, with the exact commands, a branch-per-week workflow, and fixes for the mistakes beginners meet most often.

Branch naming: one branch per lab, for example week2-encapsulation. Commit small and often, with messages that say what changed.

Rule of thumb: if the program works, commit it. If you are about to try something risky, commit first.

How you are assessed

Weekly Labs · Individual

Lab pull requests

Weeks 2–5 and 8–12 · Submitted as a Git pull request

Each lab is marked on the checklist in its lab sheet, on working code and on a readable Git history.

40% of Final Grade

Midterm · In class

Midterm examination

Week 7 · Covers Weeks 1–5

Reading code, predicting output, fixing errors and writing short classes. See the Midterm Briefing for the format and a sample.

25% of Final Grade

Final Project · Individual

LMS project and demo

Week 12 · Repository plus short demo

Your finished Library Management System, a clean README, and a short demo in which you explain one design decision.

25% of Final Grade

Git Practice

Version-control habits

Across the semester

Regular commits, meaningful messages and one branch per lab.

10% of Final Grade

Materials & references

📘

LMS Guide

Nine illustrated steps that build the Library Management System

🌿

Git Support Guide

Commands, workflow and troubleshooting

📦

Reference solution

Finished code for every week and the complete final project

☕

Java 21 API

Official documentation for every class we use

🎓

dev.java Learn

Free tutorials from the Java team

📖

Pro Git

The free Git book, for when you want more depth

Module Information

SENG 12233 — Object-Oriented Programming is delivered by Eng. Dr. Tiroshan Madushanka, Software Engineering Teaching Unit, Faculty of Science, University of Kelaniya. It is a compulsory 3-credit course in Year 1.

Pre-requisite: SENG 11223 Programming Concepts.

Academic integrity: Lab and project work must be your own. You may discuss ideas with friends, but you must write and commit your own code.

Software to install: JDK 21, Git and an IDE such as IntelliJ IDEA or VS Code. For Week 11, the SQLite JDBC jar (instructions in Lab 8).

Contact: Please use the University LMS for submissions, announcements and questions.