COMP 310
|
Lab09: ChatApp Design |
![]() ![]() ![]() ![]() ![]() ![]() |
In today's lab, we will be working in small groups to work out use cases and design the interfaces and protocols for the ChatApp project.
The Design Process:
Note that coding is the LAST thing that is done!
Use cases can be created using (non-exhaustive list):
An "Application Programming Interface" (API) is a common interface (or set of interfaces) that used for one part of a system, "a "module", to communicate with another part of the system, i.e. another module. API's are related to the adapter interfaces in an MVC because the model and the view are modules in the system and the adapter interfaces define the communications between them. API exist between all modules in a system, as one can see when the system of interconnected modules is viewed as a generalized MVC with multiple "models" and "views".
The modules, or "system blocks" in a system arise from the semantic grouping of use cases. Each module is thus represented by a set of use cases to accomplish a related goal such as data storage, user interface, analytical computation, etc. API's arise from the use cases that cross the boundaries between modules, that is, when the use case in one module is composed with ("uses") a use case in another module. Those boundary-crossing use cases thus form a set of behaviors that one module expects from another and thus can be expressed as one or more interfaces in code.
For ChatApp, the API that we are most concerned with is the API at the boundary between computers, that is, the API defined by the use cases that cross the network boundary.
Nitty-gritty technical detail: Technically, an API and an MVC adapter interfaces are not exactly the same thing. The job of API to a module is to decouple the module from the rest of the system such that the module can be replaced without affecting the rest of the system in any way. An API is thus common interface that all other modules use to communicate with that type of module. This enables module to be swapped in and out at run-time or multiple modules to be used simultaneously, e.g. for load balancing. This is contrast to an MVC adapter interface which is specific to a particular user of a module. Thus, in a multi-module system, each module will conform to its particular API in terms of its public interface but each module will use its own MVC adapter interface to talk to another module. Those adapter interaces may be quite different than the API interface, so the MVC adapter implementations will translate the MVC adapter interface methods to API calls.
For reference:
Questions to consider:
© 2017 by Stephen Wong