Class methods in .NET are equivalent to CFCs?
I'm sitting through "Introduction to ASP.NET for ColdFusion Developers" Part 3, given by Adam Churvis on Learn2asp.net
I'm watching a recorded version, which was done using LiveMeeting. Conceptually it doesn't seem much different than breeze, although Breeze has significantly less lag time. A cool feature is the question and answer pod, where people can ask questions (to a moderator) and the questions and answers come back at you at once. In part 3, Adam is concentrating on creating a C# Class for a simple application.
An interesting question / answer combo came up.
Answer: They are similar in that they allow you to reuse code. CFCs are not object-oriented, but allow you to do some inheritance and encapsulation similar to compiled classes that implement objects in .NET.
First off, a method is not equivalent to a CFC. A 'class' is equivalent to a CFC. A method is equivalent to a method (in CF, you create methods inside a CFC with CFFunction).
Second, the "book.cs" class which is being created, would be almost identical to how I use CFCs (There are a few differences*). I don't understand why the demonstrated method is more or less object oriented than what one might do in ColdFusion using CFCs.
The really cool thing about VS.NET is the Intellisense (AKA Code Insight) for objects. Create an object, type the object name, and you recieve a list of all properties methods on that object. I'd love to see this type of 'code insight' in CFEclipse or Dreamweaver. ( If memory serves me, I think I read somewhere that it might go into a future CFEclipse update)
* In the book.cs file, a 'Getbooks" method is created that gets all books from the database. Normally I would keep all methods in a 'book component' to deal with a single record; whereas a "GetBooks" method deals with multiple records.




There are no comments for this entry.
[Add Comment]