Beginner's understanding and questions about MVC...

Source: Internet
Author: User
M indicates data.
V indicates the view, which is displayed.
C Represents data operations.

For example:
Class M
// Store data
Int X;

Class V
// Screen Display
Void draw ();

Class C
// Read data
Void loaddata ();

V c inevitably uses M data, But how do they relate to M.
Add a pointer to m in v c?
M * data;
Void setdata (M * aData ).

In this way, all v c instances must be added as above.CodeAt the same time, if another class is added to v c and the class uses M data,
This is not to add the above Code to the newly added class... it causes trouble.

I don't know if the MVC mode is used in this way. How can I design it to meet the above usage?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.