Re: [PATCH 0/6] Simplify application of datamaps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




----- Исходное сообщение -----
> On Wed, Jan 09, 2013 at 11:02:14AM -0500, Christophe Fergeau wrote: 
> > While having an OsinfoInstallConfigParams property in the
> > OsinfoInstallConfig class, it imo makes sense to have it as
> > the disconnect between OsinfoInstallConfig and
> > OsinfoInstallConfigParams
> > is weird. It's more convenient to have the configuration schema
> > (OsinfoInstallConfigParams) directly available while filling an
> > OsinfoInstallConfig object, and would potentially allow in the
> > future to check which parameters are allowed/disallowed/... when
> > they are set.
> 
> If you're filling in a InstallConfig object you'll have to have
> an InstallScript object around already, so you have the schema
> available via that object if you really need it, without needing
> to duplicate it in the InstallConfig object. 

Yup, you can access it this way, but this means passing around 2 different objects (InstallConfig and InstallScript) to be able to access the InstallConfigParams data while you fill the InstallConfig object. When I first looked at that code, I was actually very confused to find no link at all in the API between OsinfoInstallConfig and OsinfoInstallConfigParams, contrary to what their very similar names could imply.

> I think it makes the InstallConfig object design more futureproof if we don't
> unnecessarily tie it to a InstallScript instance.

It's currently only tied to an OsinfoInstallConfigParams instance (which indeed indirectly links it to an InstallScript instance in the current code). But I'm fine with not adding this property until a clear need for it appears, if ever.

Christophe

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux