Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [higgins-dev] Mapping at what level?

Tom,

Based on my experience writing and deploying virtual directory infrastructure (~ 2 years writing & deploying virtual directory infrastructure for octet string (now oracle) and ~ 2 dozen deployments) I found that any type of adapter should be self contained and be "ignorent" of anything beyond a mapping from the remote source (ldap, db ...). 

For instance I'll apply this idea to the JNDI CP:

1.  the name it gets can be mapped into a DN.  so for instance the JNDI CP assumes that the username is the rdn of a pre-defined DN structure.  This should always be the case.  If this is not the case a "higher level" cp should be responsible for making sure that this works.  For instance, lets say the username is an email address.  The higher level mapping would then get the users uid based on the email and pass the uid down to the JNDI cp.

2.  The JNDI CP only knows how to translate LDAP attributes to Higgins attributes.  There is a standard mapping (perhaps extensible).  Lets say there needs to be a composite attribute based on the givenName and sn (maybe not the best example for an LDAP CP, but better for a JDBC based CP).  The JNDI CP should not be responsible for generating this attribute because it doesn't know it exists in the remote resource.  The mapping CP would be responsible for
     A. making sure that all responses for the attribute are fulfilled
     B.  making sure that any request for the attribute are properly handled.  For instance a request for "cn" should actually be a request for givenName and sn.  The filter "(cn=Joe Smith)" should actually be "(&(givenName=Joe)(sn=Smith))"

Taking the above approach offers several advantages:
1.  CPs are easier to implement as they do not concern themselves with anything by the remote resource and mapping it back into the local context.
2.  Its easier to create a "library" of mappings that can be re-used across several CP implementations

As you mention above, integrating the mapping into the CP would cause a lot of headaches and requiring a _javascript_ based mapper could really hurt performance.  What if there was a common mapping utility library for simplistic 1-1 mappings that CP developers could utilize?  This way they don't have to code mapping management into their CP while still being able to keep it simple.

Marc

Back to the top