From kde-devel Wed Jan 06 08:30:06 1999 From: "Robert Hagemann" Date: Wed, 06 Jan 1999 08:30:06 +0000 To: kde-devel Subject: Re: Directories named *.kdelnk : bug in kfm or KSimpleConfig ? X-MARC-Message: https://marc.info/?l=kde-devel&m=91561160715719 Hi, take my apologies for getting philosophical, but on answering Patrick Dowler: Of course, having kfm try to use KSimpleConfig and seeing if it worked is a valid way for kfm to check the thing.kdelnk. If KSimpleConfig is going to check (it really should) kfm might just as well use that check rather than duplicate it... I recall in java that I always just try to open the file by creating a FileInputStream and catching exceptions, rather than checking that it exists, chekcing permissions, and then opening it (FIS does the same checks I do, presumably). This reminds me on letting Your child touch the oven, in order to know if it's heated... A class (KSimpleConfig) should be the abstraction of an entity with a set of related responsibilities. (You know CRC cards?) IMHO, the responsibility of KSimpleConfig is to provide configuration information and *not* to check for ordinary files, permissions a.s.o. I think, - kfm has to check the file, because it's its responsility to provide a valid context for KSimpleConfig, and - KSimpleConfig has to check the file bcause it has to handle error conditions gracefully. If both classes want to have a similar job done, the should request the service of just another class (A file checker class). Just my two pence... Ciao Robert Hagemann .