Method classes and execution classes

Source: Internet
Author: User

This is the self-perception, in a program software, we will have a lot of classes to create and call

There are many classes, which can be divided into detailed separate modules, which are in charge of different functions, such as string,list,dictionary, which provide different morphological descriptions as basic data classes.

But there are some classes that interact with each other, in essence, these classes can actually be summed up as a class, but they are interrelated too many concepts, may involve more than 10 or even dozens of, so need to classify the description, in order to reduce complexity, while reducing complexity, We expect the interactions of these classes to be quicker and quicker. Not lengthy.

In the execution of classes, interfaces, delegates, and events are created to reduce the coupling characteristics, but they do add to the complexity of class action.

such as the following example.

class a{    b b;      Public void Adoing () {B.do();}} class b{    A;      Public void  Do () {}}// The example in a B contains a reference to each other, and the A.adoing method invokes the method of B. This example looks very simple and clear.

If you want to reduce the coupling characteristics, it must be triggered by events and delegates!

Method classes and execution classes

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: info-contact@alibabacloud.com 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.