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.
This the
main
method out ofServer
and into a newMain
class. It also introduces a newController
interface whichUserController
now implements. This allowsServer
to be entirely isolated from the details of the controllers.It turned out that
getResourcesAsStream
returnednull
if it couldn't fine the resource, and I really wanted something more specific. Since theUserDatabase
constructor was already declaring the potential for throwing aIOException
, it seemed reasonable to throw one of those.This also adds a lot of comments in places where they were thin.