3 ms·
Oh good example. It shows everything that's wrong with OO thinking I could split the file interface like this, thinking that some modules will want to read onl
by raverbashing 9y ago
Oh good example. It shows everything that's wrong with OO thinking
I could split the file interface like this, thinking that some modules will want to read only, some people will want to write only (in rare cases you want trim only, but that is obvious except to "enterprise architects" apparently)
Except it's splitting hairs. And my readers can ignore the write interface and my writers can ignore the read interface and that works in most languages.
> This gives the flexibility for the clients to combine the abstractions as they may see fit and to provide implementations without unnecessary cargo.
Your compiler won't let you call an abstract method. It's that simple.
It's not increasing flexibility, it's increasing red tape and maintenance costs.
One of the reasons C# feels more fluid is that they reduced the level of lunacy created by this way of thinking where you create two or three classes to solve a problem that's solvable in 2 lines in other languages
- rapala 9y agoAs I understand this, the client here is not the caller of the methods defined in the interface, but the one implementing them. Caller has no problem just ignoring the methods that it doesn't need. But the implementer doesn't have that possibility. If you have a read-write interface and a read-only source, you need to resort to subpar solutions like throwing an exception.