[ciapug] Returning a different object reference on construction

Jerry Heiselman jweida at gmail.com
Fri Apr 7 12:48:21 CDT 2006


I have been working on an Authentication class for a project and was wanting
to provide different authentication mechanisms.  Basically, I want someone
to be able to change their authentication scheme either on the fly or on a
per-user basis and was wondering how the best way to go about this may be.

What I've got so far is a generic Authenticator class that takes one
argument in the constructor of the type of authentication.  My plan was to
have it determine and automatically load the correct class for the
authentication type.  So I was going to have it return an object type of the
new authentication object type (i.e. LDAP, DB, or others), when I remembered
something about not being able to return anything back from the constructor
of an object in this language.

Have others tackled this task before and what means did you use.  I want my
code to only include the generic authenticator class, but want a more
specific object type returned.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cialug.org/pipermail/ciapug/attachments/20060407/f8a91601/attachment.htm


More information about the ciapug mailing list