Hacker News new | ask | show | jobs
by barrkel 5866 days ago
Ironically, I don't think OOP was really meant to be used for business objects. I think inheritance doesn't work very well with objects whose backing store needs to fit into a relational database someplace.

OO really shines with UI programming, where incrementally building up behaviour through inheritance makes a lot of sense.

1 comments

If the classes in your system vary a lot in behavior but not in their internal state then mapping to a database can be straightforward.

With lots of variations in object structure things can be horrible - witness designs that have more tables than most tables have rows.

> With lots of variations in object structure things can be horrible - witness designs that have more tables than most tables have rows.

This is the problem document databases are designed to solve. :)

Maybe someone should create an ERP system based on one then!