MVC (Model View Controller) - issues

I am working with MVC in actionscript 3 and have run into some issues:

I am creating a galleryView in the document class of my application. Inside this galleryView I have several other related views - a imageDisplayView and a thumbnailView. I am having some problems deciding how to compose the views into one another.

At present I am using the Composite Pattern to add imageDisplayView and thumbnailView as childComponents of galleryView, and then calling the galleryView update method from the main class, when the model is updated, from which the galleryView loops through and updates imageDisplayView and thumbnailView.

I have read an advanced book on design patterns (actionscript 3.0), and all the examples in the book for MVC instruct me to create the galleryView, mageDisplayView and thumbnailView in the Document class, and then add() imageDisplayView and thumbnailView to the galleryView from the Document class.

This is fine for one application, but if I have several applications in my Document class, and have to create and add every view for each application from the Document class, the Document class would contain a massive amount of code.

My question is, is it ok (or right) to compose all views in the document class, or can I create a galleryView in the document class, and then inside the galleryView class, create ‘sub-views’ of that view - i.e. imageDisplayView and thumbnailView?

How should views be composed when you have several Main views that each hold their own sub-views?

Any help would be greatly appreciated…

:slight_smile:

T.