> it is my understanding that cold fusion
> is itself a cf to java compiler (among other things)

Yes, it is.  However, unlike a "real" compiler, you don't get full
perspective of the app at compile time.  When you compile Java, you
have to have all the resources for the whole app available to you so
you can do all the typechecking.  CF, on the other hand, does it's
compilation piecemeal.  And it does it iteratively.  In other words,
if CFC X depends on CFC Y, that's great, but CFC Y can be recompiled
at a later time without CFC X being recompiled.  That can lead to
undetectable type issues, because the issue is with X's dependance on
Y, and therefore in the code of X, but X isn't part of the compilation
unit, so CF cant notice until runtime.

So while CF is a compiler, it's not a compiler like Java has.

> I agree this is the overall desired goal of interfaces in CF but if the
> interface is not enforced it becomes somewhat useless doesn't it?

You don't define methods in a CF interface, because there isn't any
way for that to work.  You don't care about methods when you're doing
typechecking on arguments and returntypes, only whether the type being
passed is an instance of the type declared in the CFARGUMENT or
CFFUNCTION tag. Right now, you either have to pass the declared type,
or a type that extends the declared type.  With interfaces (without
method validation), we'd suddenly be able to pass objects around that
impelement an interface, and thereby avoid having to use a whole lot
of really contrived inheritance hierarchies.

That's the value of interfaces to CF, if you ask me.  Method
validation is arbitrary in CFC, and intentionally so.  Heck, you can
even dynamically add and removed methods on an object instance, which
would make any compile-time method checking (if it were possible)
meaningless anyway.

cheers,
barneyb

On 10/13/05, Chris Stoner <[EMAIL PROTECTED]> wrote:
> While I agree that it isn't a compiled language in the same sense that you
> compile it yourself within your IDE, it is my understanding that cold fusion
> is itself a cf to java compiler (among other things).  So the compile time
> checking "could" happen, but not in the same why you would see in java.  At
> first run (compile) time the interface implementation could be checked and
> an error could be thrown/displayed to the page like any other CF Exception.
>
> > The real reason for wanting interfaces is for the runtime typechecking
> that CF does
>
> I agree this is the overall desired goal of interfaces in CF but if the
> interface is not enforced it becomes somewhat useless doesn't it?  What good
> is type checking if the CFC/Object doesn't fit the description of what that
> type is?
>

--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 100 invites.
b����.n�+�����qׯN�����r��zǧu�ޙ����qׯq�3�w��"�a{
+v˧���r��y��u�ڲ�^���y�h~�^zf��!B
�ⲻ�o �  �'{0q�3�w���v˩���y��UǢ�b�
0�����-�x�`�7���.��+��[�װ�Z�֦jG�����热�(�m����  
���ej{Zr������l��ny�ڂ���w^���v�r�z�����7��+-�Ưj)ZnW��0���j�!����o�}�^���Ήޢ�

Reply via email to