4 ms·
The author conveniently leaves out the implementation of the actual method calls themselves, which is frankly the important part. interface Query { All
by flippinburgers 5y ago
The author conveniently leaves out the implementation of the actual method calls themselves, which is frankly the important part.
interface Query {
All ...
Insert ...
Update ...
Delete ...
WhateverElse ...
}
Now admittedly, the implementation is probably cleaner with "generics", but you can generically approach the problem with interfaces.
- cpuguy83 5y agoBut how do you get the thing that implements that interface? Either the framework has to know how to create a querier for each specific type, drop to using empty interfaces, or use generics.
- flippinburgers 5y agoThe point of the interface is that the person authoring the code defines the internals.