Heated Planet: Design Descriptions
Project 3
Myoungsoo Jung, TaeHo Kwon, Jungwoo Lee, Gangmin Park, and Seyoung Choi
April 20. 2009
Project Description
Description of logical design (classes, roles)
We have worked on codes which are using a traditional MVC model. The presentation acts as View, the simulation engine is Model and UI component is Control. We make three major changes on Project 2.
At first, we add a DB package to support persistence property. There are several classes and one interface. The PlanetSimXMLBase is interface for two PlanetSimXMLReader and PlanetSimXMLWriter classes. Two classes are used for reading and writing of XML files. The PlanetSimDB class controls overall procedures of persistence.
The second, a Presentation package handles displaying results of Simulations. In project 2, there is no tilt property. So, we added the tilt property using EarthGridDisplay class and SunDisplay class.
The third, the PerformanceMonitor package is added to support measurement in terms of TIME and MEMORY. In project 2, measurement data is only displayed on command out windows. It was so difficult to check results of simulation. So, we made this package. As PerformanceMonitor class is main class, it creates MeasurementFactory class which is an interface class for ResourcePerformance and TimePerformance. The ResourcePerformance class is used for Memory measurement and The TimePerformance class is used for Time measurement.
Additionally, the PlanetSimCalendar class is used for Date's calculation.
Which persistence medium was used?
We selected the XML file as a persistence medium. XML is easy to use and provide a good extensibility. We handle XML files using PlanetSimXMLReader, PlanetSimXMLWriter and PlanetSimFileManger classes.
What was the format in which the data was stored, and why?
We have stored data in XML individually. Each data is stored as attributes of XML element. The stored information is eccentricity, tilt, simulated time, Data time, latitude and temperature. The reasons of this choice are extensibility and accessibility. If we want to add another type data, we can easily add to XML files without any modification of current XML's structure. Also, if we use one object type including all data types, it is difficult to extract only information of one type from object.
What was the concurrency architecture?
Previously, we have a concurrency problem between the simulation engine and the presentation part. Both parts want to access same results(cell temperature). Because of that, we make a copy of result. So, there is no currency problem in current architecture.
If there is still concurrency in architecture, the performance of program will be down to handle the concurrency.
Reused code
Which code from project 2
Our team can reuse code fragment from project 2 through the package or single class. First we reuse presentation code by using a package. Next, we reuse "Config", "Cell", "Simulator" classes, but it is need to change some attribute and methods since project 3 requirements. However, almost of them is implemented by overriding and overloading for meeting requirements of project 3. Due to this, we can design and implement for our goal without changing legacy methods from project 2 [2].
How was it adopted?
As was mentioned, we can adopt code fragment to this project through the overriding and overload issues. Moreover, we need to some glue code for adopting between new implemented class and legacy classes. In this time, we also just add interface class and extend our methods. Of course, we can provide also, that added interface classes exchange data between new and legacy classes for smooth communications. You can find this code footprint as following class diagram in next sections.
How you chose from among available saved simulation?
We should find the most of helpful available saved simulation for the given condition from user. First we look up the elapsed data on the XML format. If we can find the name in our data then we check that saved starting time is smaller than requested starting time and saved finishing time is grater then requested time. In the contrast, if we cannot find name in our XML then find the candidate the physical factor which has the maximum geographic accuracy plus temporal accuracy until all conditions are same. Finally, we can decide available saved simulation data. Actually it is available not best. We try to find nearest data from the real data by using an interpolation. Due to this, we can pick up the most useful simulation.
Design of Class diagram (with textual descriptions)
We separate our class diagrams by MVC Model design criteria. Due to this, we propose 5 figures about each diagram about Model, View, and Control. First, Model consists of major classes which are "Simulator", "Earth", "Cell" and so on.
Class diagram about Model
<Figure 1, Model related with Earth>
Actually, a "Simulator" class which composites Earth class isn't exactly separated by Control. However, Earth contains "Cell" which manages information about cell and store. Due to this, above classes are responsible for Model's role in MVC concepts.
Data Base family models
Second Model Diagram is related with Data Base. Our Data base model has one interface. This interface provides that user don't know about implementation what we use. Actually, we use XML to store related information. It has several issues. Database is exactly fast to manage any information. However, we should consider that frame works heated planet don't care about how its information is store to storage.
<Figure 2, Model related with Database>
The reason is very simple that we didn't know what is the best to manage our information when we try to design. This is very common issues of software designs since OOP follows spiral software design process [1]. We resolve this problem through DB interface classes for decoupling about storage methods. Moreover we make sure high coherent about functionality.
Control Model
<Figure 3, Control family about simulators>
Control model is little complex because amount of configuration for simulator is grater than any projects. "Config" Class includes all configuration information to manipulate simulator, database, and thread controls. Some design views can think that it is Model's roles. However, it is clear evidence that all configurations are constant value and it is used to configuring each Controller's classes.
Presentation Diagram about Earth and Grid
<Figure 4, Presentation for Earth (and panels)>
"Runnable" interface is generalized by "ThreadPresentation" Class and "Combine Presentation" Class. Two kind of concrete class supports that display information managed by "EarthPannel". Due to this, other models can communicate through the "Runnable" interface. As you known, the reason is similar with Data-base model, but in this control diagram, "Runnable" interface' purpose is explicit to support either display via distributed or serialized. We need to look at "EartGridDisplay" class since it has relation with some another minor class. But their interface is important since "TemperatueGrid" class handles some class related with temperature. And "TemperatureColorPicker" class supports association about appropriate color to "EearthGidDisplay" Class.
<Figure 5, Presentation for EarthGridDisplay (and panels)>
Logical data model for the persistent data
<Figure 6, Logical model for the persistent data>
All persistent data are stored in the XML format. The PlanetSimDBManager class acts as interface for requests related to DB. XML files are handled by PlanetSimXMLReader, PlanetSimXMLWriter and PlanetSimFileManger classes.
Deployment diagrams (Physical architecture).
<Figure 6, Deployment diagram>
Control node includes a Simulator component which depends on configurations. Control node manipulates data flows and controls each instance of components between model and presentations. For example, display manager inquires about data which should be displayed to control classes not directly contact to model classes even if model classes has appropriate data[4]. This is the role of control nodes. Finally presentation is responsible for displaying about proceeded data. This node is generated by project 2, we reuse this via packages.
Postmortem
What we worked well with the design?
We deal with two kinds of major factor. One is how can we satisfy lots of new requirements efficiently. Another is how can we reuse our codes from project 2.
First, a crucial requirement is computation problems about the temperature on the earth. The reason that computations are important is that we should consider lots of newly introduced variable when a simulator computes the temperature. As was mentioned, we can satisfy functional requirements by selecting stored simulator. Moreover, by using XML format, we can manage size of data when our simulator stores computed data and take a more efficiently methods to store data.
In the reusing legacy code from the project 2, we make an effort to preserve maintainability and solve new requirements for project 3 without hurting legacy code by using object oriented mechanisms.
What didn't work well with the design?
We think that XML format's searching complexity is better than database. The reason is that we can decide directly access to data if we make a naming convention rules when data need to be stored and loaded. We know that database's manipulation time is O(nlogn) as well searching time is O(logn). Due to this, we try to resolve managing data through the XML. However, it is not correct. Because file system use a file control block which uses linked lists internally. Therefore, it needs more time for load even if we access directly to file object through the XML format. However, our simulator's I/O performance is reasonable since we manage a little data to store.
Reference
[1] Myougsoo Jung "Object Oriented Programming using C++", Vol 268, 2005. Microsoftware
[2] Myoungsoo Jung "Overloading, Dynamic binding mechanism and correct usage", Vol 283, 2007
[3] Wikipedia, "Model-view-controller". http://en.wikipedia.org/wiki/Model-view-controller, 16, April. 2009
[4] Sun microsystems, "An overview of the MVC Pattern from JAVA"
http://java.sun.com/blueprints/patterns/MVC.html, 16, April. 2009, 2002
'Memo > Work' 카테고리의 다른 글
| Heated Planet: Design Descriptions (0) | 2009/05/01 |
|---|---|
| DESIGN DESCRIPTION (0) | 2009/04/20 |
| Middleware (0) | 2009/04/18 |
| Architectural style (0) | 2009/04/04 |
| Paper survey and summary (0) | 2009/03/10 |
| Heated Plate Design Description (0) | 2009/03/04 |