Hi,
I’m writing this message because I’m a bit lost:
I’m developing an application with a frontend and a backend. I have adopted an architecture separating my workspace between frontend, backend and common folders (similar to the YiiBoilerPlate architecture).
Now I want some User features (login, etc) on both backend and frontend, but obviously separated modules since backend users and frontend users aren’t the same. I adapted the yii-user module to my architecture, and it works like a charm.
Now the tricky part. Actually the frontend users and the backend users are not totally independent, meaning, the Backend User table and the Frontend User table are somehow related via relations in Active Record Model. Then I have absolutely no idea on how to make everything work together.
Here are some of the options I thought about:
1/ I can rename one module/use namespace, to avoid name conflicts, but then I have to load, for example, the frontend user module into my backend application, when all I care about is a couple of Active Record Model for my relations.
2/ I can put both modules into my common/modules folder (and obviously rename one so they are not the same), but then I guess that even on my backend I could have access to the controller/view of the frontend user module. Which I don’t want.
3/ I could make some annoying ajustments, like put my active record models in my common/models folder, so that all the models are always autoloaded, both on backend and frontend. And put the rest in backend or frontend modules folder. But then, I have to rewrite the models since they use classes that are defined in the module (like UserModule, to begin with). And this is basically losing all the advantage of using a model.
I really don’t know. How people handle it? When you have a backend and frontend User features and that somehow the two of them are not totally decorellated …
I’m getting crazy … Thanks a lot for your help.