[e-lang] Forwarded thoughts on modules from Constantine
Mark Miller
erights at gmail.com
Tue Apr 17 15:31:15 CDT 2007
Forwarded with permission
---------- Forwarded message ----------
From: Constantine Plotnikov
[...]
> > • The [E] language lacks application and component management mechanisms.
> > The language would have benefited form some form of dependency
> > injection and a kind of class loader mechanism. This is a particularly
> > acute problem since the language uses capability security model.
> > Traditional component management hacks based on static variables do
> > not work in this programming language.
>
> What is "dependency injection"? Some of our uri-getters, such as
> import__uriGetter, do serve a role similar to class loaders. Kevin
> Reid is in the process of building a module system in E for E starting
> from these foundations.
>
Problem is not just loading. Problem is isolation, versioning,
linking, deploying, service discovery, and garbage collection of
loaded code. Java class loading mechanism is very low level. An
example of good high-level class loading architecture built upon it is
OSGi (http://www.osgi.org). Something similar will be needed for E in
order to be used in large systems. OSGi relies on static state a lot,
however this could be fixed. I'm not aware what is Reid is doing now,
but it would be good to point him to OSGi if he has not looked at it
yet.
Dependency injection is a way to design applications where objects are
not aware how to obtain references to other services (this situation
is very natural for capability system). The links are established by
container that hosts these objects. The objects just declare what they
require in order be created. By role, it is similar to powerbox
mechanism. For examples of well developed frameworks for Java are
http://code.google.com/p/google-guice/ and http://springframework.org/
. The frameworks use all of Java language features including static
state. They currently also lack safety mechanisms for intermodule
linking. Guice and Spring are interesting in different perspectives:
guice is possibly closest to capabilities and spring is most feature
rich. Spring also has integration with OSGi, so it might be
interesting in context of module work.
[...]
Constantine
More information about the e-lang
mailing list