|
|
|
|
|
by pdonis
4912 days ago
|
|
have Company implement the Person typeclass The obvious solution is to factor out a base class, LegalPerson, with some but not all of the behaviors of the existing Person class. Then derive a separate Company class from LegalPerson. All the stuff we don't want corporations to have, we leave in the existing Person class, so Company doesn't have it. create a new Suable typeclass I would view "Suable" as an interface implemented by LegalPerson, and inherited by Person and Company. LegalPerson obviously has to implement lots of interfaces. :-) |
|
A couple comments:
- the name LegalEntity feels better to me. (I think it's less likely to be confusing to the lawgrammers who'll be maintaing the code).
- Once we have LegalEntity in place, we should consider discarding the Suable typeclass -- it looks to me like LegalEntity perfectly describes what we're looking for.
There's still a lot of refactoring to be done (I still can't believe the CA Vehicle Code considers a person "a natural person, firm, copartnership, association, limited liability company, or corporation."), but now that the types have been cleared up we have a good foundation to move towards.
Things we should consider going forwards:
- Will the constitution refer to Person, or to LegalEntity? ("new Person() == new Person()" has a nice ring to it if you ask me)
- Why can't all LegalEntities be acted upon in the same way? (Some Legal entities can be put in jail for instance). Is there a type we are missing?