Model-View-Controller design pattern

I just picked up Advanced ActionScript 3 with Design Patterns, and I’m very interested in the [URL=“http://java.sun.com/blueprints/patterns/MVC-detailed.html”]Model-View-Controller pattern. If any of you know what that is, I’d like to talk with you folks about it.

In my latest project I have inadvertently applied the MVC design pattern. My Model class has getters that return data to the caller (which is most often one of my View classes’ methods) after validating and formatting it. People who document the MVC pattern typically assume that the data being passed in this way is of some kind of basic type, and that the getter is called infrequently. In my case, the Model class passes BitmapData objects (complex), dozens of times per second (frequent).

This raises an interesting issue. My Model object is unaware and independent of the View and Controller classes. But when the Model passes a reference to some of its data to the other classes, because that data is of type BitmapData, other classes can modify the data that’s in the Model. I can prevent this by subclassing BitmapData and overriding its methods and properties, so that only an instance of my Model class can edit it. One could argue that my Model could simply pass a clone of the BitmapData object through the getter, but due to technical constraints I cannot expect that kind of code to run smoothly on most machines.

But is all this protection necessary? Is it the “responsibility” of the Model to prevent other classes from tampering with its data? If I give my Model instance to some other system, shouldn’t I be bothered if the other system modifies the Model’s data in this way?