Mailinglist Archive: yast-devel (50 mails)

< Previous Next >
Re: [yast-devel] New libstorage: Returning NULL pointers vs. throwing exceptions
On Tue, 1 Dec 2015 13:55:50 +0100
Arvin Schnell <aschnell@xxxxxxxx> wrote:

On Tue, Dec 01, 2015 at 09:42:38AM +0100, Ladislav Slezak wrote:
Dne 24.11.2015 v 16:45 Josef Reidinger napsal(a):
On Tue, 24 Nov 2015 15:47:24 +0100
Stefan Hundhammer <shundhammer@xxxxxxx> wrote:

On 24.11.2015 15:15, Josef Reidinger wrote:
Well, in OOP is also one more approach called NullObject
pattern, which is create kind if partition table, that in
represent no partition table.

This is wrong on so many levels that I don't even know where to

I know it is a bit controversy, similar like Singleton pattern. I
agree that over use it is bad design, but I also think it works
nice in some situations.

Null objects are used in libzypp quite a lot (e.g. [1], [2]).

But they are not used everywhere. Look for exceptions in y2log.

Yeah, both approach is bad, overusing it for everything and also do not
use it where it fits.

The libzypp API is huge and IMHO well designed. Sometimes too many
templates or "magic" boost patterns, but that's probably because
I'm not an experienced C++ developer. In general I like the API.

And that is why we have to manually maintain bindings? Those
bindings deal with exceptions as well and "catch (...) {}" is
commonly used.

Actaully reason for bindings is that e.g. swig cannot generate ycp
bindings ale all catches are result of our component system limitation,
not by libzypp limitations.

My approach is KISS.

question is if it is KISS for library users or KISS of implementation.

Maybe we could ask the libzypp developers for their experience with
such a huge API? To get some recommendations and early feedback...

I have already done so in the past and will continue to do so.

Good, is it somewhere documented, e.g. some discussion and more
important results of such discussion? It can help in future understand
better why something is done in chosen way.



To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: yast-devel+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups