Hi Eric,

With 0.8 we slightly changed the way interfaces are verified. Now we 
expect the verify methods to raise an exception if a precondition isn't 
satisfied. The reason for this change was that we ended up with lots of 
interface methods simply returning "true", further we unified all checks 
with the checks in "qx.core.Assertion".

In the interface you can make use of all the assertion methods defined 
in MAssert:

testMe: function() { this.fail("You should not see this!"); }
testYou: function(you) { this.assertString(you); }


Did you find any references in the documentation still mentioning the 
old behaviour?


Best Fabian
> Michael Helwig schrieb:
>   
>> Hey Eric,
>>
>> have you tried leaving the brackets "[" and "]" away in your interface 
>> declaration? I'm not sure what they are there for, I have never used 
>> them and my interface implementations work.
>>
>> Best,
>>
>> Michael
>> Eric Brachmann schrieb:
>>   
>>     
>>> Hello,
>>>
>>> working on a project with qooxdoo I recognized, that the preconditions I 
>>> set in an interface were not evaluated correctly. It seems that my 
>>> classes do not implement their interfaces at all, although the code 
>>> looks fine and no error is thrown.
>>>
>>> An example to illustrate the issue:
>>>
>>> IMyInterface.js:
>>>  qx.Interface.define("itest.IMyInterface",
>>>  {
>>>    members:
>>>    {
>>>      testMe: function() { return false; }
>>>    }
>>> });
>>>
>>> MyClass.js
>>>  qx.Class.define("itest.MyClass",
>>>  {
>>>    extend: qx.core.Object,
>>>    implement: [itest.IMyInterface],
>>>
>>>    members:
>>>    {
>>>      testMe: function() { alert("You should not see this!"); }
>>>    }
>>> });
>>>
>>> Application.js (excerpt):
>>> ...
>>> var test = new itest.MyClass();
>>>      
>>> alert("implements interface: " 
>>>     + qx.Class.implementsInterface(test, itest.IMyInterface)
>>>     + ", has interface: "
>>>     + qx.Class.hasInterface(test, itest.IMyInterface));
>>>      
>>> test.testMe();
>>> ...
>>>
>>> The output is "implements interface:  true, has interface: false" as if 
>>> the implement statement in the class definition is being ignored.
>>> The testMe() method gets executed even though the precondition of the 
>>> interface evaluates to false.
>>>
>>> A project of this simple example is avaiable here: 
>>> http://www.hatter.de/studium/itest.zip
>>>
>>> It would be very kind if someone could enlighten me.
>>>
>>> Regards, eB.
>>>
>>>     
>>>       
>
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
> is a gathering of tech-side developers & brand creativity professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, & 
> iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
> Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>   


-- 
Fabian Jakobs
JavaScript Framework Developer

1&1 Internet AG - Web Technologies
Ernst-Frey-Straße 9 · DE-76135 Karlsruhe
Telefon: +49 721 91374-6784
[email protected]

Amtsgericht Montabaur / HRB 6484
Vorstände: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas 
Gottschlich, Robert Hoffmann, Markus Huhn, Hans-Henning Kettler, Dr. Oliver 
Mauss, Jan Oetjen
Aufsichtsratsvorsitzender: Michael Scheeren


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to