On 2/13/17, 2:56 AM, "carlos.rov...@gmail.com on behalf of Carlos Rovira" <carlos.rov...@gmail.com on behalf of carlos.rov...@codeoscopic.com> wrote:
>Hi Alex, > >DI frameworks has many more things. For example If I configure a model >bean >of type ProductModel and give it an id of "productModel", in each class I >declare a >var productModel:ProductModel, the framework will inject it. > >With bead/strands we would need to make that in all declarations. >As well, beads/strands seems to be very prepared for MXML but not to be >tweaked in AS3 IMO, that isn't true. You could have a single application level bead that watches for objects being added to the DOM. But yes, I am proposing that MXML with beads is a structured way of "annotating" objects. > >Metadata as well is something very powerful and I expect we could get more >of this in the future >both in compiler and language (like Generics) or in a DI framework > >IMHO, we should not restrict o simplify this. We should embrace all this >things DI, Annotations/Metadata, >beads/strands,... since each one has its own points and will make FlexJS >something ahead the rest Well, we have Metadata support already. I'm just pointing out that in many ways with regular Flex, Metadata was the only option for extending objects at runtime. In FlexJS, with beads, I think we have another more structured way of extending objects at runtime, so brand-new DI frameworks should consider that. Just like we say that AS is better than JS because it is structured, maybe beads for DI is better than Metadata also because it is structured. I encourage you, if you are going to write a next-generation DI framework, to think out-of-the-box and not just re-use the old techniques without considering the new ones. I remember seeing some Parsely code and watching how it waited for creationComplete before applying its changes to the objects which cause a full re-validation of the DOM and thinking that for FlexJS, we could make DI-friendly component sets that have different lifecycle events that allow injection without forcing a full second-pass. Things can be much better when you can design them in vs having to patch them in from the outside. -Alex