Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

CrossApp's MVC mode


May 21, 2021 CrossApp


Table of contents


Introduction to MVC mode
There is no very clear concept about MVC patterns, and designs can differ in different development environments.

The object-oriented goal is to design low-coupled, high-aggregate programs, and MVC mode provides a good solution. CrossApp is based on the MVC pattern, where the MVC is the Model layer, the View layer,the control layer (Controller), all of which do their part to maintain a complete application.

CrossApp's MVC mode

The Model layer in CrossApp is our various data prototypes, business logic, and algorithms, and the View layer, as the name implies, is the UI interface that is presented to the user, while the Controlr layer is responsible for connecting the two less interrelated layers of Model and View. CrossApp implements the view layer through CAView and rich UI controls, and the Controller layer is accomplished together through CAViewController and its sub-classes, allowing communication between Model and View.

The View layer and the Model layer typically do not communicate directly, and the View layer receives the user's actions and notifies Controller of the actions, and Controller updates the Model layer when it receives a message. Similarly, when data at the Model layer changes, Notify Controller that the View layer is updated with the interface.


How to develop an app using CrossApp

The necessary preparations for developing a mobile app using CrossApp can be referred to the following steps:

CrossApp's MVC mode

1. Download the source code http://crossapp.9miao.com/Home/List/index/cid/3.html CrossApp from crossApp's website and unzip it to your local computer. The following is the directory structure for CrossApp decompression

CrossApp's MVC mode

2. Pre-development environment configuration, detailed description of the environment configuration on CrossApp's official website, reference instructions for pre-development environment configuration, in order to develop and export the installation package for each platform.

3. Once the above two steps are complete, we can start our app development now, starting with a new CrossApp project of our own, and also explaining in the environment configuration document how to use the command line to create a new CrossApp project and run the .sln file under proj.win32 to run our new project

4. Reference to CrossApp's API documentation allows us to develop cross-platform applications, and then our own encoding usually starts with the AppDelegate class, with specific usage examples that can be used using the Demo example on CrossApp's official website.