MVC Architecture

1,055 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,055
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
37
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

MVC Architecture

  1. 1. MVC Architecture The Model-View-Controller (MVC) design pattern assigns objects inan application one of three roles. Model Object. View Object. Control Object. The pattern defines not only the roles objects play in the application, it defines the way objects communicate with each other. MVC is central to a good design for a Cocoa application.
  2. 2. AdvantagesMVC is central to a good design for a Cocoa application.The benefits of adopting this pattern are numerous. Many Objects are reusable. Reusability of the code. Applications which implemented MVC design are more extensible than the other applications. Many Cocoa technologies and architectures are based on MVC.
  3. 3. Model ObjectsModel Objects define the logic and computation thatmanipulate and process the data.For example, a model object might represent a characterin a game or a contact in an address book.
  4. 4. View objectsA view object is an object in an application that users cansee.A view object knows how to draw itself and can respond touser actions.A major purpose of view objects is to display data from theapplication’s model objects and to enable the editing ofthat data.
  5. 5. Controller ObjectsA controller object acts as an intermediary between one ormore of an application’s view objects and one or more ofits model objects.
  6. 6. Example
  7. 7. Data TypesChar --characterInt ---- Integer no decimalsFloat--- Single precision floating point numberDouble--Double precision floating point numberLong--- for long integersBOOL---YES Or NO.
  8. 8. OperatrorsWhat is an operator? In a Math program an operator indicates the action performed in a equation For Example 4+5 = 9 here + and = is called the operation.
  9. 9. Arithmetic More Operators+ -- Addition-  Subtraction* -- multipication/ ---Division% -- Modulo
  10. 10. Relational and Equality Operators==  equals!= -- > not equals> --- > greater< -- less than>=  Greater than or equal to<= Less than or equal to
  11. 11. Logical Operators! - NOT&&  Logical AND||  Logical OR
  12. 12. Control Statements and LoopsIf conditionIf else conditionFor loopWhile loopDo whileJump statements

×