MVC Architecture
-
Upload
prasanna-venkatesh -
Category
Technology
-
view
300 -
download
3
Transcript of MVC Architecture
MVC Architecture The Model-View-Controller (MVC) design pattern assigns objects in an 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.
Advantages
MVC 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.
Model Objects
Model Objects define the logic and computation that manipulate and process the data.
For example, a model object might represent a character in a game or a contact in an address book.
View objects
A view object is an object in an application that users can see.
A view object knows how to draw itself and can respond to user actions.
A major purpose of view objects is to display data from the application’s model objects and to enable the editing of that data.
Controller Objects
A controller object acts as an intermediary between one or more of an application’s view objects and one or more of its model objects.
Example
Data Types
Char --character
Int ---- Integer no decimals
Float--- Single precision floating point number
Double--Double precision floating point number
Long--- for long integers
BOOL---YES Or NO.
Operatrors
What 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.
Arithmetic More Operators
+ -- Addition
- Subtraction
* -- multipication
/ ---Division
% -- Modulo
Relational and Equality Operators
== equals
!= -- > not equals
> --- > greater
< -- less than
>= Greater than or equal to
<= Less than or equal to
Logical Operators
! - NOT
&& Logical AND
|| Logical OR
Control Statements and LoopsIf condition
If else condition
For loop
While loop
Do while
Jump statements