Hacker News new | past | comments | ask | show | jobs | submit login

> I'd say inheritance is NOT a good use-case for Person / Employee

Good call. If I wanted Person distinct from Employee, how I'd probably start, in an analysis model, is have Employment as an association/relationship between Person and Company.

In my meta-model, associations like Employment can have attributes, and that might be where things like "employee number" and "salary" come in.

And, taking that a little further, we can represent the history of how things like salary change over time.

(Meanwhile, a project that went with only an Employee record/object might not have saved any coding time initially, and they're quickly piling on expensive, hard-to-maintain kludges, just to meet evolving business needs. Even the first time an employee got a raise, they might've already been hitting incorrectness cases, just trying to get two parts of the system to use the right salary for the right time.)




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: