Jun. 2nd, 2009
In some, imho, extremist environments developers are supposed to exclusively pass references to interfaces. An interface is frozen, and so nobody breaks it. Just implement it.
Now, seriously, we need to add some custom abstraction, some convenience methods, humanize the general abstraction a little bit, right? What would a regular programmer do? Use "decorator pattern". Pass around decorator instance, that delegates primitive actions to the instance it got in the constructor.
But it's kind of against the rules, hence, against the mentality.
So that's how people come up with "utility classes". That's how so many otherwise decent applications have all those
We should not. And we do not need an interface for a decorator.
Yes, I saw stuff like
Now I'll be rude, kind of.
Fuck interfaces!
Now, seriously, we need to add some custom abstraction, some convenience methods, humanize the general abstraction a little bit, right? What would a regular programmer do? Use "decorator pattern". Pass around decorator instance, that delegates primitive actions to the instance it got in the constructor.
But it's kind of against the rules, hence, against the mentality.
So that's how people come up with "utility classes". That's how so many otherwise decent applications have all those
DataManagerUtil
, UserInputUtil
, AccessControlUtil
. All that because we are afraid or are not allowed to subclass. To use decorator pattern.We should not. And we do not need an interface for a decorator.
Yes, I saw stuff like
IDataManagerUtilFactory
, an interface that returns a util that does all the pesky job that should actually be a part of the functional class. Why it is not a part of the functional class? Right because in this case the interface, IDataManager
, would be overloaded with the stuff that the interface designer does not find necessary.Now I'll be rude, kind of.
Fuck interfaces!
всё куда-то делось
Jun. 2nd, 2009 04:29 pmбабушки, которых нужно переводить через дорогу
русские иммигранты, страдающие от необходимости заводить кредитные карточки
белый порошок из-под чумы
колхозы, без помощи которым горожане не переживут зимы
нитраты и нитриты
коровье бешенство
25-й кадр и НЛП
глобальное потепление
проблема Карабаха
проблема Курдистана
проблема Тибета
вред от интернета
озоновая дыра
мой велосипед, украденный не далее как вчера
птичий грипп
свиной грипп
вирусы спида
вирусы компьютера
хакеры вообще
(белый стан, голоса панихиды и твоё золотое весло)
русские иммигранты, страдающие от необходимости заводить кредитные карточки
белый порошок из-под чумы
колхозы, без помощи которым горожане не переживут зимы
нитраты и нитриты
коровье бешенство
25-й кадр и НЛП
глобальное потепление
проблема Карабаха
проблема Курдистана
проблема Тибета
вред от интернета
озоновая дыра
мой велосипед, украденный не далее как вчера
птичий грипп
свиной грипп
вирусы спида
вирусы компьютера
хакеры вообще
(белый стан, голоса панихиды и твоё золотое весло)