ooo con 2007 pres

Upload: scribdmatti

Post on 03-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 Ooo Con 2007 Pres

    1/36

    1

    IMPROVING THEMODULARITY OFOPENOFFICE.ORG

    Mathias Bauer> Project Lead OpenOffice.org Writer

    Sun Microsystems Inc.

  • 7/29/2019 Ooo Con 2007 Pres

    2/36

    A popular myth (I)

    Everyone and Everything Participating on the Network

    OpenOffice.org is

    monolithic and loadseverything into memorywhen it is started.

  • 7/29/2019 Ooo Con 2007 Pres

    3/36

    The facts

    Though OOo does not load everything, it loads a lot> splitting up of libaries necessary

    > needs code refactoring

    Some data (OpenOffice.org 2.0.4 on Windows)> Full installation contains 309 libs, 102 MB

    > Startup without application uses 68 libs, 28 MB

    > Adding writer loads 21 libs more, 17 MB> http://wiki.services.openoffice.org/wiki/Architecture/Libraries

    Many libraries are loaded on demand (most of them beingUNO services)

    http://wiki.services.openoffice.org/wiki/Architecture/Librarieshttp://wiki.services.openoffice.org/wiki/Architecture/Libraries
  • 7/29/2019 Ooo Con 2007 Pres

    4/36

    Installation requirements

    Everyone and Everything Participating on the Network

    I want to install onlyWriter.

    User wants to save disk space

    User doesn't want to see elements of unwantedapplications in the user interface

  • 7/29/2019 Ooo Con 2007 Pres

    5/36

    Installation of single applications

    OpenOffice.org always supported the installation ofsingle applications from the complete installation set

    Due to the high code reuse in OpenOffice.org a lot

    of code is shared between the applications> Installation set in total is smaller

    > Application specific part is very small

    Installation size (OpenOffice.org 2.3, Windows),without PyUNO> Complete 279 MB

    > Writer only 246 MB

  • 7/29/2019 Ooo Con 2007 Pres

    6/36

    Reducing the necessary

    Make features optional> Should be restricted to larger blocks of functionality

    many small libraries will make the complete size bigger (disksize and run time memory consumption)

    too many options will make the setup confusing

    > New optional functionality should be implemented asUNO components or even extensions

    Split big libraries to avoid the taking one takes alleffect

    Needs package restructuring and code refactoring

  • 7/29/2019 Ooo Con 2007 Pres

    7/36

    Download requirements

    I want to download onlyWriter.

    Modularity already present in the installation set

    User wants to save bandwidth

  • 7/29/2019 Ooo Con 2007 Pres

    8/36

    Modular installation sets

    As shown for installations currently the gain is low> winning a few 10 MB per installation set does not justify

    multiplying the number of download sets by 3 or 4

    > extensions currently are the best approach

    Improvements need better packaging> avoids explosion of testing and build matrix

    > needs ability to download and install individual packages

    > needs redesign of packages> needs code refactoring

  • 7/29/2019 Ooo Con 2007 Pres

    9/36

    Development requirements

    Faster and easier builds> currently possible only using solver tar balls

    > build and install only packages that have been changed

    Code refactoring will be useful also for> better understanding the code

    > fewer dependencies between the parts

    > less side effects in code changes

    > smaller regression risk

    Creation of development packages

    Build language packs separately

  • 7/29/2019 Ooo Con 2007 Pres

    10/36

    Packaging requirement

    There should be more

    packages with less andclearer dependencies.

    Testing of packages

    Improve build performance

    Ease introduction of new functionality

  • 7/29/2019 Ooo Con 2007 Pres

    11/36

    Steps for an improved packaging

    Separate URE (Stephan Bergmann)

    Separate packages for non-code parts> help, templates, fonts, gallery content etc.

    > additional effort ongoing for branding stuff> better platform and localization packages

    Separate packages for application specific parts

    > done for the known parts looking for more Separate packages for features (components and

    well separated libraries)> not done to the possible extent, more to find

    > try to get more components and well separated libraries

  • 7/29/2019 Ooo Con 2007 Pres

    12/36

    Problems already found

    Risk for more effort in QA or RE

    Risk for more effort or confusion on download page

    Brand specific packages shouldn't contain code

    Language packs shouldn't contain fonts and code

    Many of our libraries can't be separated reasonably> libraries not designed with package idea in mind

    > many cross depencies> library design and code refactoring needed

  • 7/29/2019 Ooo Con 2007 Pres

    13/36

    Conclusion

    Whatever meaning ofmodularity you use

    improving it will not bepossible without a package

    and library redesign andrefactoring of a large part ofthe code base.

  • 7/29/2019 Ooo Con 2007 Pres

    14/36

    A popular myth (II)

    Everyone and Everything Participating on the Network

    The maintenance

    problems ofOpenOffice.org can beseen from the inter-module dependencies.

  • 7/29/2019 Ooo Con 2007 Pres

    15/36

    accessibility

    afms

    agg

    animations

    autodoc

    automationavmedia

    basctl

    basebmp

    basegfx

    basic

    bean

    beanshell

    berkeleydb

    binfilter

    bitstream_vera_fontsboost

    bridges

    canvas

    chart2

    cli_ure

    codemaker

    comphelper

    configmgr

    connectivity

    cosv

    cppcanvas

    cppu

    cppuhelper

    cpputools

    crashrep

    curl

    dbaccess desktopdictionaries

    dtrans

    embeddedobj

    embedserv

    epm

    eventattacher

    expat

    extensions

    external

    extras

    fileaccess

    filter

    fondu

    forms

    fpickerframework

    freetype

    goodies

    helpcontent2

    hsqldb

    hwpfilter

    i18npool

    i18nutil

    icu

    idl

    idlc

    instsetoo_native

    iojavaunohelper

    jpeg

    jurt

    jut

    jvmaccess

    jvmfwk

    libegg

    libtextcat

    libwpd

    libxml2

    libxmlseclibxslt

    lingucomponent

    linguistic

    MathMLDTD

    moz

    msfontextract

    nas

    neon

    np_sdk

    o3tl

    odk

    offapi

    officecfg

    offuh oovbaapi

    package

    padmin

    portaudio

    postprocess

    psprint

    psprint_config

    python

    pyuno

    qadevOOo

    rdbmaker

    readlicense_oo

    regexp

    registry

    remotebridges

    rhino

    ridljar

    rsc

    sal

    salhelper

    sandbox

    sane

    sax

    sc

    scaddins

    scp2

    scripting

    sd

    sdk_oo

    setup_native

    sfx2

    shell

    sj2

    slideshow

    smoketestoo_native

    sndfile

    so3

    solenv

    soltools

    sot

    starmath

    stlport

    stoc

    store

    svtools

    svx

    sw

    sysui

    testshl2

    testtools

    toolkit

    tools

    transex3

    twain

    ucb

    ucbhelper

    udkapi

    udm

    unixODBC

    UnoControls

    unodevtools

    unoil

    unotoolsunoxml

    ure

    uui

    vcl

    vigra

    vos

    wizards

    writerperfect

    x11_extensions

    xalan

    xmerge

    xml2cmp

    xmlhelp

    xmloff

    xmlscript

    xmlsecurity

    zlib

  • 7/29/2019 Ooo Con 2007 Pres

    16/36

    Critical review

    Everyone and Everything Participating on the Network

    Dependencies show up at built-time, not at run-time> dependencies to build tools are irrelevant

    > non-code parts should be removed from the picture

    Experience shows that language binding relatedmodules are unproblematic (->URE)

    Quality of dependencies is not visible> stable interfaces are less problematic

    > only a few libraries at the top of the diagram areresponsible for most of the maintenance problems

    > large libraries also create large problems with innerdependencies that are not visible in the diagram

    > only the code tells the whole truth

  • 7/29/2019 Ooo Con 2007 Pres

    17/36

    agg

    animations

    avmedia

    basctl

    basebmp

    basegfx

    basic

    beanshell

    berkeleydb

    binfilter

    boost

    canvas

    chart2

    comphelper

    configmgr

    connectivity

    cppcanvas

    cppu

    cppuhelper

    cpputools

    curl

    dbaccessdesktop

    dtrans

    embeddedobj

    embedserv

    eventattacher

    expat

    extensions

    external

    fileaccess

    filter forms

    fpickerframework

    freetype

    goodies

    hsqldb

    hwpfilter

    i18npool

    i18nutil

    icu

    jpeg

    libegg

    libwpd

    libxml2

    libxmlseclibxslt

    lingucomponent

    linguistic

    moz

    nas

    neon

    np_sdk

    o3tl

    oovbaapi

    package

    portaudio

    psprint

    regexp

    registry

    rhino

    rsc

    sal

    salhelper

    sandbox

    sane

    sax

    sc

    scaddins

    scripting

    sd

    setup_native

    sfx2

    shell

    sj2

    slideshow

    sndfile

    so3

    soltools

    sot

    starmath

    stlport

    stoc

    store

    svtools

    svx

    sw

    sysui

    toolkit

    tools

    twain

    ucb

    ucbhelper

    unixODBC

    UnoControls

    unoil

    unotoolsunoxml

    uui

    vcl

    vigra

    vos

    writerperfect

    x11_extensionsxalan

    xmerge

    xml2cmp

    xmlhelp

    xmloff

    xmlscript

    XmlSearch

    xmlsecurity

    xt

    zlib

  • 7/29/2019 Ooo Con 2007 Pres

    18/36

    Writer dependencies

    avmedia

    basebmp

    basegfx

    basic

    boost

    comphelper

    configmgr

    connectivity

    cppu

    cppuhelper

    cpputools

    expat external

    fileaccess

    framework

    freetype

    goodies

    hsqldb

    i18npool

    i18nutil

    icu

    jpeg

    libegg

    libwpd

    linguistic

    moz

    nas

    o3tl

    portaudio

    psprint

    regexp

    rsc

    sal

    salhelper

    sandbox

    sax

    setup_native

    sfx2

    shell

    sj2

    sndfile

    so3

    soltools

    sot

    stlport

    stoc

    svtools

    svx

    sw

    toolkit

    tools

    ucbhelper

    unixODBC

    unoil unotools

    uui

    vcl

    vigravos

    writerperfect

    x11_extensions

    xml2cmp

    xmloff

    xmlscript

    zlib

  • 7/29/2019 Ooo Con 2007 Pres

    19/36

    StarOffice development in 1994

    Platform independent development: StarView> Windows, Mac, OS/2 (later: Linux, HPUX et al.)

    Low resources

    > Intel 486> 4 MB RAM (remember the times of Soft RAM?)

    Windows 3.x (16 Bit system)

    > OLE technology need to run 2 or more applications in parallel needed own replacement for non-Windows platforms

    > Shared libraries with common data segment static data must be put into executables

  • 7/29/2019 Ooo Con 2007 Pres

    20/36

    Resulting legacies

    Platform specific code only in dedicated libraries Minimize memory consumption for OLE

    > maximize code reuse in shared class libraries

    > create application framework on top of StarView (SFX)following the Template pattern

    > build persistence model based on OLE storage

    Dominant influence of StarView and SFX

    > all global objects referenced through Application class> framework provided base classes for nearly everything

    (Application, documents, views, dialogs etc.)

    > extensive use of (multiple) implementation inheritance

    > hierarchical class library organisation

  • 7/29/2019 Ooo Con 2007 Pres

    21/36

    Framework Architecture

    Load Environment

    Filter Mgmnt.

    DocumentMgmnt.

    TypeDetection

    WindowMgmnt.

    Embedding

    AutoSave/Reco

    very

    StorageMgmnt.

    CUI GUI C++UNO

    UNOConfigVCLUCB

    GenericUI

  • 7/29/2019 Ooo Con 2007 Pres

    22/36

    Framework refactoring: strategy

    Reimplementation outside of SFX library> SFX became collection of service wrappers for

    application code

    > not part of global infrastructure any more

    > SFX shall not be loaded on startup

    Implement as UNO services as much as possible> Exchangeable components

    > Extendable (even by non C++-components)> Move optional parts into own libraries (e.g.Embedding)

  • 7/29/2019 Ooo Con 2007 Pres

    23/36

    Framework refactoring: done

    Type and filter configuration

    Load environment

    Autosave/Recovery

    Embedding (OLE2 in and out, OOo)

    Document and Window management

    Storage access

    Menubar, toolbars, statusbar and controls

    Dialog factories (move code of dialogs into ownlibraries for common, sw, sc, sd)

  • 7/29/2019 Ooo Con 2007 Pres

    24/36

    Framework refactoring: to do

    Move last UNO services from SFX> GlobalEventBroadcaster

    > GlobalAppDispatcher

    >Generic FrameLoader

    Move dialog configuration from SFX

    Reimplement docking windows as a UNO service

    Library redesign

  • 7/29/2019 Ooo Con 2007 Pres

    25/36

    Application Environment

  • 7/29/2019 Ooo Con 2007 Pres

    26/36

    So what do we need?

    Better separation of model, view and controller (UI)> at least on build level

    > perhaps even on library or package level

    More UNO components and services Library redesign

    > library design should follow the architecture

    > group classes more meaningfull

    > avoid too big and too small libraries

    Smaller interfaces> less exported symbols

    > much less use of implementation inheritance

  • 7/29/2019 Ooo Con 2007 Pres

    27/36

    Vision of the Writer architecture

    Writer Vie

    w

    Model

    paragraphparagraph

    root

    pagepagepage

    ST

    ES

    E

    GU

    I

    Filte

    rs

    Config VCL FWK

    UNO

    ODF

    GUI

    DO

    C

    OD

    T

    HTM

    L

    SXW

    ...

    Drawing Layer

  • 7/29/2019 Ooo Con 2007 Pres

    28/36

    Modularity problems in Writer

    Model representation based on SFX> not separated from persistence code

    > not separated from API implementation

    > coupled with other parts represented in SFX> needs preliminary work in SFX before

    No clear separation between core, layout and UI,not even on build level

    Not all filters are separated from the core

    Monolithic Drawing Layer

    Huge C++ class interfaces

  • 7/29/2019 Ooo Con 2007 Pres

    29/36

    What are we doing?

    Filter work> legacy filters moved to binfilter module, will become a

    separate package (done already)

    > only living filters stay in the module (html, text, Word)

    > new filters are developed as UNO components> Word import filter will be converted to UNO component

    Started refactoring in SFX

    > separate API and GUI code for storing documents> separate model API implementation from SFX code

    > make DocumentInfo a real UNO service

    Library redesign (svx, sfx, svtools, etc.) http://wiki.services.openoffice.org/wiki/Global_Library_Redesign

    http://wiki.services.openoffice.org/wiki/Global_Library_Redesignhttp://wiki.services.openoffice.org/wiki/Global_Library_Redesign
  • 7/29/2019 Ooo Con 2007 Pres

    30/36

    Library redesign: svx

    Real all purpose library accessibility

    customshapes

    edit engine / outliner

    forms support

    gallery

    items

    toolbar, menu and statusbar controllers

    code for binary ms filters

    some items, dialogs etc.

    drawing layer

    etc. etc.

  • 7/29/2019 Ooo Con 2007 Pres

    31/36

    Refactoring in SFX

    DocumentInfo> real UNO service, can be used autonomously

    > component also usable for filters (e.g. doc/docx import)

    Separate model API implementation from SFX code> remove all SFX code from code that implements API

    > move code into helper classes with low dependencies

    > encapsulate GUI code

    Continue in Writer code

  • 7/29/2019 Ooo Con 2007 Pres

    32/36

    Ongoing Writer refactoring

    http://wiki.services.openoffice.org/wiki/Writer/ToDo/Writer_Refactoring/Writer_Refactoring From fat classes to smaller interfaces

    > Andreas Martens

    > first step for class SwDoc

    15 interfaces identified Includes of doc.hxx from 408 down to 368

    > to be continued

    Remove acces to layout and view from Writer core> big problem: Drawing Layer

    Separate core/view from controller> builds upon SFX refactoring

    http://wiki.services.openoffice.org/wiki/Writer/ToDo/Writer_Refactoring/Writer_Refactoringhttp://wiki.services.openoffice.org/wiki/Writer/ToDo/Writer_Refactoring/Writer_Refactoring
  • 7/29/2019 Ooo Con 2007 Pres

    33/36

    Drawing Layer

    T

    opLayer

    MidLayer

    Writer

    Calc

    Impress

    Base

    IDE

    Math

    W

    izards

    XML

    BASIC

    Utilities

    i18n

    Framework

    VCL

    GUI

    UNOCUIGUI

    UNO

    CUI UNO FWK System

    Integ

    ration

    ODF

    Common GUI

    Drawing Layer

    Help

  • 7/29/2019 Ooo Con 2007 Pres

    34/36

    Drawing Layer work

    Problems wrt. modularity> Model and view basically in one object

    > deep inheritance and usage of concrete instances, withapp framework, control layer, and VCL

    Ongoing work> Thorsten Behrens and Armin Le Grand

    > See Moving OOo to XCanvas on

    http://marketing.openoffice.org/ooocon2006/schedule/wednesday.html> Biggest problem: Drawing Layer has many clients

    http://marketing.openoffice.org/ooocon2006/schedule/wednesday.htmlhttp://marketing.openoffice.org/ooocon2006/schedule/wednesday.htmlhttp://marketing.openoffice.org/ooocon2006/schedule/wednesday.html
  • 7/29/2019 Ooo Con 2007 Pres

    35/36

    Q & A

  • 7/29/2019 Ooo Con 2007 Pres

    36/36

    Improving themodularity ofOpenOffice.org

    Mathias Bauer> [email protected]