Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| arch:oop-async-design [2021/12/19 15:27] – eakarelina_1 | arch:oop-async-design [2026/08/29 07:59] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| ===== Introduction ===== | ===== Introduction ===== | ||
| + | |||
| Nowadays object-oriented design is one of the most commonly used approach in software design and the majority of most popular programming languages have support object-oriented paradigm. Another concept in programing which is gaining popularity during last decades is asynchronous programming which is also implemented in many popular frameworks for different programming languages. These two concepts consider different issues: object-oriented design describes how keeping and processing program’s data should be organized whereas asynchronous design deals with distributing and scheduling execution of the program’s tasks. But are these two design approaches compatible with each other? This essay analyses if the principles dictated by object-oriented and asynchronous design can both be sticked to in software design and are there enough modeling and programming tools for combining these concepts. | Nowadays object-oriented design is one of the most commonly used approach in software design and the majority of most popular programming languages have support object-oriented paradigm. Another concept in programing which is gaining popularity during last decades is asynchronous programming which is also implemented in many popular frameworks for different programming languages. These two concepts consider different issues: object-oriented design describes how keeping and processing program’s data should be organized whereas asynchronous design deals with distributing and scheduling execution of the program’s tasks. But are these two design approaches compatible with each other? This essay analyses if the principles dictated by object-oriented and asynchronous design can both be sticked to in software design and are there enough modeling and programming tools for combining these concepts. | ||
| ===== Tell, don’t ask ===== | ===== Tell, don’t ask ===== | ||
| + | |||
| One of the principles which are recommended to stick to during Object-oriented development is “Tell, don’t ask” which was primary described in IEEE Software column [1]. This article emphasizes on the fact that developing in object-oriented paradigm means that all logic of processing the object’s data is implemented in the object’s methods and the main program just calls the corresponding methods. The callee does not have access to the object’s fields and adopt decisions based on the data’s values – this is responsibility of the objects’ methods. Pretty same concept is realized in asynchronous programming. In fact, calling an asynchronous function means that another instance is asked to do something and it is assumed that the executed function has access to all data which is required to be processed. Consequently, | One of the principles which are recommended to stick to during Object-oriented development is “Tell, don’t ask” which was primary described in IEEE Software column [1]. This article emphasizes on the fact that developing in object-oriented paradigm means that all logic of processing the object’s data is implemented in the object’s methods and the main program just calls the corresponding methods. The callee does not have access to the object’s fields and adopt decisions based on the data’s values – this is responsibility of the objects’ methods. Pretty same concept is realized in asynchronous programming. In fact, calling an asynchronous function means that another instance is asked to do something and it is assumed that the executed function has access to all data which is required to be processed. Consequently, | ||
| ===== What about notation? ===== | ===== What about notation? ===== | ||
| + | |||
| A lot of approaches to modeling asynchronous behavior in object-oriented paradigm described in the literature. For instance, sequence diagrams which describe communication between objects include symbols that depict asynchronous messages. The notation can be found in different sequence diagram tutorials, for instance in [2]. Moreover, UML2 provide notation for sending and receiving asynchronous messages between the components’ interfaces. This is also described in different UML2 tutorials and books, for example [3] and [4]. Apart from generally recognized UML2 notation there exist another notation for object-oriented design including asynchrony which is introduced in [5]. The authors explain their decision to develop symbols for depicting asynchronous processes with the fact that software systems’ components interact with each other and frequently do it in asynchronous way. As it can be seen from the overview of languages for modeling object-oriented systems, they contain tools for including asynchronous interaction in the designed system. Consequently, | A lot of approaches to modeling asynchronous behavior in object-oriented paradigm described in the literature. For instance, sequence diagrams which describe communication between objects include symbols that depict asynchronous messages. The notation can be found in different sequence diagram tutorials, for instance in [2]. Moreover, UML2 provide notation for sending and receiving asynchronous messages between the components’ interfaces. This is also described in different UML2 tutorials and books, for example [3] and [4]. Apart from generally recognized UML2 notation there exist another notation for object-oriented design including asynchrony which is introduced in [5]. The authors explain their decision to develop symbols for depicting asynchronous processes with the fact that software systems’ components interact with each other and frequently do it in asynchronous way. As it can be seen from the overview of languages for modeling object-oriented systems, they contain tools for including asynchronous interaction in the designed system. Consequently, | ||
| ===== Continue talking about design ===== | ===== Continue talking about design ===== | ||
| + | |||
| One of the steps in designing software system is detailed design which implies applying design patterns. Are there any patterns for asynchronous design? Actually, several design patterns for asynchronous object-oriented systems are described in Java and C# documentation ([6], [7]). For instance, “Async Method Invocation” pattern describes how the results of executing of an asynchronous task can be returned to the callee later in case of immediate return of the asynchronous function. Consequently, | One of the steps in designing software system is detailed design which implies applying design patterns. Are there any patterns for asynchronous design? Actually, several design patterns for asynchronous object-oriented systems are described in Java and C# documentation ([6], [7]). For instance, “Async Method Invocation” pattern describes how the results of executing of an asynchronous task can be returned to the callee later in case of immediate return of the asynchronous function. Consequently, | ||
| ===== Real life examples ===== | ===== Real life examples ===== | ||
| + | |||
| Let us consider several examples where asynchronous design coexists with object-oriented design in real programming languages and frameworks. First of all, one of the most famous and widely used C++ library for asynchrony Boost.Asio ([8]) is written in object-oriented style. In this library all concepts used in asynchronous programming are implemented as classes and all asynchronous operations under them can be done by calling corresponding methods of the objects. Another programing language which supports asynchronous paradigm is Java ([9]). Since Java implies usage of object-oriented paradigm, all asynchronous Java applications combine object-oriented and asynchronous design. Moreover, one of the most popular Java frameworks Spring supports asynchronous applications. The same thing is for C#: this language also supports only object-oriented paradigm and allows writing asynchronous applications ([10]). | Let us consider several examples where asynchronous design coexists with object-oriented design in real programming languages and frameworks. First of all, one of the most famous and widely used C++ library for asynchrony Boost.Asio ([8]) is written in object-oriented style. In this library all concepts used in asynchronous programming are implemented as classes and all asynchronous operations under them can be done by calling corresponding methods of the objects. Another programing language which supports asynchronous paradigm is Java ([9]). Since Java implies usage of object-oriented paradigm, all asynchronous Java applications combine object-oriented and asynchronous design. Moreover, one of the most popular Java frameworks Spring supports asynchronous applications. The same thing is for C#: this language also supports only object-oriented paradigm and allows writing asynchronous applications ([10]). | ||
| ===== Conclusion ===== | ===== Conclusion ===== | ||
| + | |||
| To sum up, the basic principles of object-oriented paradigm and asynchrony do not contradict to each other and can be easily combined in one software system. Both designing tools and programming languages allow developers to make their object-oriented systems asynchronous at stage of design and implement them in such way. As object-oriented and asynchronous design are both modern standards of software systems due to their advantages, both these approaches are used in a lot of applications written in different programming languages. Answering the question from the topic of the essay: object-oriented and asynchronous design are certainly friends. | To sum up, the basic principles of object-oriented paradigm and asynchrony do not contradict to each other and can be easily combined in one software system. Both designing tools and programming languages allow developers to make their object-oriented systems asynchronous at stage of design and implement them in such way. As object-oriented and asynchronous design are both modern standards of software systems due to their advantages, both these approaches are used in a lot of applications written in different programming languages. Answering the question from the topic of the essay: object-oriented and asynchronous design are certainly friends. | ||
| ===== References ===== | ===== References ===== | ||
| - | - Hunt A., Thomas D. The art of enbugging //IEEE Software. – 2003. – Т. 20. – №. 1. – С. 10-11 | ||
| - | |||
| - | |||
| - | - UML Sequence diagram tutorial. URL: https:// | ||
| - | |||
| + | - Hunt A., Thomas D. The art of enbugging IEEE Software. 2003. Т. 20. – №. 1. – С. 10-11 | ||
| + | - UML Sequence diagram tutorial. URL: [[https:// | ||
| - Rensink A., Warmer J. Model Driven Architecture-Foundations and Applications. – Springer, 2006 | - Rensink A., Warmer J. Model Driven Architecture-Foundations and Applications. – Springer, 2006 | ||
| - | - UML Component diagram tutorial. URL: https:// | + | - UML Component diagram tutorial. URL: [[https:// |
| - | - Wasserman A. I., Pircher P. A., Muller R. J. The object-oriented structured design notation for software design representation | + | - Wasserman A. I., Pircher P. A., Muller R. J. The object-oriented structured design notation for software design representation Computer. – 1990. – Т. 23. – №. 3. – С. 50-63. |
| - | - Java design patterns for asynchronous programming. URL: https:// | + | - Java design patterns for asynchronous programming. URL: [[https:// |
| - | - C# design patterns for asynchronous programming. URL: https:// | + | - C# design patterns for asynchronous programming. URL: [[https:// |
| - | - Boost documentation. URL: https:// | + | - Boost documentation. URL: [[https:// |
| - | - Asynchronous programming in Java. URL: https:// | + | - Asynchronous programming in Java. URL: [[https:// |
| - | - Asynchronous programming in C#: https:// | + | - Asynchronous programming in C#: [[https:// |
| - Okur S. et al. A study and toolkit for asynchronous programming in C# // | - Okur S. et al. A study and toolkit for asynchronous programming in C# // | ||
| + | // | ||