https://bugs.freedesktop.org/show_bug.cgi?id=74424

          Priority: medium
            Bug ID: 74424
          Assignee: [email protected]
           Summary: Start to decouple Window from OutputDevice
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: [email protected]
          Hardware: Other
            Status: UNCONFIRMED
           Version: Inherited From OOo
         Component: Libreoffice
           Product: LibreOffice

We want to start to decouple Window from OutputDevice. This is because a Window
should *use* an OutputDevice, a Window is *not* an OutputDevice. With such a
tight coupling of really unrelated classes it makes it hard to write unit
tests, extend the code and it violates the single responsibility principle.

In order to start to decouple the two classes, we need to change from
inheritance to composition. I propose that the strategy should be: 

1. Add in a new private member pOutputDevice as well as an accessor. When the
Window is initialized, pOutputDevice is set to a downcasted instance of this
(because we are still inheriting Window from OutputDevice). 

2. Start to go through all the functions in Window that rely on OutputDevice
and use the getter function to use the OutputDevice private member. 

3. Any subclasses of Window will then need to have the same procedure done on
them. 

4. Once this is done, we then need to work out the best way of initializing
mpOutputDevice, then we can remove OutputDevice as the parent class of Window
(and all Window subclasses).

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to