Boost logo

Boost Users :

Subject: Re: [Boost-users] Abstract factory
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2008-12-13 11:47:54


----- Original Message -----
From: "Jason Felice" <jfelice_at_[hidden]>
To: <boost-users_at_[hidden]>
Sent: Saturday, December 13, 2008 4:03 PM
Subject: Re: [Boost-users] Abstract factory

Michiel Helvensteijn wrote:
>
> Why would you need a library solution to implement an abstract factory? The
> class structure of the AF pattern is highly dependent on your needs, but is
> rather simple to write. I can't think of any library solution that would
> make the job easier.

I don't have it in front of me, but in essence, "Modern C++ Design"
describes:

(1) a template that, when instantiated with a type list, provides a class
    with separate pure virtual methods for instantiating each type in the
    type list
(2) another template that provides a concrete implementation of (1) based
    on another type list

  (Note that the types in (2) are derived from the types in (1). The types
  in (1) are normally just abstract).

While it's not hard to code by hand, it is a lot of hand-written,
repetitive code. All of the dull, mind-numbing sort.

> Can you explain what it is you are looking for?

I don't have a particular problem to solve at the moment, I'm just a
chronic self-study. It's a class of problem I've worked with before.

Hi,

There were some post respect to the factory pattern recently in the user and developement ML.

Anyway, Tobias Schwinger's Boost.Functional/Factory library was accepted into
boost last year
(http://lists.boost.org/boost-announce/2007/12/0161.php),
http://www.boostpro.com/vault/index.php?&direction=0&order=&directory=X-Files

Here is a link to an article and code for another library some one has posted also recently
http://arcticinteractive.com/2008/10/06/boost-centric-factory-pattern-implementation/

Vicente


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net