| Ignoring the fact that Person is clearly a subclass of Mammal, I like this. 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? |
Well, of course we'll need to use multiple inheritance. :-)
we should consider discarding the Suable typeclass
I would recommend keeping it as an interface definition, to make clear that it is a logically distinct thing; LegalEntity would just implement the interface.
Will the constitution refer to Person, or to LegalEntity?
Depends on the context, I would think. Sounds like we'll need plenty of coders to make this work... :-)
Why can't all LegalEntities be acted upon in the same way?
Obviously we haven't defined all the relevant interfaces and subclasses :-). The one you're looking for here is Jailable, which evidently would be implemented by Person but not Company, and so would not be implemented in the LegalEntity base class.
Obvious next question: what language do we start the implementation in? I vote for Python. Anyone for starting a github project?