quasi interfaces for views

0 views
Skip to first unread message

Freddie

unread,
Feb 3, 2009, 4:01:42 PM2/3/09
to OpenFlux
I've come across a use case where I'd like to (a) limit the kind of
view for a component to a certain kind (b) thus know something about
typed variables on that view, for the controller for instance. Sounds
like a classic case of interfaces - however when you make subcomponent
of a view, and give it an id, it doesn't seem to automatically create
getter/setter functions for it, so you can't just write the variable
name/types in an interface as a bunch of getter (and maybe setter)
methods, which would be perfect!

(a) can be achieved by an empty interface (b) would require something
more.

nheritance doesn't work either, as defining <content> in a subclass
simply overwrites <content> in superclass, rather than adding to it
somehow, so although you'd be able to use this for the factory pattern
in principal you could be out of luck if you forgot to implement in
the subclass.

a slightly hacky way of doing it would be to define getters/setters in
a code block that reference the components that you've given ids to
<content>, this is only way I can think of right now, seems messy, any
better ideas?

how might it affect things if Container was modified somehow so
subclasses' <content> was added on rather than overwriting?
Reply all
Reply to author
Forward
0 new messages