>
It'd be nice if you told us what code you're referring to. I've been giving examples and rough technical outlines how I'd handle problems that needed code sharing. So far you've given us zilch but naysaying.Sorry, why the complaining? We were talking on a more abstract level. Yourself just gave some anecdote about "Someone did this on a project I work on (C#). Utter nightmare. Loads of repeated code as new programmers didn't know methods existed, loads of extraneous DTO objects, lots of nested single line methods, massive code bloat", that's hardly an example either.
>I've never had to write identical code on an Order class as a Person class. Can you give me an example of 90% of the logic being the same on an Order and a Person class?
Apart from the data contained without, which process would not be the same? Most high level operations would be exactly the same: filtering would be the same (it just needs to accept a predicate), ordering would be the same, serialization would be the same, etc etc.
For a very simple example, you don't need:
persons.sort("age", sort.DESC)
orders.sort("created_at", sort.DESC)
etc, you just need:
sortedPersons = sort(persons, cur -> cur.age, sort.DESC)
sortedOrders = sort(orders, cur -> cur.created_at, sort.DESC)
And the same function can work with 100s of other classes and containers.