当前位置:网站首页>Usage of delegate
Usage of delegate
2022-07-28 02:35:00 【Rabbit cloud program】
background

delegate It literally means to entrust , representative , The representative of the meeting , to grant authorization , School selection . Many client engineers should be familiar , Especially the processing interface UI when , stay UI Library source code is often encountered , You may jump out MVC Pattern , Or there is this usage in other design patterns . Using them correctly can easily make complex pages concise 、 distinct .
Commission Overview
Dynamically associate the method caller with the target method , A delegate is a class , So it is peer to class , You can use methods through delegation , Don't mistakenly think that delegation and method are at the same level , Methods are just members of classes . Delegates define the type of method ( Defining a delegate and its corresponding method must have the same number of parameters , And of the same type , The return value type is the same ), Make it possible to pass a method as an argument to another method , This method is dynamically assigned to parameters , Avoid extensive use in programs If-Else(Switch) sentence , At the same time, the program has better scalability .
About MVC
I Believe C# developer ,Java developer ,Android developer ,IOS Developers will be exposed to MVC framework .MVC Among them M Express model business model ,V Is said view The user interface ,C Express controller controller . Use MVC The goal is to M and V Implementation code separation of , So that the same program can use different forms of expression . among View The definition of , It's the user interface .
In fact, it's just Subdivide the business logic and controller To draw
边栏推荐
- 网络必知题目
- mysql 如图所示,现有表a,表b,需求为 通过projectcode关联a、b表,查出address不同的 idcardnum。
- Necessary knowledge points of the original group
- [solution] solve the problem of SSH connection being inactive for a long time and being stuck and disconnected
- Digital empowerment and innovation in the future: hese eredi appears at the 5th Digital China Construction Summit
- Get the difference data of two sets
- 基于stm32的恒功率无线充电
- [advanced ROS] Lecture 9 robot model motion based on rviz and arbotix control
- Deep understanding of recursion
- Leetcode hot topic Hot 100 - > 3. longest substring without repeated characters
猜你喜欢

Say yes, I will love you, and I will love you well

AWS elastic three swordsman

Learn this trick and never be afraid to let the code collapse by mistake

MYSQL解决死锁之路 - 常见 SQL 语句的加锁分析

这个操作可能不值钱,但却值得学习 | 【图片批量裁剪】

Canvas 从入门到劝朋友放弃(图解版)

When iPhone copies photos to the computer, the device connection often fails and the transmission is interrupted. Here's the way

retainface使用报错:ModuleNotFoundError: No module named 'rcnn.cython.bbox'

Two ways for wechat applet to realize dynamic horizontal step bar

Soft test - database (2) relational model
随机推荐
关于Sqli-labs单引号不报错的问题
Canonical Address
Pytorch optimizer settings
[advanced ROS] Lecture 9 robot model motion based on rviz and arbotix control
Necessary knowledge points of software engineering
软工必备知识点
Ceresdao: the world's first decentralized digital asset management protocol based on Dao enabled Web3.0
Today in history: the father of database passed away; Apple buys cups code; IBM chip Alliance
The virtual host website cannot access the self-test method
怎么简单实现菜单拖拽排序的功能
实际工作中,我是如何使用 Postman 做接口测试?
When iPhone copies photos to the computer, the device connection often fails and the transmission is interrupted. Here's the way
基于FPGA的64位8级流水线加法器
what‘s the meaning of “rc“ in release name
0动态规划中等 LeetCode873. 最长的斐波那契子序列的长度
Lombok prompts variable log error when using JUnit test in idea
APP如何上架App Store?
MySQL high availability and master-slave synchronization
Achievements in science and Technology (XXVIII)
In practical work, how do I use postman for interface testing?