¶
UML Class Diagram for communication platform
+ Chatter
Name
Id
Message
+ text: TextMessage or None
+ audio: AudioMessage or None
+ video: VideoMessage or None
+ attachment: AttachmentMessage or None
+ image: ImageMessage or None
+ emote: EmoteMessage or None
+ method(type): type
TextMessage
+ text: str
+ charLimit: int
+ hasReachCharLimit(): bool
AudioMessage
+ name: str
+ size: int
+ hasReachSizeLimit(): bool
VideoMessage
+ name: str
+ size: int
+ hasReachSizeLimit(): bool
AttachmentMessage
+ name: str
+ size: int
+ validTypeFiles: list
+ invalidTypeFiles: list
+ hasReachSizeLimit(): bool
+ isValidFileType(): bool
ImageMessage
+ name: str
+ size: int
+ hasReachSizeLimit(): bool
EmoteMessage
+ name: str
+ code: str
¶
Proposal
Create a separeate data structure for message attachments. Add more metadata in the datastructures.
Message
+ body: TextMessage
or EventMessage
+ author: Participant
+ source: Client
+ timestamp: int
+ method(type): type
TextMessage
+ body: str
+ charset: str
+ size: int
AudioAttachment
+ codec: str
+ duration: float
+ bitrate: int
+ streamable: bool
+ data: ?
VideoAttachment
+ video-codec: str
+ video-bitrate: int
+ framerate: int
+ audio-codec: str
+ audio-bitrate: int
+ streamable: bool
+ data: ?
FileAttachment
+ filetype: str
+ scanned: bool
+ data: ?
ImageAttachment
+ width: int
+ height: int
+ format: str
+ data: ?
Attachment
+ name: str
+ payload: AudioMessage
or VideoMessage
or FileAttachment
or ImageAttachment
or LinkAttachment
+ author: Participant
+ source: Client
+ timestamp: int
+ pinned: bool
+ size: int
+ expires: int
+ method(type): type
Conversation
+ name: str
+ description: str
+ avatar: Avatar or None
+ messages: List(Message) or None
+ attachments: List(Attachment) or None
+ participants: List(Participant) or None
+ owner: Participant
+ moderators: List(Participant) or None
+ policies: List(Policy) or None
+ method(type): type
Participant
LinkAttachment
+ url: str
+ thumbnail-url:
AttachmentPolicy
MessagePolicy
Policy
Client
ConversationPolicy
SecurityPolicy
RetentionPolicy
Avatar
EventMessage
+ eventcode: int
+ title: str
+ description: int
Account
MobileClient
WebClient
ServiceClient