Should every Java domain class implement an interface? -


i've been looking on java project done @ company , in project developers created interface pretty ever domain entity (there hundreds). in cases, think abstraction works, in other cases doesn't seem need @ time.

whenever instances passed around referred , access via interface.

is bloat future proofing? or sound engineering practice?

interfaces specify required behavior without implementation. allow swap implementations without affecting clients. can useful techniques aspect-oriented programming or proxy generation.

but if implementation doesn't change, see no justification interface.

most model objects fall category. if there's no implementation differences, don't use interface.

interfaces terrific services , persistence classes, have never seen them used abstract model objects.


Comments

Popular posts from this blog

400 Bad Request on Apache/PHP AddHandler wrapper -

Add email recipient to all new Trac tickets -

php - Change action and image src url's with jQuery -