User:Linda Pettigrew:Design Study2
m |
|||
Line 54: | Line 54: | ||
=====FileEventLoader - Decorator Pattern===== | =====FileEventLoader - Decorator Pattern===== | ||
− | The collection tool currently uploads zipped xml files to a server. To analyse these zipped files they need to be unzipped. This behaviour would be necessary for the analysis of log file stored in other file formats too (for example tab delimited files) so the functionality for | + | The collection tool currently uploads zipped xml files to a server. To analyse these zipped files they need to be unzipped. This behaviour would be necessary for the analysis of log file stored in other file formats too (for example tab delimited files) so the functionality for extraction is provided as a decorator. |
Decorator pattern components: | Decorator pattern components: |
Revision as of 00:54, 28 September 2010
Navigation shortcuts: Wiki users:Linda Pettigrew
Contents |
An Analysis Tool for Log Files
This project looks at the design decisions made during the development of a tool to extract data from XML log files.
Background
A tool has been developed to collect event-driven data from developers while they are using eclipse. The data collected contains details about the event which has occurred such as the number of charcters added during an edit, the time of the edit and the file the edit occurred on. An example of the data collected is shown in figure 1.
This project focusses on developing a tool to extract meaningful summary data from these logs.
Design Study
Requirements
The tool needs to generate a meaningful model of a user's session before analysing data collected from a user. This will involve:
- Initial trials of the collection tool stored data in a database. There may be a need to analyse this data in the future.
- Extracting zip files of events.
- Loading events from an xml file.
- Creation of a meaningful structure.
- Combining information in two or more events into a single action.
Information will then be gathered from the model of a user.
- Measurements may be time related such as number of events per 20 minute block or they may be simply counting events - different types of measurement need to be written to different files.
- More measurements will be made at a later date. It must be simple to add a new measurement.
- Measurements will need to be able to be written to both xml and csv files.
Constraints
Initial Design
UML Diagram
Description of Classes
Event Loader - Strategy Pattern
Data collected from eclipse has been logged in a number of different ways (xml log file and to a database in the releases to date). Since the method of logging the data affects how the events will be loaded the strategy design pattern has been used for construction of a list of events.
Strategy pattern components:
- Context =>
- Strategy => EventLoader
- AlgorithmInterface() => LoadEvents()
- ConcreteStrategies => DBEventLoader, XMLEventLoader, ZipFileEventLoader
FileEventLoader - Decorator Pattern
The collection tool currently uploads zipped xml files to a server. To analyse these zipped files they need to be unzipped. This behaviour would be necessary for the analysis of log file stored in other file formats too (for example tab delimited files) so the functionality for extraction is provided as a decorator.
Decorator pattern components:
- Component => FileEventLoader
- Operation() => LoadEvents()
- ConcreteDecorator => ZipFileEventLoader
- ConcreteComponent => XMLEventLoader
- AddedBehavior() => ExtractXMLFile()