On 05/25/2011 12:28 AM, Endi Sukma Dewata wrote:

10. The code assumes that the primary keys will be specified as command
    arguments, which we know doesn't match the API for automount keys.
    Suppose we decide not to change the API, there should be a way to
    invoke the current API without writing one-off code in the common
    code. I think this can be done by defining a generic finder method
    for all entities, then override this method in the subclass for
    automount keys. What do you think?



In general I am in favor of it. I think that we'll need to do something along this line for future prijects anyway. There are going to be two degrees of customization required:

1. Defining how to do a finder for different RPC approaches. We do JSON RPC, but for a different project that does things with a REST API we'll have to customize the URL used.

2. WIth in a given project we'll need to be able to customize how a specific entity is found if it varies from the norm for that project.


This is an implementation of the strategy pattern. So we'll have, by default IPA.entity_finders.nested_key, and for automountkeys we'll have a hybrid /nested_keys + parameter finder.




_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to