April 22, 2016
4:07 p.m.
On 22-04-16 17:04, Hilaire wrote:
Hi Julien,
Le 22/04/2016 16:45, Julien Delplanque a écrit :
Hello,
I have a question about Trait.
Is it ok, in the design point of view, to use them to force an object to implement an interface? Why not using a parent abstract class for that, with required method answering #subclassResponsability?
Then from your tests in subclasses, you check
self shouldnt: [instance toto] raise: SubclassResponsabilty
That limits one to one interface. Why not use a test testTheConformingImplementation self assert: ((AConformingImplementation selectors) asOrderedCollection addAll: (AnInterfaceClass selectors)) asSet = (AConformingImplementation selectors) asSet