Thanks Joe. I've been playing around and doing a lot of reading and it seems like modules are indeed the best way to go for my situation. I still had to rewrite the core module to be self-refrencing (as I mentioned in my original post) but now that it's done it works as a standalone and as a module so I'm happy for now.
Thanks for your guidance! Mike On May 19, 2:52 pm, "Hayes, Joseph D. (JSC-IS)[TESSADA & ASSOC INC]" <[email protected]> wrote: > You should be able to accomplish this either way; however, if you did go with > the config file approach, I'd suggest that you still break out each logical > chunk of functionality into a separate config file, and just include them > into the base config. At this point, your structure begins to approximate > Mach-II modules, although modules do bring a few extra nice-to-haves to the > table. With what you described below though, it sounds like modules are > probably the way to go... modules are intended to segregate re-usable code, > and I believe are more self-contained. I guess it really depends on what you > are trying to accomplish as well as what the dependencies are among each of > the "chunks". > > There are probably a fair number of people on this list that would have > better insight on this though - our team has gone back and forth on this > issue ourselves. > > - Joe > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Mike > Sent: Wednesday, May 19, 2010 2:22 AM > To: Mach-II for CFML > Subject: [Mach-II] Re: How To Share Code Between Applications > > Splitting this conversation off into a slightly different branch, if > you were starting from scratch how would you setup a core application > to be shared across multiple different applications? What is the most > elegant and easy to maintain solution in Mach II? > > Am I on the right track with including the the mach-ii.xml config file > from the core application or should I be looking more closely at > modules? Or am I missing out on a better solution? > > Thanks, > Mike > > On May 18, 4:31 pm, Mike <[email protected]> wrote: > > Hi guys, > > > As the subject says, I'm looking for guidance on how to share a core > > codebase between applications. This looked > > promisinghttp://trac.mach-ii.com/machii/wiki/HowToShareCodeBetweenApplications > > (and so did the conversation here on google groups that spawned the > > entry) but it didn't get finished so I tried some stuff on my own and > > have run into roadblocks. I've searched and searched and have not > > been able to find any clear picture of how to accomplish exactly what > > I'm after, but I think it's a relatively common approach. > > > For reference I'm using Mach II 1.8. > > > I have a core application that runs on its own...let's call it > > CoreApp. Amongst other things, CoreApp handles all things "user": > > logins, roles, addresses, etc.. For the sake of simplicity, let's > > pretend that's all CoreApp does. > > > I now have another application - let's call it OtherApp - in which I > > would like to reuse the "user" functionality from CoreApp. So a user > > hitting OtherApp looking to login would actually use the logic defined > > in CoreApp. > > > What I thought would be the best way to accomplish this was to include > > my CoreApp mach-ii.xml file in my OtherApp mach-ii.xml file so my > > CoreApp listeners and events would be accessible. The immediate > > problem is that these applications are in different directories, and > > the dot.paths are relative to the webroot for the specific app (e.g. > > model.user.user exists in /root/CoreApp/model/user/ and that call > > works fine from within CoreApp itself, but loading it into OtherApp > > means that nothing can be found as it looks in /root/OtherApp/model/ > > user/ which doesn't exist). > > > I guess in the first instance, my question is: is there some simple > > property that I'm overlooking here that would allow me to make calls > > to my included CoreApp as if the objects were local to OtherApp from > > within OtherApp itself? What I mean is, can my call to CoreApp's > > model.user.user from within OtherApp automatically be mapped to > > CoreApp.model.user.user? > > > I suspect I can rejig my CoreApp to operate using absolute calls > > inside of itself (instead of model.user.user use > > CoreApp.model.user.user), but is that my only solution? > > > Any direct help you can provide would obviously be fantastic, but > > failing that if you have a link or two that you think would help > > please don't hesitate! Anything at all will be appreciated!! > > > Thanks, > > Mike > > > -- > > You received this message because you are subscribed to Mach-II for CFML > > list. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group > > athttp://groups.google.com/group/mach-ii-for-coldfusion?hl=en > > > ***New URLs as of April 29th, 2010*** > > SVN:http://svn.mach-ii.com/machii/ > > Wiki / Documentation / Tickets:http://trac.mach-ii.com/machii/ > > -- > You received this message because you are subscribed to Mach-II for CFML list. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group > athttp://groups.google.com/group/mach-ii-for-coldfusion?hl=en > > ***New URLs as of April 29th, 2010*** > SVN:http://svn.mach-ii.com/machii/ > Wiki / Documentation / Tickets:http://trac.mach-ii.com/machii/ > > -- > You received this message because you are subscribed to Mach-II for CFML list. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group > athttp://groups.google.com/group/mach-ii-for-coldfusion?hl=en > > ***New URLs as of April 29th, 2010*** > SVN:http://svn.mach-ii.com/machii/ > Wiki / Documentation / Tickets:http://trac.mach-ii.com/machii/ -- You received this message because you are subscribed to Mach-II for CFML list. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/mach-ii-for-coldfusion?hl=en ***New URLs as of April 29th, 2010*** SVN: http://svn.mach-ii.com/machii/ Wiki / Documentation / Tickets: http://trac.mach-ii.com/machii/
