The project component of an IDE (like Eclipse) contains resources such as files and directories. It implements a GetResource interface:
interface GetResource {
File getFile(String fileName);
Directory getDirectory(String dirName);
}
A project requires the following interfaces:
interface Run {
void run(File f);
}
interface Edit {
void edit(File f);
}
interface Debug {
void setBreakPoint(File f, int line);
void inspect(String variable);
void step();
void run();
}
interface Build {
void compile(File f);
void link();
}
The Run interface is realized by a runtime environment component. The other interfaces are realized by editor, debugger, and compiler components. Of course all of these components require the project's GetResource interface.
Draw a component diagram representing the above.
An IDE instantiates the Model-View-Controller pattern. It consists of several view and controller components:
ProjectView
DebuggerView, DebuggerControl
EditorView, EditorControl
LogView, CompilerControl
OutputView, RTEControl
The debugger controller requires the debug interface and implements the debug command interface:
interface DebugCommand {
void executeSet();
void executeStep();
void executeInspect();
void executeRun();
}
The debugger view requires the debug interface and debug command interface.
Draw a component diagram representing the above.
A web application consists of the following components:
Web Browser running on a client computer
Web Server running on a server
Data base server running on another server
The web server implements the HTTP interface:
interface HTTP {
void get(String url);
void post(String url);
}
This interface is required by the web browser.
The database server implements the SQL interface required by the web server:
interface SQL {
ResultSet select(tables, columns,
rows);
void update(table, column, row,
newVal);
}
Draw a component diagram representing the above.
Draw a deployment diagram representing the above.
The browser hosts a component called MUDView, which implements the Applet interface required by the browser:
interface Applet {
void init();
void start();
void stop():
}
The web server hosts three components:
DungeonController
DungeonView
Dungeon
The first two components implement the servlet interface required by the web server:
interface Servlet {
void service(Request r1, Response r2);
}
The Dungeon contains rooms, objects, and players. It implements the following interface, which is required by the servlets:
interface IDungeon {
Room getRoom(String name);
List<Object> getObjects(Room r);
List<Player> getPlayers(Room r);
}
The dungeon requires the SQL interface for persistence.
Draw a component diagram of the above.
Draw a class diagram showing the implementation of the dungeon component as a collaboration.