How sarec-lab/softwareengineering2018 works
1. This repository is a Java teaching monorepo, not one cohesive product. It contains many mostly independent sample applications, homework solutions, and design-pattern exercises under separate package roots. For an architecture diagram, treat each top-level package tree as its own subsystem unless a shared resource is explicitly referenced.
2. The most complete “application” area is the chat system under src/chatclient and src/chatserver. It is split into a client, a server, and a small shared constants package. Both ends use JavaFX UI files (FXMLDocument.fxml) with controllers, so the UI boundary is clearly separated from network/application logic.
3. The chat server side centers on ChatServer and Transcript, suggesting a message relay plus transcript/logging responsibility. The client side centers on ChatClient and ChatGateway, which likely mediate between the UI controller and the server connection. A diagram should show: UI/controller -> gateway -> server -> transcript/persistence/logging.
4. The railway-crossing simulation is another major subsystem, duplicated in two versions: edu.nd.sarec.railwaycrossing and edu.nd.sarec.railwaycrossingnew. These appear to be an older and newer iteration of the same domain model, view layer, and simulation entry point. The “new” version also includes a test package, indicating a more testable refactor.
5. Both railway-crossing versions are organized as a classic model-view-simulation structure. The model contains infrastructure (Road, RailwayTracks, MapBuilder, Direction) and vehicles (Car, Train, CarFactory, IVehicle). The view layer contains display abstractions (IDisplay, MapDisplay, RoadDisplay, TracksDisplay, CarImageSelector), implying the simulation renders multiple layers of the map and moving entities.
6. The crossing gate logic is isolated in its own state-machine package under model/infrastructure/gate. Classes like GateOpen, GateClosed, GateOpening, and GateClosing implement IGateState, with CrossingGate as the stateful context. That means gate behavior is modeled as explicit state transitions rather than ad hoc conditionals; a diagram should show the gate as a state machine attached to the simulation.
7. The edu.nd.sarec.drag package is a small JavaFX-style interactive app with DragApplication, Controller, and drag.fxml. It appears to be a separate UI exercise centered on drag-and-drop or pointer interaction, and should be diagrammed as a self-contained MVC-like app with an FXML view and controller.
8. The edu.nd.se2018 tree is a course examples and homework area. It contains many unrelated mini-apps and demos: maze solving, animation timers, observer-pattern weather station and cat/mouse examples, state-pattern gumball machine, and introductory week/homework exercises. These should be shown as a set of independent examples rather than one system.
9. The headfirst and headfirst_design_patterns trees are classic design-pattern sample implementations. They include adapter, decorator, factory, and strategy-style duck examples, plus multiple variants of the same pattern exercises. Architecturally, these are educational reference implementations with no shared runtime; each subfolder is a standalone demo or test drive.
10. The pipe-and-filter example under src/pipeandfilter is another distinct mini-architecture. PipelineBuilder in setup suggests the pipeline is assembled programmatically, while infrastructure contains generic filter stages such as increment, double, reverse-number, and end-of-pipe. A diagram should show a linear dataflow pipeline where numbers pass through composed filters to a terminal sink.
11. Shared assets are minimal but relevant. The chip, images, and src/images/texture directories indicate UI or simulation graphics assets used by some of the JavaFX demos, especially the railway-crossing views and related visual examples. These are supporting resources rather than architectural components.
12. The repo has both source and test material mixed into the same tree. Tests are present for selected examples and the railwaycrossingnew package, but there is no central build or deployment boundary visible in the tree. For architecture purposes, assume local execution of individual demos/tests rather than a unified server or production deployment.
13. The main architectural boundary across the entire repository is “example/application package versus support pattern/demo package.” Each application area is mostly self-contained, with its own entry point, UI, model, and tests. There is little evidence of cross-module coupling, so an accurate diagram should emphasize a portfolio of independent Java exercises rather than a layered enterprise system.
Main entry points: images Assets · FXMLDocument.fxml Chat UI · ChatServer.java Chat server · Simulation.java Rail sim
Components 23
Chat system
Client-server JavaFX chat example with shared constants and transcript logging.
- Chat UI · FXML-based chat client UI and controller boundary.
src/chatclient/FXMLDocument.fxml - Gateway · Client-side bridge between UI and server connection.
src/chatclient/ChatGateway.java - Chat client · Client application entry point and UI host.
src/chatclient/ChatClient.java - Chat server · Server application entry point for message relay.
src/chatserver/ChatServer.java - Transcript · Server-side transcript or persistence/logging component.
src/chatserver/Transcript.java - Chat constants · Shared chat protocol or UI constants.
src/chat/ChatConstants.java
Railway crossing
Two iterations of the railway-crossing simulation with model, view, and gate state machine.
- Rail sim · Original railway-crossing simulation entry point.
src/edu/nd/sarec/railwaycrossing/Simulation.java - Model · Road, tracks, direction, vehicles, and map assembly for the original simulation.
src/edu/nd/sarec/railwaycrossing/model - Gate FSM · Crossing gate state machine with open/closed transitions.
src/edu/nd/sarec/railwaycrossing/model/infrastructure/gate - View · Map, road, tracks, and car image selection for the original simulation.
src/edu/nd/sarec/railwaycrossing/view - Rail sim new · Refactored railway-crossing simulation entry point.
src/edu/nd/sarec/railwaycrossingnew/Simulation.java - Model new · Refactored road, tracks, direction, vehicles, and map assembly.
src/edu/nd/sarec/railwaycrossingnew/model - Gate FSM new · Refactored crossing gate state machine attached to the new simulation.
src/edu/nd/sarec/railwaycrossingnew/model/infrastructure/gate - View new · Refactored map, road, tracks, and car view rendering.
src/edu/nd/sarec/railwaycrossingnew/view
Course examples
Independent demos and homework solutions under the SE 2018 tree.
- Drag app · Standalone drag-and-drop style JavaFX exercise.
src/edu/nd/sarec/drag/DragApplication.java - Drag controller · Controller for the drag interaction UI.
src/edu/nd/sarec/drag/Controller.java - SE examples · Independent course demos covering maze, observer, state, animation, MVC, and basics.
src/edu/nd/se2018/examples - Homework · Homework solutions and tests grouped by assignment.
src/edu/nd/se2018/homework
Pattern samples
Standalone design-pattern reference implementations.
- Head First · Design-pattern teaching examples and test drives.
src/headfirst/designpatterns - Duck patterns · Alternate duck strategy-pattern implementation set.
src/headfirst_design_patterns/ducks
Pipe and filter
Linear filter pipeline example with a builder and reusable stages.
- Pipeline builder · Assembles the pipe-and-filter pipeline.
src/pipeandfilter/setup/PipelineBuilder.java - Filters · Increment, double, reverse-number, and terminal pipeline stages.
src/pipeandfilter/infrastructure
Shared assets
Image and texture resources used by visual demos.
- Assets · Shared visual resources used by UI and simulation examples.
src/images
Connections 20
- Chat client → Chat UI: launches · Client starts the JavaFX UI.
- Chat UI → Gateway: uses · Controller delegates user actions to the gateway.
- Gateway → Chat server: connects to · Gateway sends client messages to the server.
- Chat server → Transcript: records · Server writes or consults transcript state.
- Chat UI → Chat constants: shares · UI and client rely on common chat constants.
- Chat server → Chat constants: shares · Server and client use the same shared constants.
- Rail sim → Model: drives · Simulation advances the domain model.
- Rail sim → View: renders · Simulation updates the visual layer.
- Model → Gate FSM: contains · Gate state machine is part of the infrastructure model.
- View → Assets: loads · View layer uses shared textures and imagery.
- Rail sim new → Model new: drives · New simulation advances the refactored model.
- Rail sim new → View new: renders · New simulation updates the visual layer.
- Model new → Gate FSM new: contains · Gate state machine is embedded in the new model.
- View new → Assets: loads · Refactored views use shared images.
- Drag app → Drag controller: binds · JavaFX app binds the FXML controller.
- Drag app → Assets: loads · App may use shared graphics resources.
- SE examples → Homework: separated from · Examples and homework are distinct teaching areas.
- Head First → Duck patterns: parallel demos · Two independent design-pattern sample trees.
- Pipeline builder → Filters: composes · Builder wires the filter chain together.
- Filters → Assets: optional assets · No strong dependency; visual resources are shared elsewhere.