[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Liberty-eiffel] Set initial values on deferred classes
From: |
A. Arias |
Subject: |
Re: [Liberty-eiffel] Set initial values on deferred classes |
Date: |
Sat, 18 Jun 2016 13:05:04 -0600 |
For example I have a deferred class to handle the min size and max size
of the widgets. Then I want invariants like (or maybe postconditions as
you suggests):
invariant
min_width < max_width
min_height < max_height
So I need initial values, for example min_width = 0 and max_width = 100.
Of course I can do this at the class that inherits from this deferred
class. But is possible do this at the deferred class?
Germán
El sáb, 18-06-2016 a las 19:15 +0200, Paolo Redaelli escribió:
> Initialization is a task of creation procedures.
> Invariants are checked at the end of each feature call.
>
> You may want to your checks them as a postcondition,
>
> Il 18 giugno 2016 06:37:56 CEST, "Germán A. Arias"
> <address@hidden> ha scritto:
> How can I set initial values for some features in deferred classes?
> For
> example Objective-C have the method -init (and all its variants) that
> is
> called each time an instance is created. Is there something similar in
> Eiffel? My intention is add some invariants for some features in
> deferred classes, but for this I need set some initial values. Any
> advice about how is this achieved in Eiffel?
>
> Thanks
> Germán
>
>
>
>
> -- Inviato dal mio cellulare Android con K-9 Mail.