Beans and Conventions

This might be a stupid question, but I was looking into where is the best place to stick and/all beans.

Currently I was thinking that there might be a convention for this, but I don’t see one. So my question is where are other people sticking them?

Regards,

Andrew Scott

If you are asking what folder I place the actual CFCs, I put them in with my services and DAO’s in the model folder. I use reverse domain name for packages.

Ex.

/models/com/mycompany/security/SecurityBean.cfc
/models/com/mycompany/security/SecurityService.cfc

/models/com/mycompany/security/SecurityDao.cfc

/models/com/mycompany/foo/FooBean1.cfc

/models/com/mycompany/foo/FooBean2.cfc

/models/com/mycompany/foo/FooService.cfc

/models/com/mycompany/foo/FooDao.cfc

/models/com/peterbell/lightwire/LIghtWire.cfc

/models/com/peterbell/lightwire/BaseConfigObject.cfc

etc…

I don’t know if that is necessarily an official convention, but it’s what I do and it works pretty well. Sometimes the subdirectories seem like overkill at first, but if you’re working on a big app, you’ll be thankful once you have a hundred or more CFCs.

~Brad

Put them in the model folder.

There are two approaches to package layout and you can read about them in our standards page: http://wiki.coldbox.org/wiki/DevelopmentBestPractices.cfm

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Thanks Luis,

Currently that is what I have been doing, but I had been thinking that handlers, views etc were separate I went looking for a reason why this could not be the case as well. Which is why I made reference to the Coldbox Core has the separate, and was wondering if we should be doing the same in our code.

Regards,

Andrew Scott