School of Information Technology and Mathematical Sciences
Revision 0, 2018-10-06
COMP 3023 Software Development with C++ Group Project—Amendment Networked Asset Manager
Introduction
This document is an amendment to the Networked Asset Manager Group Project in response to the issues around group organisation. Each group may choose to continue the Group Project with the alterations described in this document—you will need to refer to the original specification for the bulk of the requirements. Alternatively, your group may disband and each student may work on the Individual project instead. The specification of the Individual project has been released alongside this document.
If any parts of this specification appear unclear, please ensure you seek clarification.
Networking
There is no need to complete a networking component for the Group Project. That is, the following sections (and their subsections) of the original document can be disregarded:
• Networking • Messages
Therefore, the following classes do not have to be implemented nor included in the design (UML diagram) and any existing version of them can be ignored or deleted:
• NetworkedAssetRegister • NetworkManager
• MessageFactory
• PlainTextMessageFactory • Message
• RequestMessage • ResponseMessage
Storing Assets to File
In lieu of the networking component, the Asset Manager must be able to store its database of Assets, AssetTypes, Custodians, and MaintenanceRecords to file when the application closes and load the file at application start-up. The file format will be a simple, plain-text format (described below) and all entities will be stored in a single file. To ensure correct resolution of dependent entities, the entities must be stored in the following order:
• Custodians
• AssetTypes
• Assets
• MaintenanceRecords
COMP 3023 Software Development with C++ – Assignment SP5 2018
Page 1 of 4
GUI Changes
The Login Screen must contain a field to specify the file to load. The user must be able to select the file location through a File selection dialog. After the singleton AssetRegister instance has been retrieved, the specified file will be loaded into the register.
When the application is closed, the user must be prompted (Yes/No) to save the database. If the user selects ‘Yes’ a File selection dialog will be displayed for the user to select the location and name of the file.
Optional: the file from which the entities were loaded may be kept in memory to facilitate quick saving (i.e., set the initial value of the File selection dialog) to the same file at application close.
Optional: the user may be able to periodically save the stored entities to file without exiting the application. File Format
The following describes the data format of the offline storage file. It requires that the objects be serialised into a plain-text format and be deserialised on application load. You must determine an appropriate method of serialisation and deserialization: for example, you may use QTextStream and overloaded input/output operators (>> and <<, respectively) to read and write entities from/to text and subsequently converted into a QByteArray (see QString::toUtf8()) for consistent storage. Note: if you take this approach you will need to overload the operators for QTextStream not std::istream/std::ostream; there are some differences between them and the manipulators they support, so you will need to read the relevant documentation.
The output file will contain one entity per line. Each line will be structured as a list of fields separated by pipe ‘|’ symbols. To protect against additional pipe symbols breaking the format, fields that contain user-entered text must be encoded using URL percent encoding, which is an encoding style used by URLs that encode unfriendly characters using a percent ‘%’ sign followed by a pair of hex digits. Refer to QByteArray::toPercentEncoding() and QByteArray::fromPercentEncoding().
The following sections describe the format for each type of stored entity.
Custodian
The data format for serialising Custodian objects is as follows (ignore line breaks in the specification, serialisation is one entity per line):
Custodian|<id>|<lastEditedBy:%>|<lastEditTime:iso8601>|<name:%>|<department>|<phoneNumber>
Where fields in angle brackets denote attributes of Custodian, with special instructions included after a colon ‘:’. For example, <name:%> indicates that the name attribute should be percent encoded and written in that position. The instruction, ‘iso8601’ instruction for date/time data fields indicates it should be serialised in ISO 8601 format (see QDateTime::toString and QDateTime::fromString).
For example, an instance of Custodian may be serialised as:
Custodian|cust001|matt|2018-09-14T00:00:00+09:30|Johnny|Maintenance|0880001111
AssetType
The data format for serialising AssetType is more complex as it needs to serialise the UserPropertyDefinitions. The format is as follows (ignore line breaks in format definition, serialisation is one entity per line):
Revision 0, 2018-10-06
AssetType|<id>|<lastEditedBy:%>|<lastEditTime:iso8601>|<name:%>|<propertyDefinitions.size>[| <propertyDefinitions:separated by ‘|’>]
COMP 3023 Software Development with C++ – Assignment SP5 2018 Page 2 of 4
If propertyDefinitions.size() is zero (‘0’), no UserPropertyDefinitions will be output and there will be no trailing pipe ‘|’ symbol.
Each UserPropertyDefinition in propertyDefinitions is serialised as:
Where <precision> is the precision (number of decimal places) of a double and is only present if the type is ‘double’ (the square brackets indicate that the entire field is optional and should only be present if a precision value is specified), <min validator> is the value of the minimum value validator if present (otherwise empty), <max validator> is the value of the maximum value validator, and <enum validator> is a colon separated list of the enumeration values (percent encoded). For example,
Note: When percent encoding the enumeration values, do not percent encode the colon separators. This allows the values themselves to contain colons (as they will be percent encoded) while maintaining the separator (which will not be encoded).
Asset
The data format for Assets is as follows (ignore line breaks in the specification, serialisation is one entity per line):
If properties.size() is zero (‘0’), no UserProperty will be output and there will be no trailing pipe ‘|’ symbol. Each UserProperty is serialised as:
<name:%>=<value:%>
Each UserProperty can be reconciled against their definition through name-based look-up on the AssetType. For example,
Note: %27 is an apostrophe ‘ character
Note: the blank line separates two distinct entities for readability, it should not occur in an output file.
MaintenanceRecord
MaintenanceRecords are serialised as follows (ignore line breaks in the specification, serialisation is one entity per line):
Revision 0, 2018-10-06
<name:%>|<type: ‘int’, ‘double’, ‘string’>[|precision=<precision>]|
<default value:%>|min=<min validator>,max=<max validator>,enum=<enum validator>
AssetType|type001|matt|2018-09-14T00:00:00+09:30|Pump|0 AssetType|type002|matt|2018-09-14T00:00:00+09:30|Fan|1|flow|double|0|min=,max=,enum=1.0:2.5 AssetType|type003|matt|2018-09-14T00:00:00+09:30|Pipe|1|flow|double|precision=2|0|min=,max=,enum=
Asset|<id>|<lastEditedBy:%>|<lastEditTime:iso8601>|<type.id>|<serialNo:%>|<brand:%>| <model:%>|<purchasePrice>|<purchaseDate:iso8601>|[disposalDate:iso8601]|<custodian.id>| <properties.size>[|<properties:separated by ‘|’>]
Asset|asset001|matt|2018-09-14T00:00:00+09:30|type002|x23-zz0|ACME Co.|x23series|100.22|2018-09-14T00:00:00+09:30||cust001|1|flow=2.5
Asset|asset002|matt|2018-09-14T00:00:00+09:30|type001|P-101|Pumps%27R%27Us||50.00|2018-09- 14T00:00:00+09:30|2018-09-15T00:00:00+09:30|cust001|0
MaintenancRecord|<id>|<lastEditedBy:%>|<lastEditTime:iso8601>|<owner.id>|<timestamp:iso8601> |<performedBy:%>|<maintenanceType>
COMP 3023 Software Development with C++ – Assignment SP5 2018 Page 3 of 4
For example:
MaintenanceRecord|rec001|matt|2018-09-14T00:00:00+09:30|asset001|2018-09- 20T00:00:00+09:30|maintenance guy 01|Inspection
Submission Details
You must submit a single ZIP archive file containing the following:
- UML diagram (in PDF or PNG format)
- Your Qt Creator project folder including all source files required to compile and run your application, your
Doxygen config file, and the version control directory (i.e., the ‘.git’ folder)
- Evidence of group collaboration, for example, some screenshots of your issue tracker and project
management tool
- Text file named ‘group_members.txt’ containing the name of the group and the list of group members
(names and student IDs).
The submitted ZIP file must not include any generated files, such as object files and executables, or extraneous files, such as the ‘*.pro.user’ file.
Once you have created the zip file according to the specifications, you are required to upload it to the Assessment Item 3: Project submission via LearnOnline. The deadline for submission is 2 November 2018 11:59 PM. After which time the submission will be considered late and attract a penalty as detailed in the course outline.
Only one submission of the ZIP file is required per group. Please organise ahead of time who will be responsible for submitting the project to ensure there are no accidental late submissions. All other group members (i.e., those who do not submit the main ZIP archive file) must submit a text file or Word Document containing the name of the group and the name of the student who is responsible for uploading the ZIP file. This will be used to ensure all students receive the correct mark, so please ensure these instructions are followed.
COMP 3023 Software Development with C++ – Assignment SP5 2018 Page 4 of 4
Revision 0, 2018-10-06