--- In flexcoders@yahoogroups.com, Jules Suggate <julian.sugg...@...> wrote: > > Is it possible for an MXML file to implement an interface? Sounds intriguing > ... but won't resolve my issue unfortunately. It's the implementation code > that I want them to share. > > I have developers on my team who are less than keen on having to duplicate > repetitive code around the place -- they want to focus on cool effects, > state transitions and backend integration :-) > > And I don't want repeated code everywhere in the app since if we want to > change something, there'll eventullay be hundreds of places where we have to > do so if the code is copy+pasted around the place...
You could do something like monkey patching UIComponent to include your boilerplate. Another option is to simply have an as file that you include. A third option is to have a class that encapsulates the common functionality, and use composition to add it to your classes (where the classes _have_ a someClass rather than _being_ a someClass). A fourth option is to create a class with all static methods, similar to how the Math class works. HTH; -Amy