Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[epsilon-dev] On the design of EGX and EGL

Hi all,

 

I have been working on parallelising EGX and in doing so have discovered numerous complications which, at least from my understanding, seem unnecessary (accidental, rather than essential complexity). Whilst I have tried my best to make sense of EGL’s design and leave things as they are, I have some questions regarding the dependencies between various components.

 

In particular, GenerationRule does not need to depend on IEglContext – replacing all parameters with IEolContext works just fine, as the context is only used to execute the parameters, target, overwrite etc. blocks. More fundamentally however, I cannot understand why EgxContext extends EglContext. It seems that the only commonality between EgxContext and EglContext is the TemplateFactory and the “copyInto” functionality (which seems to copy only the references, not a deep clone). I presume this inheritance was more for convenience rather than any core design principal regarding the semantics of EGX?

 

My proposal is to make EgxContext extend ErlContext and implement the IEgxContext interface, which would have the copying and template factory functionality.

 

Another remark: the EglTemplateFactory take an IEglContext and re-uses the same context for all new templates. Since each EglTemplate creates its own EglModule, this design is inherently not thread-safe as only one template can execute at a time. Would it not make more sense to change the parameter to a Supplier<? extends IEglContext> as oppose to sharing the IEglContext? Or at least adding a Function<IEglContext, ? extends IEglContext> so that the initial context can be copied and passed to newly created templates.

 

Thanks,

Sina

 


Back to the top