Having this design :
interface Foo<T> {
void doSomething(T t);
}
class FooImpl implements Foo<Integer> {
//code...
}
interface Bar extends Foo {
//code...
}
class BarImpl extends FooImpl implements Bar {
//code...
}
It gives me Compile Error :
The interface Foo cannot be implemented more than once with different arguments: Foo and Foo
a simple fix for this issue is :
interface Bar extends Foo<Integer> {
// code...
}
Integer type in Bar interface is totally useless.
is there any better way to solve this issue ? any better design?
Thanks for your advices.
EDIT:
given solution:
> interface Bar<T> extends Foo<T>
is ok, but its same as my previous solution. i don't need T type in Bar.
let me give a better sample:
interface ReadOnlyEntity {
}
interface ReadWriteEntity extends ReadOnlyEntity {
}
interface ReadOnlyDAO<T extends ReadOnlyEntity> {
}
interface ReadWriteDAO<K extends ReadWriteEntity, T extends ReadonlyEntit> extends ReadOnlyDAO<T> {
}
is this a good design?