Well it's nice to know that (a) someone reads what I write, and also (b) someone also feels my pain. :o)
I've been writing some stuff I want to eventually release as open source, but I can't decide how to package it (in fact I was going to post about another way of doing it - outlining the usage of the ServiceFactory to create mappings at runtime). The options that you have outlined - I'll add a couple to it as well, and put my thoughts to each of them. _ Use slashes instead of dots and stay with one OS? _ This is KIND of nice, but the restriction to one OS is only good if you know you are going to stay on one platform. Also, you can only go DOWN the directory tree structure, which leads to some very off packaging (and generally all of your main classes in one folder anyway). _ Put all the components in a single directory? _ This is the easiest to port, and can manage typing easily. However, with any number of CFCs this can become very unwieldy, and it is possible to want to have 2 CFCs of the same name. It does solve typing and extension issues however. _ Don't use typing? _ This IS one option. Either by using any or by using web-inf.cftags.component (to ensure it stays a component). Technically CF only checks for things at runtime anyway, so if it throws an error, because you've passed the wrong type of CFC you will find it at the same time as you would normally. I happen to shy away from this whenever I can (although, I do use it when i have no choice), simply due to more of a documentation standpoint. I have a terrible memory, and looking at the type of an argument immediately reminds me what I should be doing. _ Use a root level directory in your domain _ This is probably one of the most ideal of solutions, do to it's flexibility, however, when you don't have access to the root of the domain, or plan to host several different applications on the same domain, but different sub directories, it can cause to be a severe issue (think corporate intranet). Also means you have to setup your dev box to run multiple instances of CF so you can have multiple apps NOT on sub directories, but different ports, so you can mimic this. I hate having to remember 6145 is my Calender app, but 6146 is my ERP application.. _ Use the ServiceFactory to create your own mapping _ This one I was thinking was going to be the saviour of mapping-king for a long time, but I hit some walls with this as well. The thought was I would create a MappingManager cfc that was invoked by the Factory when it was created - it would check for a namespace (usually com.compoundtheory.something) and if not there, it would create it. As long as the factory was instantiated relatively, every piece of code under it could be typed by the mapping that is defined in the Factory. This is a fantastic idea if you are writing personal code. Obviously, if you plan to distribute the code in any format (product, open source etc) this isn't going to work due to the server wide availability of a mapping, and people's propensity to edit code (and version changes!). Often it's a composite version of these ideas that I tend to run with... but I'm actually stuck once again on which I think is the "best" one for application specific deployment (which I agree with you on Nando - I like the idea of self contained application units as well). I'd be more than happy to hear people's thoughts on those ideas. Mark On 9/13/05, Nando <[EMAIL PROTECTED]> wrote: > Mark, > > I've read your blog article, several times ... been feeling the pain of it > silently for awhile now. I'm currently just experimenting and rolling ideas > around in my mind. > > For me, the operative concept on the issue of typing is becoming > "trade-off". What's better? That the application sits here largely unused on > my dev machine with mappings and typed arguments and packages and we just > sell projects to high-end clients that want customized versions of the app? > Or i make whatever compromises are necessary and adopt a "mappingless" > approach, and free things up a little so i can host many instances of this > thing on a dedicated server(s) and expand our business? > > So what are the possible compromises? > > Use slashes instead of dots and stay with one OS? > Put all the components in a single directory? > Don't use typing? > > I'm leaning toward putting all components in a single directory. Ok, it's a > little painful not to have it organized, but my mind has to deal with lots > more difficult things - i'll manage! > > Why is "leaving CFC code at application root level the least cumbersome of > the options"? Why not in a single directory under the root? Or above the > root if you don't want your CFC's within your web directory structure? > > thanks for your input! > > Nando -- E: [EMAIL PROTECTED] W: www.compoundtheory.com ICQ: 3094740 ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). CFCDev is supported by New Atlanta, makers of BlueDragon http://www.newatlanta.com/products/bluedragon/index.cfm An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
