I love your desire to learn, Mike!
There’s a hidden secret to programming that you may have figured out if you’ve ever listen to Hal Helm before
It’s easy to caught up in the tools and patterns, and the “right” way, but all that matters at the end of the day is that you find the thing that makes you the most productive and allows you to deliver and maintain a good, maintainable product. It sounds like you’re well on your way as you seek to understand what you’re doing and why instead of just copying code and moving on.
Regarding the annotations, I’m with Andrew there. I rely on mapDirectory() in my WireBox config to map all my models for me and use annotations inside the files to define scoping, dependencies, etc. It’s nice to keep that configuration there in the models themselves. And since we JUST got on CF9, we haven’t really used the comment-based annotations, we use the additional attributes so it feels like an extension of CFML.
You guys are great…thanks for all the helpful insight. I can tell some of this is starting to stick. I’ve written four total different ways to accomplish the same thing…three with an interceptor and actually one without, just for fun. Each interceptor uses a different technique and they (now) all work…which is just amazing.
Learning how to do things differently is another great way to learn…I am finding it most helpful when I try one way that does not quite work the way I expect or want but can find another way.
Of course, figuring out which is best is another matter…but it’s nice to know that later, if I change my mind, I don’t have to re-engineer a ton of code.