Right... I kind of agree with you. But end of the day, isn't the Module effectively a singleton, and like the "Class" will "know" of its only instantiation... I could also see that it makes sense the other way.
Cheers Niclas On Thu, Dec 17, 2015 at 9:32 PM, Stanislav Muhametsin < [email protected]> wrote: > On 17.12.2015 15:25, Niclas Hedhman wrote: > >> Sooooo.... I have tried to straighten up the difference between the >> "Model" >> and the "Instances", especially for the ModuleInstance, which was heavily >> overloaded with Model stuff. >> The interesting bit about the Modules (and Application and Layer too) is >> that there is one model and one instance, so it is possible to go from one >> to the other and back. Does that sound right? >> > > Strictly my personal opinion, but no, it doesn't sound right. > IMO instance should know its model, but models should not know instances > that are created off the model. > > In Qi4CS I have three layers: assembly, model, instance. > Assemblies are quite close to the ones in Zest - they are the ones that > are manipulated by users of Qi4CS/Zest. > Models are created from assembly - these are immutable, and they > restructure all the type information in assembly into more coherent data > structures. > And, as stated above, instances are created from models. > > I've made this layer separation so explicit that even namespaces in Qi4CS > are something like this: > Qi4CS.API.Assembling > Qi4CS.API.Model > Qi4CS.API.Instance > Qi4CS.SPI.Assembling > etc... > > > -- Niclas Hedhman, Software Developer http://zest.apache.org - New Energy for Java
