Log classes consolidation #145
georgweiss
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The purpose of this discussion is to analyze and document differences in the set of Log data classes maintained in this project (phoebus-olog) and in the core-logbook module of the Phoebus project. Ultimately one would like to consolidate the code base in both projects to reduce the number of classes that all - more or less - define the same data.
An obvious difference is that this project defines concrete classes (Log, Attachment, Tag...) while core-logbook module defines the corresponding classes as interfaces and implementations of these. Since a refactoring/consolidation task would be to define a common set of data classes, one would maybe want to eliminate the interfaces and instead work with a set of concrete non-final classes.
Working from the bottom up, we have (class by class, field by field):
Attachment:
phoebus-olog: id, filename, fileMetadataDescription, attachment (InputStream)
core-logbook: id, owner, name, contentType, file (File), thumbnail (boolean)
Possible merge: id, filename, fileMetadataDescription. An InputStream and File should be managed case-by-case in client and server. Thumbnail, not used/needed?
Tag
phoebus-olog: name, state(enum State)
core-logbook: name, state (string)
Possible merge: maybe remove altogether if "state" is not used. The enclosing Log class could simply use a list of strings.
Property
phoebus-olog: name, owner, state (enum State), attributes (set of Attribute)
core-logbook: name, attributes (Map<String, String>)
Possible merge: name, attributes (Map<String, String>). owner and state unused (?). A Map class should be good enough for attributes.
Attribute
This is only used on the phoebus-olog side. Suggest to remove.
Logbook
phoebus-olog: name, owner, state (enum State)
core-logbook: name, owner
Possible merge: like Tag, maybe remove. Enclosing Log class could use string.
Event
This is only used on the phoebus-olog side. Suggest to remove.
Log(Entry)
phoebus-olog: id, owner, source, description, title, state (enum State), level, createdDate, modifyDate, events (List of Event), logbooks (list of Logbook), properties (Set of Property), attachments (Set of Attachment), tags (Set of Tag)
core-logbook: id, owner, source, description, title, logbooks (Collection of Logbook), tags (Collection of Tag), properties (Collection of Property), level, createdDate, modifiedDate, attachments (Collection of Attachment), version (int)
Possible merge: essentially the core-logbook version, with version removed.
Beta Was this translation helpful? Give feedback.
All reactions