On Fri, Mar 2, 2018 at 9:21 PM, Esteban A. Maringolo <emaring...@gmail.com> wrote:
> "Castings" are aliens in the Smalltalk world, although there is a > #become*: method family, I would discourage you from using it as an > alternative unless you really need to do it. > Ok, thanks. I think this use case is specific enough for casting to be useful, but I see your point. > > If your use case is that concrete, I'd do something like: > > `ILHTMLBuilderElement fromXMLElement: anXMLElement` > Yes.. :) -- Siemen > > Then all subclasses of `ILHTMLBuilderElement` will know what to look > and what to omit from the `XMLElement` parameter. > > Regards! > > Esteban A. Maringolo > > > 2018-03-02 17:08 GMT-03:00 Stephan Eggermont <step...@stack.nl>: > > Siemen Baader <siemenbaa...@gmail.com> wrote: > >> > >> What else could I do, apart from removing the element from its tree, > >> creating a new (subclass) instance and then putting this element in > place > >> of the old one? Some #perform or `super` magic..? > > > > Use composition? Generate accessing code where necessary. > > Is this very performance critical code? > > > > Stephan > > > > > > > >