Fat bean vs Fat service?
'Bean' was introduced to me when I was learning Model-Glue.
While I did blindly use bean as instructed by MG and other tutorials on MG, I found that:
1.) Some thinks bean is nothing more than using CFC as a struct to hold fields of forms.
2.) Some thinks bean is nothing more than representing a table in SQL (data-centric extreme)
3.) Some thinks bean is an object that handles everything internally and (talks to database)
4.) Some thinks bean is an object that handles everything othan than talking to database (with external XXXDao.cfc)
I have used a code generator to generate all the getters and setters. With code folding support by CFEclipse, I don't mind them too much. Using MG together with ColdSpring, it seems the preferred way is to code most logic in the Service layer because they will be kept alive throughout the lifetime of the application through use of Singleton. However, doesn't that lean towards... procedural programming?
I like the idea of having a "fat bean", and with that I can rely much less on getters and setters. However, as the object grow larger with number of methods, wouldn't initializing the object be too expensive on CF8?
What's your take? Please continue the discussion at the thread, or leave a comment here whatever is easier for you.