Re: Type variants
| From: | Michael Vostrikov | Date: | Sun, 12 Mar 2017 10:29:15 +0000 |
| Subject: | Re: Type variants | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-98502@lists.php.net to get a copy of this message | ||
2017-03-12 14:58 GMT+05:00 Fleshgrinder <php@fleshgrinder.com>:
> The problem you are facing is that you are dealing with an anemic domain
> object that does not enforce its own invariants.
>
Incomlplete order with date and address not set yet is a valid state of
order.
Also, there are many cases when logic which includes many objects is placed
in a service and not in any of that objects.
> However, you do not require new features to do that.
I don't tell that we cannot make that with current features. I suggest a
way to do that more easy. This is like type hinting. We can check types
manually by calling functions like is_integer() or get_class(), but we
don't have a question why we need to have type hinting in language.