Extend user data and not conflict with other extensions?


#1

I would like to extend the user data in a way that would not conflict/require any other sprinkles. Here is what I mean for example:

  1. I install the extend-user example sprinkle and add some more fields to it; call them A and B. My sprinkle is called UserWithAB
  2. Someone else creates their own extension based on the extend-user example – adds fields C and D. Their sprinkle is called UserWithCD

Is it possible to write these sprinkles so a user can install them both to get all A,B,C, and D functionality and yet also allow them to install just UserWithAB or UserWithCD if they only want one of them?

Thanks in advance for any insight. I’m not seeing how to do that right now — it looks like the extension process requires you to extend one sprinkle explicitly and if it is not there then does not work.


#2

It depends. I believe it can be done using third sprinkle. If you have UserWithCustomFields, UserWithAB and UserWithCD can both send their field definitions to UserWithCustomFields, who manage the user class. Then you can also add UserWithEF.

You can check out my sprinkle regarding this : https://github.com/lcharette/UF_UserProfile


#3

Thanks @Malou