Java – How to properly design classes for a big project

class-designjavauml

If we need to represent classes in a class diagram for a big project that is not completely designed yet, and the classes have to be actual tables in a database, how would we predict and design the classes?

Let's say we have a project that is going to have more than 15 tables, do all these tables need to be classes in the class diagram?

How would classes be designed in this kind of situation? The language that is being used is Java and the class diagram has to prepared in UML. I know how to design them, I just don't know if the tables should represent the classes in this case.

Best Answer

Designing your classes to map directly to tables can be seen as an anti-pattern. There is a natural Object - Relational impedance mismatch that you get when using OO and relational DBs.

Designing your application according to its domain independent of its data storage is often a recommended practice. Domain Driven Design is one such technique you might find useful.