On Tue, Jun 30, 2009 at 10:07 AM, Alexander Kogtenkov <
[hidden email]> wrote:
> Would it make sense to do something like that:
> ....
>
>
Yes, thanks for your suggestions. The structure with PROXYABLE [G ->
PROXYABLE [G]] seemed very interesting and better than those I heard so far
but what Arno pointed out is certainly an issue.Let me try and see if I
understand your solution for that correctly:
deferred class
PROXYABLE_INTERFACE [G -> PROXYABLE_INTERFACE [G] create make_with_arg
end]
feature
proxy: PROXYABLE_INTERFACE
deferred
end
class
PROXYABLE
inherit
PROXYABLE_INTERFACE [PROXYABLE]
create
make_with_arg
feature
....
proxy: like Current
do
create Result.make_with_arg (foo)
end
So basically your solution is then to just introduce a non-deferred class
which can define the creation procedure. In that case there's not much
difference to Manu's first suggestion (and one could directly make PROXYABLE
non-deferred, which defeats the original point).
Do you agree that my initial solution would be the most elegant?
I may post more when I have found out what you mean by a context bound
validity rule.
The general philosophical question that I can see here is how much some
validity rules, written to generally make sense, should be relaxed in
(exceptional) situations where soundness is still guaranteed thus making
them harder to fully understand.
Another example I have in mind could be the redefinition of attributes as
functions.
Best Regards,
Daniel
ps. My current solution is now Alexander's first suggestion as in my use
case it hardly makes sense for clients to use the general PROXIABLE.
On Tue, Jun 30, 2009 at 11:37 AM, Alexander Kogtenkov <
[hidden email]> wrote:
>
>
> Arno Fiva wrote:
>
> > I had a similar issue lately creating a tree data structure. The
> declaration
> >
> > PROXYABLE [G -> PROXYABLE [G]]
> >
> > is an interesting approach. The only problem I found is that you make it
> impossible for a client to use a general PROXYABLE,
> > right?
>
> That's correct. The issue can be solved by adding one more non-generic
> parent
> that lists the required features, so that the structure becomes similar to
> MY_PROXYABLE -> PROXYABLE (defines "proxy") -> PROXYABLE_INTERFACE (defines
> required features)
>
> If required, PROXYABLE_INTERFACE can even define deferred feature "proxy":
>
> proxy: PROXYABLE_INTERFACE
> deferred
> end
>
> And this feature will be effected in PROXYABLE.
>
> Regards,
> Alexander Kogtenkov
>
>
>
[Non-text portions of this message have been removed]