>> I'm not sure how this would be done best or how useful it would be, but: has 
>> dependency injection been considered as a use case for modules (e.g. to swap 
>> modules during testing)?
>> 
>> One possibility might be to give modules parameters that module clients have 
>> to provide.

> The module system was designed to make it as easy as possible to use, both 
> for general ease of use and to encourage modular programming. Once you move 
> to an approach where programmers have to write their own linking 
> specifications, it tends to get much more complicated. When you make modules 
> more complicated to use, people don't use them.

Yes, I’m all for simplicity.

> Module loaders do give you the ability to do dependency injection, though, by 
> changing the semantics of module URL's.

Right. This should give one everything one needs.

-- 
Dr. Axel Rauschmayer

a...@rauschma.de
twitter.com/rauschma

home: rauschma.de
blog: 2ality.com



_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to