1.0

COIT13235 — Enterprise Software Development

Week 1: Introduction, Setup & Review

CQUniversity · Term 2, 2026

1.1

1.1 Welcome & This Week's Plan

Unit aim: Build better software, better. Learn to design, develop and test multi-tiered enterprise applications using modern Java frameworks.

This week you will:

Readings: Chapter 1 of Fernando, C 2022, Solution Architecture Patterns for Enterprise. Apress.
1.2

1.2 Course Outline — Week by Week

WeekTopic
1Review: Java, OOP, Databases, HTTP, Setup
2Fundamentals: Persistence, Records, UML, Design Patterns, Databases
3Spring Boot: Initializr, Maven, Lombok, IoC, Unit Testing
4Optionals, HTTP, HTML, Conventions — A1 Due (20%)
5-8REST Services, REST Clients, MVC & Thymeleaf, Security — A2 (30%)
9-11Microservices (Eureka), Group Project — A3 (50%)
1.3

1.3 Unit Objectives

By the end of this unit, you will be able to:

1.4

1.4 Assessment Overview

A1 — Individual 20% · Due Week 4 Design, implement & test a component (clone of Uber/Netflix/Spotify) Sprint review in tutorial A2 — Apps 30% · Weeks 5-8 SpringBoot apps for Persistence, REST, MVC & Security Weekly quizzes A3 — Group Project 50% · Weeks 9-11 Continue A1 in group of 3-5 people Full enterprise system Sprint reviews in tutorials
Important: A1 (Week 4) expects understanding of Weeks 1 & 2. Start reviewing early.
2.0

Section 2: Development Environment Setup

OpenJDK 26, VS Code, Spring Boot

2.1

2.1 What You Need to Install

OpenJDK 26 Java Runtime jdk.java.net VS Code Code Editor / IDE code.visualstudio.com VS Code Extensions Extension Pack for Java (Microsoft) Spring Boot Extension Pack (VMware)
IT Resources: Java + VS Code is the primary setup. Other IDEs (e.g. NetBeans) are possible. The IDE must support Maven & Git/GitHub.
2.2

2.2 Step-by-Step Setup

Step 1: Install OpenJDK 26

Step 2: Install VS Code

Step 3: Configure Java runtime in VS Code

// In VS Code: Manage > Settings > Search "java.configuration"
// Edit Runtimes in settings.json:
"java.configuration.runtimes": [
  {
    "name": "JavaSE-26",
    "path": "C:\\openjdk-26.0.1_windows-x64_bin\\jdk-26.0.1"
  }
]

Step 4: Install VS Code Extensions

2.3

2.3 Your First Spring Boot Project

Verify your setup by creating and running a project:

Steps to create:

File → New File → New Java Project → Spring Boot → Maven → 4.1.0 → Java → com.example → demo → Jar → 26 → No dependencies → Generate

Run using the play button on DemoApplication.java. You should see:

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v4.1.0)
If you see this banner, your environment is correctly configured.
3.0

Section 3: HTTP Fundamentals

How the web communicates

3.1

3.1 What is HTTP?

HTTP stands for HyperText Transfer Protocol. Originally developed (1989-1991) by Tim Berners-Lee for transmitting web pages, it has evolved into a general-purpose protocol for communicating on the web.

Key properties of HTTP:

Client (Browser) Server (Web App) HTTP Request HTTP Response
Figure 3.1: The client-server request-response model of HTTP.
3.2

3.2 HTTP Messages — Requests & Responses

A URI (Uniform Resource Identifier) specifies a resource, e.g.:

http://webserver.com/path/sub/file?requestParam=value

Request

GET / HTTP/1.1
Accept: text/html

(empty body)

First line: METHOD PATH VERSION

Response

HTTP/1.1 200 OK
Content-Type: text/html

<h1>Hello</h1>

First line: VERSION STATUS

HTTP messages have three parts: (1) a first line, (2) optional headers, and (3) an optional body, separated by a blank line.
3.3

3.3 HTML Links & Forms for HTTP Data Transfer

HTML provides two main ways to send HTTP requests:

Links (GET)

<a href="/">Home</a>

Generates: GET / with no body

Forms (GET or POST)

<form method="GET" action="/">
  <input type="text"
    name="name" value="John">
  <button type="submit">
    Submit
  </button>
</form>

GET: GET /?name=John (in URL)
POST: POST / with name=John in body

3.4

3.4 A Simple Java Web Server

Java can create a basic web server using the built-in HttpServer class:

// Create server listening on port 8080
HttpServer server = HttpServer.create(new InetSocketAddress(8080));

// Handle requests to "/" using the handleRequest method
server.createContext("/", handleRequest);
server.start();

// Handler: respond with HTML
private static void handleRequest(HttpExchange exchange) {
    String response = "<h1>Hello</h1>";
    exchange.getResponseHeaders().put("Content-Type",
        List.of("text/html"));
    exchange.sendResponseHeaders(200, response.length());
    exchange.getResponseBody().write(response.getBytes());
    exchange.close();
}
The Content-Type header tells the browser what kind of content is in the response body (e.g. text/html).
3.Q

Knowledge Check — HTTP

Q1: In HTTP, who initiates the communication?
HTTP is asymmetric: the client always initiates the request, and the server replies with a response.
Q2: What HTTP method does a hyperlink (<a href="/">) generate?
HTML links always generate GET requests. Only forms can use POST.
4.0

Section 4: Java Review

OOP, Interfaces, SOLID, Generics, Records

4.1

4.1 Inheritance: Extend Carefully, Don't Modify

class Animal {
    public void animalSound() {
        System.out.println("Animal makes noise.");
    }
    public void sleep() {
        System.out.println("Zzz");
    }
}

class Dog extends Animal {
    public void animalSound() {        // Override
        System.out.println("woof woof");
    }
}
SOLID Principles at play:
4.2

4.2 Interfaces Promote Maintainability

Think of interfaces as behaviour contracts — they define what an object can do, not how:

interface Animal {
    void animalSound();
    void sleep();
}

class Dog implements Animal {
    public void animalSound() {
        System.out.println("woof");
    }
    public void sleep() {
        System.out.println("Zzz");
    }
}
Why interfaces?
  • Loose coupling: code depends on the interface, not a concrete class
  • Replaceability: swap Dog for Cat without changing calling code
// Can easily replace Dog() with Cat()
Animal myAnimal = new Dog();
myAnimal.animalSound();
In this unit, Spring Boot uses interfaces extensively to make components replaceable. This is a key enterprise principle.
4.3

4.3 Review of SOLID Principles

SOLID helps write maintainable code (from COIT12200 Week 6):

LetterPrincipleWhat it means
SSingle ResponsibilityA class should have only one job. E.g. User shouldn't have both saveToDatabase() and sendEmail().
OOpen/ClosedOpen for extension (subclass), closed for modification.
LLiskov SubstitutionSubclass behaviour must be consistent with superclass.
IInterface SegregationUse small, focused interfaces rather than one large one.
DDependency InversionDepend on abstractions (interfaces), not concrete classes.
4.4

4.4 Generics & Objects.equals()

Generics (type-safe collections)

ArrayList<String> cars = new ArrayList<>();
cars.add("Volvo");
System.out.println(cars.get(0));
// Output: Volvo

<String> tells the compiler this list only holds Strings. Avoids runtime errors.

Objects.equals() for safe comparison

Integer j = 30000000;
Integer k = 30000000;

// WRONG - fails for large Integers
j == k       // false!

// WRONG - NullPointerException if null
i.equals(j)  // crash if i is null

// CORRECT - null-safe
Objects.equals(j, k)  // true
Always use Objects.equals(a, b) for comparing objects. It handles null safely.
4.5

4.5 Java Records — Concise Data Classes

Records (Java 14+) are immutable classes for data, eliminating boilerplate:

With Records (1 line)

record Person(String name,
              String address) {}
Person joe = new Person("joe",
                "1 Way Drive");
System.out.println(joe.name());
// Output: joe

What the compiler generates

class Person {
  private final String name;
  private final String address;
  // Constructor
  public Person(String name,
                String address) {...}
  // Getters
  public String name() {...}
  public String address() {...}
  // equals(), hashCode(), toString()
}
Records are used heavily in enterprise code for data transfer objects — objects that carry data between layers.
4.Q

Knowledge Check — Java Review

Q1: Why should you use interfaces rather than inheritance for loose coupling?
Interfaces define a contract (what to do), not implementation (how). This lets you replace Dog with Cat without changing the rest of the code.
Q2: What does the "S" in SOLID stand for?
S = Single Responsibility: a class should have only one reason to change — only one job.
5.0

Section 5: UML & Database Review

Use Case Diagrams, Class Diagrams, ERDs

5.1

5.1 Use Case Diagrams (UCDs)

UCDs visualise who does what at an eagle's-eye perspective:

System Lecturer Inform Students Manage Grades Upload Material
Figure 5.1: A simple Use Case Diagram.

Best practices:

  • Group small use cases with the same objective
  • Merge CRUD (Create, Read, Update, Delete) into a single "Manage X" use case
  • Use cases often map to menus in your application
  • Tools like PlantUML.com can render diagrams from text
5.2

5.2 Class Diagrams

Class diagrams capture data requirements — entities, attributes, and relationships:

Customer customerId: int name: String email: String + getName(): String Account accountId: int balance: double type: String + deposit(amt): void 1 1..* has
Figure 5.2: EACH Customer has one or more Accounts.
Read cardinalities as: "EACH Customer has one or more Accounts" — not "Customers can have many Accounts."
5.3

5.3 ERD Relationships (COIT11237 Review)

Relationships have degree (how many entities) and cardinality (how many instances):

Employee Department in 0..1 (optional) 1..* (mandatory) An employee can be in at most 1 department A department has at least 1 employee

The three types of binary relationships (determined by maximum cardinalities):

TypeExampleImplementation
1:1Employee ↔ LockerFK in either table (choose wisely)
1:NDepartment ↔ EmployeesFK in the "many" side table
N:MStudents ↔ ClassesIntersection (junction) table
5.4

5.4 Foreign Keys & Intersection Tables

1:N — "Rob from 1, give to many"

Copy the PK of the "1" side as a FK into the "many" side table.

N:M — Use an Intersection Table

Neither PK can be a FK, so create a new table with a composite primary key:

Student studentId (PK) name Enrolment studentId (FK, PK) classId (FK, PK) grade Class classId (PK) className
Figure 5.4: N:M resolved via an intersection table (Enrolment).
5.Q

Knowledge Check — UML & Databases

Q1: In a 1:N relationship, where does the Foreign Key go?
"Rob from 1, give to many" — copy the PK of the "1" side as a FK into the "many" side.
Q2: How do you implement an N:M relationship physically?
Neither entity's PK can act as a FK, so you create a new intersection table whose PK is composed of both entities' PKs.
6.0

Section 6: JDBC & the Repository Pattern

Connecting Java to databases

6.1

6.1 Java Database Connectivity (JDBC)

From COIT11237 (SQL) and COIT12200 (JDBC), you know how to:

// SQL examples
CREATE TABLE test_table (id INT PRIMARY KEY, name VARCHAR(255))
INSERT INTO test_table VALUES (1, 'Alice')
SELECT * FROM test_table

In Java, JDBC connects to databases. H2 can be used as an in-memory database for development and testing:

Connection c = DriverManager.getConnection("jdbc:h2:mem:testdb", "sa", "");
Statement stmt = c.createStatement();
stmt.execute("CREATE TABLE test_table (id INT PRIMARY KEY, name VARCHAR(255))");
stmt.execute("INSERT INTO test_table VALUES (1, 'Alice')");
ResultSet rs = stmt.executeQuery("SELECT * FROM test_table");
while (rs.next()) {
    System.out.println(rs.getString("name"));  // Alice
}
6.2

6.2 The Repository Pattern

A Repository abstracts data access — it acts like a collection of domain objects, hiding the underlying SQL or database details.
record Employee(int id, String name,
                int age) {}

class EmployeeRepository {
  void save(Employee e) {
    String query =
      "INSERT INTO Employee " +
      "(id, name, age) VALUES ...";
    // Execute SQL
  }

  Employee findById(int id) {
    String query =
      "SELECT * FROM Employee " +
      "WHERE id = ?";
    // Execute & return
  }
}
Application Code Repository Database (SQL) Repository hides SQL details
7.0

Section 7: Enterprise Software

Architecture, NFRs & the 3-Tier Pattern

7.1

7.1 What is Enterprise Software?

Enterprise = large organisation (e.g. government, hospital, bank). Different enterprises have different complex requirements.

Components of an Information System:

People Users, developers, stakeholders Processes Business rules, workflows Technology HW, SW, Network (Fernando 2022, Ch 1)

Domain examples:

7.2

7.2 The 3-Tiered Architecture

Presentation Tier Web browser, HTML, Thymeleaf (MVC) Business Logic Tier Spring Boot, REST APIs, Controllers Data Persistence Tier Database, ORM, Repository pattern Cross-cutting: Security, Logging
Figure 7.2: The 3-tiered enterprise architecture with cross-cutting concerns (Fernando 2022, Ch 2).
This unit will teach you each tier: Persistence (Weeks 2-4), REST (Weeks 5-6), MVC (Week 7), Security (Week 8), and Microservices (Weeks 9-11).
7.3

7.3 Non-Functional Requirements (NFRs)

Enterprise systems have competing quality attributes. You can't maximise all of them:

Enterprise System Scalability Availability Security Latency Modularity Replaceability Robustness
Example trade-off:

A banking system prioritises security over latency — it's OK to be slightly slower if transactions are safe. A streaming service (Netflix) prioritises latency and scalability.

7.4

7.4 Enterprise Considerations

Reading: Chapter 1 of Fernando, C 2022, Solution Architecture Patterns for Enterprise, Apress.
7.Q

Knowledge Check — Enterprise Software

Q1: What are the three tiers in a 3-tiered enterprise architecture?
The three tiers are: Presentation (UI/View), Business Logic (Controllers/Services), and Data Persistence (Database/ORM).
Q2: Why do NFRs "compete" in enterprise systems?
NFRs are trade-offs. For example, adding encryption (security) adds processing time (latency). Architects choose which NFRs to prioritise based on the domain.
8.0

Section 8: Design Patterns Preview

Singleton & MVC

8.1

8.1 Singleton Pattern

Singleton ensures a class has only one instance and provides a global access point to it.
class DatabaseConnection {
    private static DatabaseConnection instance;

    private DatabaseConnection() {
        // Private constructor prevents external instantiation
    }

    public static DatabaseConnection getInstance() {
        if (instance == null) {
            instance = new DatabaseConnection();
        }
        return instance;
    }
}

// Usage: always get the SAME instance
DatabaseConnection db1 = DatabaseConnection.getInstance();
DatabaseConnection db2 = DatabaseConnection.getInstance();
// db1 == db2 is TRUE
Use Singleton when exactly one object is needed (e.g. database connections, configuration, loggers).
8.2

8.2 Model-View-Controller (MVC) Pattern

MVC separates an application into three components: Model (data & business logic), View (UI), and Controller (input handling & coordination).
User View Browser / HTML Controller Handles input Model Data & Logic sees user action updates notifies
Figure 8.2: The MVC pattern — Controller is the glue between Model and View.

We will build MVC applications with Spring Boot and Thymeleaf in Week 7.

8.Q

Knowledge Check — Design Patterns

Q1: What does the Singleton pattern guarantee?
Singleton uses a private constructor + static getInstance() method to ensure only one instance ever exists.
Q2: In MVC, which component handles user input?
The Controller receives user input, coordinates between Model (data) and View (display), and acts as the "glue".
9.0

Week 1 Summary

What to do next

9.1

9.1 Week 1 Recap & Next Steps

This week you covered:
Action items for this week:

Table of Contents

Press T or Escape to close