We have started using OO on new projects and all business logic is in CFC's accessed from the cfm pages using a service layer.
We are also keen to start unit testing and using Test Driven Development so we can build up a suite of tests we can run before handing projects over to the test team to test the changes. If I wanted to move business logic from a cfm display page into CFC's and use the CFC's via a service layer what approach would you recommend? My thoughts would be: a) write tests to test the business object b) write enough of the business CFC to make the test go 'green' c) slowly refactor the CFC then test again etc etc d) once it passes all tests and is refactored set up a test for the service CFC e) write enough of the service CFC to make the test go 'green' f) slowly refactor the CFC then test again etc etc g) use the service CFC in the cfm page. Questions are: 1) Is this a good approach? 2) When unit testing the service CFC should I use the business object it requires or mock it to ensure only the one CFC gets tested? Personally I would like to use Model-Glue on the application but introducing a 3rd party framework will not be happening until probably next year. We just want to start seperating the business logic, database access from the cfm pages - the cfm pages would then become 'controllers' in the loosest sense of the term and use custom tags for the 'views' No more questions from me today :-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CFCDev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfcdev?hl=en -~----------~----~----~----~------~----~------~--~---
