You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code behind these things is generally horrible "object-based" stuff that would greatly benefit from proper OOP. Here's a preliminary class diagram from yuml.me:
Source:
[View],
[Panel]-[note: No longer read from HTML constructed through DOM instead],
[View]^[Panel],
[Panel]^[ResizablePanel],
[Editor]-[note: Now responsible for setting up pretext based on the type of panel or overlay],
[View]^[Editor],
[Overlay],
[View]^[Overlay],
[Overlay]<->[Editor],
[PostPanel],
[PostPanel]<->[Editor],
[ResizablePanel]^[PostPanel],
[PostPanel]^[ReplyPanel],
[PostPanel]^[TopicPanel],
[PostPanel]^[EditPanel],
[PostPanel]^[PMPanel],
[QuickstatsPanel]
[Panel]^[QuickstatsPanel],
[ThreadPreviewPanel]
[Panel]^[ThreadPreviewPanel],
#
[Model],
[Manager],
[Model]^[Manager],
[Manager]^[PanelManager],
[PanelManager]-<0..n>[Panel],
[PostPanelManager]-<0..n>[PostPanel],
[ThreadPreviewPanelManager]-<0..n>[ThreadPreviewPanel],
[QuickstatsPanelManager]-<0..n>[QuickstatsPanel],
[PanelManager]^[PostPanelManager],
[PanelManager]^[ThreadPreviewPanelManager],
[PanelManager]^[QuickstatsPanelManager],
#
[Messenger],
[Model]^[Messenger],
[Messenger]^[ReplyMessenger],
[Messenger]^[TopicMessenger],
[Messenger]^[EditMessenger],
[Messenger]^[PMMessenger],
[PostPanel]++-[Messenger],
[ReplyPanel]++-[ReplyMessenger],
[TopicPanel]++-[TopicMessenger],
[EditPanel]++-[EditMessenger],
[PMPanel]++-[PMMessenger]
View, Model, and Manager would be something like what Distillery uses.
This should solve some big annoyances:
"Infopanels" used by Thread Preview and Quickstats would now share some implementation through the new Panel class, and would probably be a lot less assy.
Pretext would be handled by Editor, rather than being spread all over
Separate types of panels can handle their own implementation, rather than using stupid switch statements on a type property
Separate types of messengers can handle their own implementation, like above
PostPanels can use their Messenger as a model to get log messages from
PostPanels would no longer read HTML from disk - no disk access on Firefox, should be faster
Post metadata (thread ID, etc) can be held by the messenger, can default to stuff that makes sense (current URL)
The text was updated successfully, but these errors were encountered:
Instead of having the manager classes for views, it may be better to keep an array of all views in view.prototype. When view's constructor is called, push the new instance into the array. Something like:
Yes, I'm going with the self-tracking instances since I spent so much time getting them to work. Very pretty, you just subclass Trackable and then all instances of the subclass are tracked in subclass.prototype.instances. Instances property also holds all instances of subclasses.
The code behind these things is generally horrible "object-based" stuff that would greatly benefit from proper OOP. Here's a preliminary class diagram from yuml.me:
Source:
View, Model, and Manager would be something like what Distillery uses.
This should solve some big annoyances:
The text was updated successfully, but these errors were encountered: