Re:Things Java Programmers can learn from Clojure
by jimbokun on Thursday March 07, 2013 @12:02PM
(#5338678)
"Interfaces are dictated by functionality they provide and not size. They can have hundreds of methods. This is how it looks: DocumentService - put every document related method in here, FinancialInstrumentService - put every instrument related method in here"
Then what is the point of having interfaces at all?
There is no way multiple implementations will be created for such interfaces, so just make it a single class and be done with it. Otherwise, you are missing the whole point of an interface.
I guess the exceptions are proxy objects and other such patterns, but Java makes it difficult to implement such patterns without explicitly implementing each method to forward the exact same call to the delegate.
Then what is the point of having interfaces at all?
There is no way multiple implementations will be created for such interfaces, so just make it a single class and be done with it. Otherwise, you are missing the whole point of an interface.
I guess the exceptions are proxy objects and other such patterns, but Java makes it difficult to implement such patterns without explicitly implementing each method to forward the exact same call to the delegate.