Hi there,
I have a module located in an external location that multiple apps do/will utilise. Thanks Luis (and team) modules are fantastic for this purpose.
My question is how you can relate information from a parent entity to the module entity (or vice versa).
For eg. if I had a cart module that supplied the ability to put application specifc products into it, how would I link the Cart (from within the module) to the User (in the parent app)?
In my example the parent application(s) has their own datasource/schema
Is there a known pattern for this? anyone done anything similar?
Hope I’ve explained that well enough
Cheers
Steve
I can certainly try
Multiple applications that are required to run in their own schema however they share a good percentage of functionality.
I was hoping to move the common functionality into a module, which each application would reference via externalModulesLocation
However each application will need to relate to data stored for the module.
So as an example, imagine a survey module.
The module allows for the creation of surveys with questions - as well as displaying them and allowing responses.
Via the module each application will allow the creation of their own surveys.
Each application will allow their users to answer the surveys - storing the answers in the module data model
How do I construct the parent application OR indeed the survey module data model so that their is a (constrained) relationship between the parent application user and their survey module responses.
At this stage I can only see that I can have an un-constrained userID in the response table.
Ideally I suspect I would need to instantiate the survey module and inject a respondent object per application?? or am I waaay off track here?
Thanks for any and all assistance
Cheers
Steve
I’m not sure if I cleared anything up there… but I may have discovered a solution to my murky problem
Instead of having a foreign key relationship in the module (ie. in the SurveyReponse)
I can create an application specific UserSurveyResponse which will link the application specific User cfc with the module SurveyResponse cfc
I think this should get me enough.
Again, this is a case of writing it all down to explain it helping me come up with a solution.
Cheers