3 ms·
I think the idea is that domain logic is encapsulated in functions, while the objects themselves only contain metadata. So if you have an class of objects named
by vinceguidry 13y ago
I think the idea is that domain logic is encapsulated in functions, while the objects themselves only contain metadata. So if you have an class of objects named 'COW', then the objects themselves will contain information about cows. If you simply delete the object, the cow will still exist.
However, if you run a function called, "slaughter_cow", then that should actually do something, maybe it will mark that cow for slaughter. Running functions should have real-world effects, directly manipulating data objects won't. (except maybe to cause confusion)
- taeric 13y agoBut this really just falls into the "no true Scottsman" fallacy, doesn't it? I mean, running a function called "slaughter_cow" that will only "mark that cow for slaughter" it is misnamed in some sense. Same for any function. Unless what you are doing is fully abstract in the first place, than any abstraction over it will in many senses be a lie.
- vinceguidry 13y agoThe worker who got the message on the screen slaughters the cow, how can you not consider the worker and his process part of the code as well?