I want my program to:
- read some input lines from CSV file
- write the output lines to plain string file
- read some input from the same file in (2) and compare it to some calculated data
I want to consider these abstraction levels:
- create
Dal
interface with CRUD operations - implement
Dal<T1>
,Dal<T2>
,Dal<T3>
- create FileHandler interface with
read
andsave
operations - implement
CsvFileHandler
,StringFileHandler
And then:
Dal<T1>
will implementread
with a member ofCsvFileHandler
Dal<T2>
will implementread
andwrite
with a member ofStringFileHandler
Dal<T3>
will implementwrite
with a member ofStringFileHandler
Is it OK that Dal<T1>
and Dal<T3>
really implement Dal
only partially (not all CRUD). Or should I choose other abstractions?
I'm using guice DI and I need to differentiate Dal<T1>
and Dal<T2>
even though they both read
/ write
type String
. So I created a dummy different classes for T1
, T2
.
Do you think I use too much abstraction? Are FileHandler
and Dal
overlapping?
Any other way to differentiate Guice injection rather than create dummyTypes
?