DISCUSS ANYTHING & EVERYTHING: Money, Dating, Health, Internet, Legal, Jobs, People, Places and more

Sponsored Links

Members Login
Username 
 
Password 
    Remember Me  
Chatbox
Please log in to join the chat!
Post Info TOPIC: Action script 3.0


Member

Status: Offline
Posts: 8
Date:
Action script 3.0
Permalink   
 


MVC Design Pattern in AS3

 

“Model-view-controller (MVC) is an architectural pattern used in software engineering. Successful use of the pattern isolates business logic from user interface considerations, resulting in an application where it is easier to modify either the visual appearance of the application or the underlying business rules without affecting the other. In MVC,

The model represents the information (the data) of the application and the business rules used to manipulate the data;

The view corresponds to elements of the user interface such as text, checkbox items, and so forth;

The controller manages details involving the communication to the model of user actions such as keystrokes and mouse movements.”

 

The MVC Design Pattern

  • Creates a separation of Class roles
  • Adds a clear and logical communication structure
  • Increases flexibility in larger applications

Model
    Handles data storage and retrieval (eg. Store character x position)
View
    Handles the display/communication (eg. Position character on stage)
Controller
    Handles most the of the application logic (eg. Get current x position)

MVC – basic structure
Each model can have multiple views
Each view has at least one matching controller
Creates a separation between form, content and action
The model becomes the base of the application

 MVC.png

Sample Game:-

 

Aim:-

 

A Square with randomly changed color when button was pressed

 

 

Architecture:-

 

MVC+Design.png



__________________

Play ,Win & Earn

zopy games

Page 1 of 1  sorted by
Quick Reply

Please log in to post quick replies.

Tweet this page Post to Digg Post to Del.icio.us