Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
roth_stephan_clean_c20_sustainable_software_development_patt.pdf
Скачиваний:
29
Добавлен:
27.03.2023
Размер:
7.26 Mб
Скачать

Chapter 5 Advanced Concepts of Modern C++

•\ Concurrent data structures (libcds): A mostly header-only C++ template library written by Max Khizhinsky, this provides lock-free algorithms and concurrent data structure implementations for parallel high-performance computing. The library is written using modern C++ (C++11 and higher) and published under a BSD license. libcds and its documentation can be found on SourceForge at http://libcds.sourceforge.net.

Proper Exception and Error Handling

Maybe you have heard the term cross-cutting concerns? This expression includes all those things that are difficult to address through a modularization concept and

therefore require special treatment by software architecture and design. One of these typical cross-cutting concerns is security. If you have to take care of data security and access restrictions in your software system, because it is demanded by certain quality requirements, it is a sensitive topic that pervades the whole system. You have to deal with it nearly everywhere, in virtually every component.

Another cross-cutting concern is transaction handling. Especially in software applications that use databases, you have to ensure that a so-called transaction, which is a coherent series of single operations, must succeed or fail as a complete logical unit; it can never be only partially complete.

And as another example, logging is also a cross-cutting concern. Logging is typically needed everywhere in a software system. Sometimes the domain-specific and productive code is littered with log statements, which is detrimental to the readability and understandability of the code.

If the software architecture does not take care of these cross-cutting concerns, this could lead to inconsistent solutions. For instance, two different logging frameworks could be used in the same project, because two development teams working on the same system decided to choose different frameworks.

The exception and error handling is another cross-cutting concern. Dealing with errors and unpredictable exceptions that require special responses and treatments is mandatory in every software system. And, of course, the system-wide error-handling strategies should be uniform and consistent. Hence, it is very important that the people responsible for the software’s architecture have to design and develop an error-handling strategy quite early in the project.

196