[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: New KDE printing system
From:       Michael Goffioul <goffioul () imec ! be>
Date:       2001-02-28 13:14:53
[Download RAW message or body]

Harri Porten wrote:

> Hi !
>
> > 1) API
> > -----
> >
> > 1.1 KPrinterFactory class
> >
> > This class is used to create KPrinter object (see below). Developers shouldn't
> > construct directly KPrinter object, but use "KPrinterFactory::self()->printer()".
> > The factory takes care of the user settings and construct an object for the
> > appropriate underlying printing system. DO NOT delete the KPrinter object, as
> > it will be reused for other calls.
> >
> > 1.2 KPrinter class
>
> Tiny API suggestion:
>
> If the KPrinterFactory is only used to create a single KPrinter object,
> I'd rather hide the factory class and add the self() method to KPrinter.

Actually the factory is (will be) used to create other objects as well, like
job lister, printer manager, UI manager (those are objects defined in the
printing management tool I'm developing). Of course I could define a static
wrapper in KPrinter class like

static KPrinter* self()
{
    return KPrinterFactory::self()->printer();
}

to hide the factory object from the developer. Is this better ?

Michael.

--
------------------------------------------------------------------
Michael Goffioul                IMEC-DESICS-MIRA
e-mail: goffioul@imec.be        (Mixed-Signal and RF Applications)
Tel:    +32/16/28-8510          Kapeldreef, 75
Fax:    +32/16/28-1515          3001 HEVERLEE, BELGIUM
------------------------------------------------------------------

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic