Libzypp/Design/Resolvable/Backwards
I've put the attributes from PMObject into ResObjectImplIf. Using the types outlined in zypp/NeedAType.h.
Maybe some stuff meets to be cleaned. E.g. providing info about the source
(instSrcLabel instSrcVendor) is not job of the resolvable. It will, be
switched to provide a Ptr to the responsible source, and the UI should ask
the source itself.
Support for translations is not yet added.
The methods are currently just virtual, so if you don't provide an implementation for it, it will return some default value.
Try not to invent default values to return within the Impl class. If possible the ImplIf methods should provide a trivial implementation for each attribute
Label ResObjectImplIf::summary() const { return Label(); } Text ResObjectImplIf::description() const { return Text(); } FSize ResObjectImplIf::size() const { return 0; } bool ResObjectImplIf::providesSources() const { return false; }
Within the real implementation class (derived from the ImplIf) do not invent return values, if there is a default provided in the ImplIf!
E.g. do not return "" for summary(), if you don't know or have no support for a summary attribute. Call the default implementation if provided:
Label MYObject::summary() const { return ResObjectImplIf::summary(); }
Last edit in Trac '11/24/05 18:47:57' by 'kkaempf'
Last edit in Trac '11/24/05 18:47:57' by 'kkaempf'
Last edit in Trac '11/24/05 18:47:57' by 'kkaempf'
Last edit in Trac '11/24/05 18:47:57' by 'kkaempf'