CN111176632A - Method for building iOS end response type development framework - Google Patents

Method for building iOS end response type development framework Download PDF

Info

Publication number
CN111176632A
CN111176632A CN202010002721.1A CN202010002721A CN111176632A CN 111176632 A CN111176632 A CN 111176632A CN 202010002721 A CN202010002721 A CN 202010002721A CN 111176632 A CN111176632 A CN 111176632A
Authority
CN
China
Prior art keywords
event
observer
ios
development framework
publisher
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010002721.1A
Other languages
Chinese (zh)
Inventor
单文政
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Inspur Genersoft Information Technology Co Ltd
Original Assignee
Shandong Inspur Genersoft Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Inspur Genersoft Information Technology Co Ltd filed Critical Shandong Inspur Genersoft Information Technology Co Ltd
Priority to CN202010002721.1A priority Critical patent/CN111176632A/en
Publication of CN111176632A publication Critical patent/CN111176632A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention particularly relates to a building method of an iOS end response type development framework. The building method of the iOS end response type development framework comprises the steps of firstly creating an IIRXCore core class, namely a basic class object definition, then creating an IIRXcomponent combined component, and finally creating an IIRXcomponent filtering and transforming component. The method for building the response type development framework at the iOS end not only enables the MVVM to be better applied to the iOS platform, the bidirectional and unidirectional binding of a data source is simpler, the learning cost of the original response type development framework is reduced, the cohesiveness of UI control codes is improved, the maintainability of UI layer codes is improved, the difficulty of original code debugging is simplified, and the number of layers of codes written by non-developers such as system functions, library functions and the like in a stack is reduced.

Description

Method for building iOS end response type development framework
Technical Field
The invention relates to the technical field of computer application, in particular to a building method of an iOS end response type development framework.
Background
As the mobile terminal traffic volume increases, the code volume of the mobile terminal APP also increases exponentially. In order to solve the problem, technical personnel introduce an MVVM framework, and reusability and maintainability of codes are improved.
However, the iOS native solution (close & Block) does not support MVVM well, and in order to increase the code polymerization degree of UI controls in iOS codes, increase maintainability, and reduce the difficulty of use, a responsive development framework is urgently needed to solve the problem. However, the existing responsive development frameworks such as reactvecocoa and RxSwfit have complex concepts and complex mathematical models, so that the learning cost and the debugging cost are high.
Aiming at the situation, the invention provides a building method of an iOS end response type development framework.
Disclosure of Invention
In order to make up for the defects of the prior art, the invention provides a simple and efficient method for building the iOS end response type development framework.
The invention is realized by the following technical scheme:
a building method of an iOS end response type development framework is characterized in that: the method comprises the following steps:
first, the IIRXCore core class, i.e., the underlying class object definition, is created
The method comprises the steps that a bidirectional linked list data structure is used for replacing an original bidirectional notification mode, and basic data objects and structures are built; the basic class object definition comprises an Observer (Observer), an observed person (Observer) and a Publisher (Publisher);
second, create IIRXComponent composite component
Defining Combine, Zip and Merge type keywords; original multiple observed persons (observer) can be merged into one observer (observer) through three keywords of combination, Zip and Merge;
third, create IIRXComponent Filter and transform Components
Defining keys of Filter, Skip, Map, Flatmap and group pBy types, and filtering, iterating, compressing and iterating the events in the event stream through the keys.
The observed person (Observer) is a linked list node object which is used as the source of the event chain (the head of the linked list), and can send the event to the Observer (Observer); and the observed person (Observer) can be monitored by one or more observers (observers), and maintains a list of the observers (observers), and when the observed person (Observer) has a new data source, the list of the observers (observers) is traversed, and an event is sent to each Observer (Observer).
The Observer (Observer) is a linked list node object which is used as a receiver (tail of the linked list) of the event chain and is used for receiving the event sent by the observed Observer (Observer); meanwhile, the Observer (Observer) needs to maintain a father node, namely, the sender of the event that the Observer (Observer) needs to monitor; when the current node is destroyed, the Observer (Observer) needs to release the reference relationship with the observed person (Observer).
The Publisher (Publisher) is an intermediate node of a two-way linked list, and can be used as an Observer (Observer) or an observed person (Observer); the Publisher (Publisher) as an Observer (Observer) maintains a father node information for receiving events; meanwhile, as an observed person (Observer), the Publisher (Publisher) maintains a list of observers (observers), and when the Publisher (Publisher) receives the information, the traversal list sends an event to each Observer (Observer).
The keywords Merge, Zip and Combine may Merge event streams of multiple observed persons into one event stream to be sent out; and meanwhile, a Publisher (Publisher) node type is independently created, the type node maintains an observed person list (a special observer with the number of father nodes larger than 1), and when any father node sends event information, the type node sends an event information signal to the next node according to a specific rule.
In the third step, the unwanted event sources are separated by filtering; performing special operation by iterating and traversing each event; and compressing the event source into single data source information in a data stream format through a compression iteration process.
The keyword Filter is realized by setting a Filter block (block), participates in an original event, and returns a function body of a custom type;
the keyword Map is similar to the keyword Filter, defines a block (block), and refers to an event according to a certain rule.
The key Skip is used to Skip the first N events of the source sequence.
When the key Map performs the dimension-increasing operation on the event object and the data stream is used as the source of the event, the key FlatMap compresses the data stream object into a simple one-dimensional event.
And the keyword GroupBy carries out grouping operation on the events according to rules.
The invention has the beneficial effects that: the method for building the response type development framework at the iOS end not only enables the MVVM to be better applied to the iOS platform, the bidirectional and unidirectional binding of a data source is simpler, the learning cost of the original response type development framework is reduced, the cohesiveness of UI control codes is improved, the maintainability of UI layer codes is improved, the difficulty of original code debugging is simplified, and the number of layers of codes written by non-developers such as system functions, library functions and the like in a stack is reduced.
Drawings
FIG. 1 is a schematic diagram of the core of IIRXCore of the present invention.
FIG. 2 is a schematic diagram of the IIRXcomponent assembly of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the embodiment of the present invention. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The building method of the iOS end response type development framework comprises the following steps:
first, the IIRXCore core class, i.e., the underlying class object definition, is created
The method comprises the steps that a bidirectional linked list data structure is used for replacing an original bidirectional notification mode, and basic data objects and structures are built; the basic class object definition comprises an Observer (Observer), an observed person (Observer) and a Publisher (Publisher);
second, create IIRXComponent composite component
Defining Combine, Zip and Merge type keywords; original multiple observed persons (observer) can be merged into one observer (observer) through three keywords of combination, Zip and Merge;
third, create IIRXComponent Filter and transform Components
Defining keys of Filter, Skip, Map, Flatmap and group pBy types, and filtering, iterating, compressing and iterating the events in the event stream through the keys.
The observed person (Observer) is a linked list node object which is used as the source of the event chain (the head of the linked list), and can send the event to the Observer (Observer); and the observed person (Observer) can be monitored by one or more observers (observers), and maintains a list of the observers (observers), and when the observed person (Observer) has a new data source, the list of the observers (observers) is traversed, and an event is sent to each Observer (Observer).
The Observer (Observer) is a linked list node object which is used as a receiver (tail of the linked list) of the event chain and is used for receiving the event sent by the observed Observer (Observer); meanwhile, the Observer (Observer) needs to maintain a father node, namely, the sender of the event that the Observer (Observer) needs to monitor; when the current node is destroyed, the Observer (Observer) needs to release the reference relationship with the observed person (Observer).
The Publisher (Publisher) is an intermediate node of a two-way linked list, and can be used as an Observer (Observer) or an observed person (Observer); the Publisher (Publisher) as an Observer (Observer) maintains a father node information for receiving events; meanwhile, as an observed person (Observer), the Publisher (Publisher) maintains a list of observers (observers), and when the Publisher (Publisher) receives the information, the traversal list sends an event to each Observer (Observer).
The keywords Merge, Zip and Combine may Merge event streams of multiple observed persons into one event stream to be sent out; and meanwhile, a Publisher (Publisher) node type is independently created, the type node maintains an observed person list (a special observer with the number of father nodes larger than 1), and when any father node sends event information, the type node sends an event information signal to the next node according to a specific rule.
In the third step, the unwanted event sources are separated by filtering; performing special operation by iterating and traversing each event; and compressing the event source into single data source information in a data stream format through a compression iteration process.
The keyword Filter is realized by setting a Filter block (block), participates in an original event, and returns a function body of a custom type;
the keyword Map is similar to the keyword Filter, defines a block (block), and refers to an event according to a certain rule.
The key Skip is used to Skip the first N events of the source sequence.
When the key Map performs the dimension-increasing operation on the event object and the data stream is used as the source of the event, the key FlatMap compresses the data stream object into a simple one-dimensional event.
And the keyword GroupBy carries out grouping operation on the events according to rules.
Compared with the prior art, the construction method of the iOS end response type development framework has the following characteristics:
firstly, a calling function and a callback function of an original UI control can be distributed into different functions, so that reading and maintenance are difficult; the iOS-side responsive development framework usage and callback can be stored in the same code function. The complex, obscure and distributed callback function call of the iOS terminal can be eliminated, so that the cohesiveness of the use function and the response function of the UI control is higher, and the UI control is convenient to read and maintain.
Secondly, Block (Objective-c name) or close (Swift language name) and the like are originally needed to be matched with the MVVM, the code amount is large, the concept is unclear, the code specification can not be unified, and bidirectional and unidirectional data binding can be realized through simple codes by using the iOS end response type development framework; therefore, the iOS end response type development framework is combined with the existing MVVM framework for use, and the characteristics and the usability of the MVVM can be better reflected.
Third, the iOS-side responsive development framework uses a doubly linked list data structure to abstract observers from observed ones. The observed person is a head of a linked list, the observer is a Node of the linked list, and the observer can also be used as the observed person and subscribed and monitored by other observers; compared with the existing responsive development framework, the obscure concepts of many existing responsive development frameworks are abandoned through the linked list data structure, so that the concepts are simpler and more popular and understandable, and the previous concepts of cold signals and hot signals are reduced, thereby greatly reducing the learning cost and the debugging cost.
Fourth, the debugging cost of the previous responsive development framework is very high, usually two close user method call stacks are separated by internal function calls of a plurality of responsive function development frameworks, functions which should be transparent to developers can be displayed, and the problem of difficulty in debugging is solved by the iOS-end responsive development framework through a data structure of a doubly linked list.
The construction method of an iOS-side responsive development framework in the embodiment of the present invention is described in detail above. While the present invention has been described with reference to specific examples, which are provided to assist in understanding the core concepts of the present invention, it is intended that all other embodiments that can be obtained by those skilled in the art without departing from the spirit of the present invention shall fall within the scope of the present invention.

Claims (10)

1. A building method of an iOS end response type development framework is characterized by comprising the following steps:
first, the IIRXCore core class, i.e., the underlying class object definition, is created
The method comprises the steps that a bidirectional linked list data structure is used for replacing an original bidirectional notification mode, and basic data objects and structures are built; the basic class object definition comprises an observer, an observed person and a publisher;
second, create IIRXComponent composite component
Defining Combine, Zip and Merge type keywords; original multiple observed persons can be combined into one observed person through three keywords of combination, Zip and Merge;
third, create IIRXComponent Filter and transform Components
Defining keys of Filter, Skip, Map, Flatmap and group pBy types, and filtering, iterating, compressing and iterating the events in the event stream through the keys.
2. The construction method of the iOS-end-responsive development framework according to claim 1, characterized in that: the observed person is a linked list node object which is used as a source of an event chain and can send an event to the observed person; and the observed person can be listened to by one or more observers, maintains an observer list, and sends an event to each observer by traversing the observer list when the observed person has a new data source.
3. The construction method of the iOS-end-responsive development framework according to claim 1, characterized in that: the observer is a linked list node object which is used as a receiver of an event chain and is used for receiving the event sent by the observed observer; meanwhile, the observer needs to maintain a father node, namely a sender of an event which needs to be monitored by the observer; when the current node is destroyed, the observer needs to release the reference relationship with the observed person.
4. The construction method of the iOS-end-responsive development framework according to claim 1, characterized in that: the publisher is a middle node of the bidirectional linked list, and can be used as an observer or an observed person; the publisher is used as an observer, maintains father node information and is used for receiving events; meanwhile, as an observed person, the publisher maintains a list of observers, and when the publisher receives information, the publisher sends events to each observer through the list.
5. The construction method of the iOS-end-responsive development framework according to claim 1, characterized in that: the keywords Merge, Zip and Combine may Merge event streams of multiple observed persons into one event stream to be sent out; and meanwhile, a publisher node type is independently established, the publisher node maintains an observed person list, and when any father node sends event information, the publisher node sends an event information signal to the next node according to a specific rule.
6. The construction method of the iOS-end-responsive development framework according to claim 1, characterized in that: in the third step, the unwanted event sources are separated by filtering; performing special operation by iterating and traversing each event; and compressing the event source into single data source information in a data stream format through a compression iteration process.
7. The construction method of the iOS-end-responsive development framework according to claim 1, characterized in that: the keyword Filter is realized by setting a Filter block, participates in an original event, and returns a function body of a custom type; the keyword Map is similar to the keyword Filter, defines a block, and transmits an event to and from the block according to a certain rule.
8. The construction method of the iOS-end-responsive development framework according to claim 1, characterized in that: the key Skip is used to Skip the first N events of the source sequence.
9. The construction method of the iOS-end-responsive development framework according to claim 1, characterized in that: and the keyword GroupBy carries out grouping operation on the events according to rules.
10. The construction method of the iOS-end-responsive development framework according to claim 1, characterized in that: when the key Map performs the dimension-increasing operation on the event object and the data stream is used as the source of the event, the key FlatMap compresses the data stream object into a simple one-dimensional event.
CN202010002721.1A 2020-01-02 2020-01-02 Method for building iOS end response type development framework Pending CN111176632A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010002721.1A CN111176632A (en) 2020-01-02 2020-01-02 Method for building iOS end response type development framework

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010002721.1A CN111176632A (en) 2020-01-02 2020-01-02 Method for building iOS end response type development framework

Publications (1)

Publication Number Publication Date
CN111176632A true CN111176632A (en) 2020-05-19

Family

ID=70656086

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010002721.1A Pending CN111176632A (en) 2020-01-02 2020-01-02 Method for building iOS end response type development framework

Country Status (1)

Country Link
CN (1) CN111176632A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112597133A (en) * 2020-12-29 2021-04-02 深圳复临科技有限公司 Data application management system for project management scene of hundred-person research and development team

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102523225A (en) * 2011-12-22 2012-06-27 浙江国自机器人技术有限公司 Decoupling method in distributed loosely-coupled framework and distributed loosely-coupled framework platform
CN104267944A (en) * 2014-09-22 2015-01-07 浪潮软件集团有限公司 Spring-based MVC (model view controller) mode optimization system
CN107729161A (en) * 2017-09-28 2018-02-23 平安普惠企业管理有限公司 Information notice method, system, equipment and computer-readable recording medium
CN108845856A (en) * 2018-06-11 2018-11-20 腾讯科技(深圳)有限公司 Data Binding Method, device, storage medium and equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102523225A (en) * 2011-12-22 2012-06-27 浙江国自机器人技术有限公司 Decoupling method in distributed loosely-coupled framework and distributed loosely-coupled framework platform
CN104267944A (en) * 2014-09-22 2015-01-07 浪潮软件集团有限公司 Spring-based MVC (model view controller) mode optimization system
CN107729161A (en) * 2017-09-28 2018-02-23 平安普惠企业管理有限公司 Information notice method, system, equipment and computer-readable recording medium
CN108845856A (en) * 2018-06-11 2018-11-20 腾讯科技(深圳)有限公司 Data Binding Method, device, storage medium and equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CHEN YUANMING: "RxJava学习笔记", 《CHENYUANMING.CN/2016/03/20/NCJAVA-NOTE/》 *
萧然CS: "设计模式之观察者模式(Observer)", 《HTTPS://BLOG.CSDN.NET/QQ_39108767/ARTICLE/DETAILS/83386856》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112597133A (en) * 2020-12-29 2021-04-02 深圳复临科技有限公司 Data application management system for project management scene of hundred-person research and development team

Similar Documents

Publication Publication Date Title
CN107506451B (en) Abnormal information monitoring method and device for data interaction
CN111240940B (en) Real-time service monitoring method and device, electronic equipment and storage medium
CN103645908A (en) Full life circle development achievement system of intemetware
CN101980155A (en) Method and system for realizing user interface of television, and television
CN118250288B (en) AIoT middle station data processing method, device and system based on scene assembly
CN104182494A (en) Method and system capable of realizing CMS website construction with PC terminal and mobile terminal
CN109960773A (en) Page animation method, apparatus, equipment and storage medium based on HTML5
CN109739661A (en) The method, apparatus and system of information updating between a kind of cooperative module
CN116340413A (en) Internet of things edge data acquisition and storage method
CN108228756A (en) Data based on the PG databases of daily record analytic technique to Hadoop platform synchronize clone method
CN102542043A (en) Image annotation method and device
CN113448562A (en) Automatic logic code generation method and device and electronic equipment
CN114281757A (en) Database migration method and system and computer readable storage medium
CN111176632A (en) Method for building iOS end response type development framework
CN113536742A (en) Method and device for generating description text based on knowledge graph and electronic equipment
CN114489762A (en) Method and system for realizing multi-version application and electronic equipment
CN116150540B (en) System and method for realizing one-key switching of exhibition item content based on meta universe and cloud platform
CN117453799A (en) Discrete event data acquisition method in simulation process
CN112711625A (en) Bidirectional self-adaptive multi-source heterogeneous big data dynamic processing method
CN105787013B (en) A kind of the typonym distribution method and system of isomeric data
CN114238499A (en) Data synchronization method and device, computer equipment and computer readable storage medium
CN111597255A (en) Data disaster recovery processing method and device, electronic equipment and storage medium
CN114003579A (en) Method, device, equipment and storage medium for auditing data
CN115378996B (en) Method, device, equipment and storage medium for data transmission between systems
Müller Consistency and Autonomy in the Microservice Architecture

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200519