Now that the core has been designed, the next section can be architected. The user interaction section will be a set of modules to provide an interface to the user. The interactions that are needed are:
Creating, editing, deleting users
Providing admin access to all users
When users access the first page of the site, there are two possible outcomes (Figure 21-3). If they are authenticated, they will see a listing of their contacts. If they are not authenticated, they will be redirected to a login page.
The IndexModule object will be an instance of the Module that I detailed in the core section. It has one public method, called default(), which is the action that the Controller object would execute during a call to render(). This method needs to make a decision whether to show a collection of contacts or to do the redirect.
Logically, I'm going to assume that the next step is to provide the login view for the user. (I'll discuss contactscollection later, but suffice it to say it's used if the current user is already authenticated.)
Login functionality will be provided by a module (Figure 21-4).
LoginModule has two public methods. ...