Re: [PATCHv4 06/11] Add OsinfoInstallConfig:config-params property

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

 



On Tue, Dec 18, 2012 at 04:47:53PM +0200, Zeeshan Ali (Khattak) wrote:
> On Tue, Dec 18, 2012 at 12:29 PM, Christophe Fergeau
> <cfergeau@xxxxxxxxxx> wrote:
> > Thinking a bit more about this, if we make these private then it's better
> > to make osinfo_install_config_new_for_script public and to advocate using
> > it instead of osinfo_install_config_new, otherwise it's pretty weird to
> > have this config-params property which will always be NULL as far as
> > the library user can see.
> 
> Or we don't expose config-params as property? We can just have the
> getter/setter for now. Also, wasn't there a way to make properties
> private?

As said that email I linked to, I think the config-params property is
useful to have on an OsinfoInstallConfig object to be able to answer
questions such as 'which properties should I set on this object?'.
Currently in order to know that, you need to query the OsinfoInstallScript
that you are going to use, which is weird and inconvenient imo.
Basically there are 2 competing approaches:
- OsinfoInstallConfig is just a simple wrapper on top of OsinfoEntity and
  has dedicated getters/setters for various properties that make sense for
  an OS installation script. However, only OsinfoInstallScript knows which
  parameters are needed, what their value is, ... and you have to use this
  for any validation/transformation/... you want to apply to these config
  values
- the second approach is to make OsinfoInstallConfig something more
  sophisticated which knows more about the paramaters it's holding, what
  they should be, the restrictions on their values, how to transform them,
  ...

In my opinion, the second approach is more convenient both for the library
user and for us from a maintainance point of view, which explains my
insistance on moving this way ;)

Christophe

Attachment: pgpOP_LHH2s8X.pgp
Description: PGP signature

_______________________________________________
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