stormpath-sdk-java icon indicating copy to clipboard operation
stormpath-sdk-java copied to clipboard

AccountStoreMapping interface is misleading as it cannot be instantiated

Open mrioan opened this issue 9 years ago • 2 comments

When we introduced Organizations our DefaultAccountStoreMapping disappeared. Now we have DefaultApplicationAccountStoreMapping and DefaultOrganizationAccountStoreMapping.

This causes the following code to fail: client.instantiate(AccountStoreMapping.class). It was working previously since we had a DefaultAccountStoreMapping but that is not the case any longer.

I did not do enough thinking about this but AccountStoreMapping extends Resource and it is in our API module. Options are:

  1. AccountStoreMapping should not be part of the public API any longer, or
  2. AccountStoreMapping should not extend Resource any longer
  3. Create a new DefaultAccountStoreMapping that throws and Exception and outputs a message explaining the user what to do
  4. Create a DefaultAccountStoreMapping which can somehow return the proper resource (i.e. either an ApplicationAccountStoreMapping or an OrganizationAccountStoreMapping

BTW, our documentation instruct users to do AccountStoreMapping accountStoreMapping = client.instantiate(AccountStoreMapping.class). See here: https://docs.stormpath.com/java/product-guide/#account-store-mappings

mrioan avatar Mar 15 '16 14:03 mrioan

Relates to https://github.com/stormpath/stormpath-sdk-java/issues/531

mrioan avatar Mar 15 '16 17:03 mrioan

This is still relevant... but the importance is really low as the reference in the documentation is no longer present (since we moved to the one product guide). I keep it open in case we decide to tackle it in the future.

mrioan avatar Oct 24 '16 21:10 mrioan