All,
I've been going back and forth on some framework naming conventions
and wanted some feedback.
Typically speaking, ColdFusion reads better when components and
methods are written using camelcase. For example, something like
emailService.sendEmail() reads better than email_service.send_email()
or emailService.send_email().
However, I have always felt that folders and URLs look horrible when
written in camelcase, and instead I prefer to use underscores. For
example, if I were to list out all of the product categories that an
ecommerce application might have, a URL might look like
http://www.myapp.com/product_categories/list and the view might be
located at /views/product_category/list.cfm, while the request would
still be routed through a ProductCategoryController. Does this make
sense? I believe this is similar to conventions used in Rails, but
Ruby's naming conventions tend to be a lot stronger than ColdFusion's.
Also, what happens if your action isn't just a single word, like if
you were adding a subscription. Your URL might look like
http://www.myapp.com/account/add_subscription, which would invoke the
AccountController. In this case, what should the method be? I think it
would feel more natural to ColdFusion if the method was written using
camelcase and not using underscores, but does that make sense to
everyone else? So that /account/add_subscription invoked
accountController.addSubscription() rather than
accountController.add_subscription().
Honestly I'm not sure how the framework currently handles such a
situation, but I'd like to make a decision and go with it in order to
move forward with unit tests and documentation. I'm leaning towards
having the controllers and actions referenced using underscores, while
having the actual methods being written in camelcase, but I'd like to
get your ideas before making a final decision.
Granted nobody ever responds to these threads, but I figured I'd at
least give people a chance to speak their mind if they cared...
Thanks,
Tony