UMM-CSci-3601 / 3601-lab2_client-server

The starter code for CSCI 3601 Lab 2, client and server technologies.
MIT License
0 stars 4 forks source link

Extract new `Main` class and introduce `Controller` interface #316

Closed NicMcPhee closed 7 months ago

NicMcPhee commented 7 months ago

This the main method out of Server and into a new Main class. It also introduces a new Controller interface which UserController now implements. This allows Server to be entirely isolated from the details of the controllers.

It turned out that getResourcesAsStream returned null if it couldn't fine the resource, and I really wanted something more specific. Since the UserDatabase constructor was already declaring the potential for throwing a IOException, it seemed reasonable to throw one of those.

This also adds a lot of comments in places where they were thin.