Model-View-Controller (MVC) Design Pattern Quiz

LegendaryDecagon avatar
LegendaryDecagon
·
·
Download

Start Quiz

Study Flashcards

38 Questions

What manages one instance of the app's UI, including one or more windows displayed from that scene?

UIWindowScene

Which object is responsible for managing the life cycle of one instance of the app's user interface?

UISceneDelegate

What type of objects store an app's content and are specific to each app?

Document objects

Which objects manage the presentation of an app's content on screen?

View Controller objects

If an app supports scenes, what delivers separate life-cycle events for each scene?

UIKit

What is responsible for handling the initial routing of incoming user events in an iOS app?

UIApplication object

Which object is considered as the root object of an iOS app and manages shared behaviors?

AppDelegate class

What does UIWindow do in an iOS app with respect to view controllers?

Provides a main window to display app's content

Which object is responsible for creating additional windows in an iOS app as needed?

UIWindowSceneDelegate

What is the main role of the UIWindowSceneDelegate in an iOS app?

Create additional windows for displaying content

What does the UIApplicationMain function do during the app startup process?

Creates core objects of the app and loads the user interface from storyboard files

What does the UIWindowScene delegate do in iOS 13 and later?

Assigns the initial view controller instance to the window's rootViewController property

Which method is called by UIApplicationMain during the app launch process?

application(_:didFinishLaunchingWithOptions:)

What does the UISceneSession represent in iOS app development?

Creates and manages scenes in an iOS app

Which object serves as the shared application instance in an iOS app?

UIApplication

What delivers all life-cycle events to the UIApplicationDelegate object in iOS 12 and earlier, and in apps that do not support scenes?

UIApplication object

Which file contains metadata about the app in iOS and is used by the system to interact with the app?

Info.plist file

What must every app declare to specify the hardware capabilities or features that it requires to run?

App's required capabilities

What does Xcode automatically create based on the project's configuration and settings?

Info.plist file

When an iOS app is launched, what does the system display as a temporary screen until the app can show its user interface?

Launch Screen

What is the role of controller objects in an application?

Interpret user actions and communicate data to the model layer

How do view objects in a Model-View-Controller (MVC) architecture learn about changes in model data?

Through the application's controller objects

What is one of the tasks performed by controller objects in an application?

Manage the life cycles of other objects

In Model-View-Presenter (MVP), what does the presentation layer decide?

What to be displayed on the view

How does Model View Presenter (MVP) pattern differ from Model-View-Controller (MVC) pattern?

MVP separates view layer from business logic layer

Which role is responsible for encapsulating the data specific to an application and defining the logic and computation that manipulate and process that data?

Model

In the MVC design pattern, the Controller acts as an intermediate between which two components?

Model and View

Which part of an application is more easily extensible when it is designed using the MVC pattern?

Applications with MVC design

In the context of MVC, which component would be responsible for updating the screen after a user action like sending a message?

Controller

What is the main function of a Model object in an application following the MVC pattern?

Processing data

Which component in the MVC/MVP architecture handles user interaction like click listeners?

View

In MVC/MVP architecture, which layer acts as the middle layer between the View and Model layers?

Presenter

Which component of the MVC/MVP architecture is responsible for describing the main logic of the application and deciding from where the data should be fetched?

Model

What makes Models and Views reusable in MVC/MVP architecture?

Separation of code

Which component in MVC/MVP is NOT much dependent on the View and does not contain UI components?

Presenter

What role does the View play in the MVC/MVP architecture?

UI rendering and user interaction handling

Which layer of the MVC/MVP architecture is responsible for fetching data from the model and presenting it in a user-friendly format?

Presenter

Why is an application easier to maintain and extend over time when following MVC/MVP architecture?

Separation of concerns

Study Notes

UI Management

  • One instance of the app's UI is managed by a scene, which includes one or more windows displayed from that scene.
  • The object responsible for managing the life cycle of one instance of the app's user interface is the view controller.
  • Content is stored in view objects, which are specific to each app.

Scene Management

  • If an app supports scenes, the UIWindowScene delivers separate life-cycle events for each scene.
  • The UIApplicationMain function delivers all life-cycle events to the UIApplicationDelegate object in iOS 12 and earlier, and in apps that do not support scenes.

App Startup

  • During the app startup process, the UIApplicationMain function creates a shared application instance and sets up the app's UI.
  • The UIWindowScene delegate is responsible for handling the initial routing of incoming user events in an iOS app.

UIWindow

  • A UIWindow is responsible for creating additional windows in an iOS app as needed.
  • UIWindow is responsible for managing the presentation of an app's content on screen.

UIApplication

  • UIApplication is the shared application instance in an iOS app and manages shared behaviors.
  • The UIApplicationMain function is called during the app launch process to create the app's UI.

App Metadata

  • The Info.plist file contains metadata about the app in iOS and is used by the system to interact with the app.
  • Every app must declare the hardware capabilities or features that it requires to run in the Info.plist file.

App Launch

  • When an iOS app is launched, the system displays a temporary screen, known as the launch screen, until the app can show its user interface.

Model-View-Controller (MVC) Architecture

  • Controller objects are responsible for encapsulating the data specific to an application and defining the logic and computation that manipulate and process that data.
  • View objects learn about changes in model data through the controller objects.
  • Controller objects act as an intermediate between the model and view components.
  • The model is responsible for describing the main logic of the application and deciding from where the data should be fetched.
  • The view is responsible for presenting the data in a user-friendly format.
  • The controller is responsible for updating the screen after a user action.

Model-View-Presenter (MVP) Architecture

  • The presentation layer decides how to present the data in the MVP architecture.
  • MVP differs from MVC in that the presenter acts as an intermediate between the model and view components.
  • The model is responsible for encapsulating the data specific to an application and defining the logic and computation that manipulate and process that data.
  • The view is responsible for presenting the data in a user-friendly format.
  • The presenter is responsible for fetching data from the model and presenting it to the view.

Benefits of MVC/MVP Architecture

  • The application is easier to maintain and extend over time when following the MVC/MVP architecture.
  • Models and Views are reusable in MVC/MVP architecture.
  • The controller/presenter acts as a middle layer between the View and Model layers, making it easier to change the UI or business logic without affecting the other layers.

Test your knowledge on the Model-View-Controller (MVC) design pattern used in applications. Understand which role to focus more on based on user actions. Learn how MVC design makes applications more extensible and how many Cocoa technologies are based on MVC architecture.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

More Quizzes Like This

Model Exam Revision Quiz
5 questions
Model for Stress and Disease
30 questions
Use Quizgecko on...
Browser
Browser