AP_ImpFactory (was Re: Commit: autoconf and new import/export framework)


Subject: AP_ImpFactory (was Re: Commit: autoconf and new import/export framework)
From: Paul Rohr (paul@abisource.com)
Date: Thu May 03 2001 - 13:11:37 CDT


At 12:51 PM 5/3/01 -0500, Sam TH wrote:
>Ok, here's what I want:
>
>1. ie_exp.cpp should move to af/xap/xp
>2. That means ie_exp.cpp can no longer include ie_exp_DocBook.h
>
>So, it looks like, since we don't have an AP_App class that's XP, we
>need to put the register*() calls in the per-platform App classes.
>
>Would that mean the init() calls have do go away as well? Or move?
>Or what?

Gack. Just because there's no AP_App class doesn't mean you can't have an
XP implementation to do the job:

  AP_ImpFactory
  AP_ExpFactory

We use this pattern all the time in the current code, but I forget the
details on the instantiation sequence needed. In some cases, the linker can
find the current app's implementation from XAP code. In others (depending
on which class data the Factory needs access to, IIRC), you might need to
update each AP_<os>App to bootstrap the process.

However, in either case, the app-specific factory details could easily be
maintained in XP code. [1]

Paul

[1] If anyone knows of a reason why we'd want to vary the mix of impexps on
a platform-by-platform basis, then more factoring would be needed here.
However, discovery-based dynamic loading may just solve that problem for us.



This archive was generated by hypermail 2b25 : Sat May 26 2001 - 03:51:01 CDT