I don't understand where I went so wrong.
|As far as I can tell that's the first time.|
As far as I can tell it was the fourth time...
|After asking if there's a language that solves this problem without the use of a design pattern, then asking about design patterns in other languages, one might assume you meant languages other than the (possible) one in your first question. C++ would be one of those, and it certainly looks like you were asking for a design pattern.|
I gave the thread a title...
|Then I suppose I'm not sure what the problem you have is. Just use the 'C' classes everywhere and if a B is needed somewhere then you can just pass it and inheritance will take care of turning it into a B for you.|
How can you do that when you don't control the construction of the objects? They already exist...
Coordinate following the behavior design pattern. If one of the devs doesn't do anything in his code to support behaviors...
|Yah I don't see what has to be coordinated between 3 devs, perhaps an example of what each developer is responsible for (using your minecraft case) ?|
None of the developers should have to be responsible for anything...
|In any case I disagree that a feature should be included simply to standardize a single case. The other 2 devs should follow the standard/method used by the first.|
It's the first two devs that, without this feature, would have to follow the standard/method used by the third...
|I found the opening post a bit difficult to follow, but if I understand correctly you were asking if there are languages which allow you change the behavior of object instances dynamically.|
You seemed to describe something close to what I was looking for, but seeing what Actor languages are doesn't seem anything close to what I was asking for. Thank you for at least suggesting a language as I originally asked...
|m4ster r0shi wrote:|
|Maybe Lua  is what you're looking for.|
That's really nifty! I am familiar with LUA. Unfortinately, it's not a language featue that you have shown, but a design pattern...
|Imagine that you pass a pointer to an object that does perfectly what you want to a function and all of a sudden it does something else! The consequences would be that programming becomes a game of pure chance|
Java has a concept of a final class; one which cannot be extended by other classes. This feature alone would be enough to resolve your proposed problem. A simple contract that says "do no more than this." Maybe it could even be per-instance.
I'm really confused how I cam across so unclear. I thought that by specifying what I was looking for in the thread title and in the post, plus a one-use fallback in the post, I could perchance get the attention of someone who happened to know more than me and happened to know of such a language. Instead, I got the single-use fallback a multitude of times in various languages.
I've decided such a language must not exist for the feature in it to be so confusing and unheard of that only design patterns could allow for it.
And in case it still is not clear, I was looking for an entire language that had the feature I described as a built-in language feature, not as a design pattern. Design patterns solve problems that languages don't solve, and considering I gave specific emphasis to looking for a language, I don't feel bad for hammering on the design patterns you all gave.
Thank you for your time, everyone, and sorry for wasting it.