Going native with less coupling: Dependency Injection in C++Daniele Pallastrelli
Slideshow from C++ Meetup Bologna 2014, about the central role of Dependency Injection in OO software.
The slide deck contains detailed explanation about dependency injection in general and C++ frameworks in particular.
Im alltäglichen Einsatz verwenden wir eine potentiell steigende Anzahl an immer größeren Bibliotheken. Diese helfen uns schneller und effizienter unsere Ziele zu erreichen, werden ständig gewartet und ersparen nebenbei auch jede Menge Fehlerlösungs- und Dokumentationsaufwand. Gleichzeitig bedeuten sie jedoch einen unmittelbar höheren Aufwand für das Build und Dependency Management. Wie bekommt man dieses Problem in den Griff?
In der letzten Dekade hat das BuildSystem CMake diesbezüglich große Fortschritte bei der schnellen und alltäglichen Wiederverwendbarkeit von C++ Code bewirkt. So fördert zum Beispiel die Unabhängigkeit von spezifischen BuildSystemen zusammen mit Git und innovativen Hostern wie GitHub insbesondere die Entstehung und Verwendung von OpenSource
Software. Wie sieht die Zukunft aus?
Dependency Manager wie biicode zeigen einen noch komfortableren Weg auf, mit eigenem oder Drittanbieter Code zu arbeiten. Download, Build und Einbindung von Dependencies wird damit so einfach wie das Installieren einer App aus dem AppShop. Doch welche Vor- und Nachteile hat dieses System? Welche Alternativen gibt es?
Going native with less coupling: Dependency Injection in C++Daniele Pallastrelli
Slideshow from C++ Meetup Bologna 2014, about the central role of Dependency Injection in OO software.
The slide deck contains detailed explanation about dependency injection in general and C++ frameworks in particular.
Im alltäglichen Einsatz verwenden wir eine potentiell steigende Anzahl an immer größeren Bibliotheken. Diese helfen uns schneller und effizienter unsere Ziele zu erreichen, werden ständig gewartet und ersparen nebenbei auch jede Menge Fehlerlösungs- und Dokumentationsaufwand. Gleichzeitig bedeuten sie jedoch einen unmittelbar höheren Aufwand für das Build und Dependency Management. Wie bekommt man dieses Problem in den Griff?
In der letzten Dekade hat das BuildSystem CMake diesbezüglich große Fortschritte bei der schnellen und alltäglichen Wiederverwendbarkeit von C++ Code bewirkt. So fördert zum Beispiel die Unabhängigkeit von spezifischen BuildSystemen zusammen mit Git und innovativen Hostern wie GitHub insbesondere die Entstehung und Verwendung von OpenSource
Software. Wie sieht die Zukunft aus?
Dependency Manager wie biicode zeigen einen noch komfortableren Weg auf, mit eigenem oder Drittanbieter Code zu arbeiten. Download, Build und Einbindung von Dependencies wird damit so einfach wie das Installieren einer App aus dem AppShop. Doch welche Vor- und Nachteile hat dieses System? Welche Alternativen gibt es?
CMake: Improving Software Quality and ProcessMarcus Hanwell
This document discusses CMake, an open-source, cross-platform build system. It summarizes CMake's features, including generating native build projects for various platforms from a common set of CMake files. It also discusses how CMake improves the software development process through features like automated testing with CTest and aggregation of test results on CDash. Kitware, the company that develops CMake, uses it for many of their own open-source projects and provides commercial support to other organizations using CMake.
Статический и динамический полиморфизм в C++, Дмитрий ЛевановYandex
На примере некоторых архитектурных решений Крипты Дмитрий расскажет о способах реализации полиморфного поведения в программах на C++, о преимуществах и недостатках этих способов, а также о новых возможностях C++11.
The document provides notes on effective use of the Standard Template Library (STL). It begins with prerequisites for understanding STL including C++, data structures, templates, smart pointers, and algorithm time complexities. The document then discusses why STL is useful, gives an introduction to STL components like containers, algorithms and iterators, and provides examples and best practices for using various STL containers and algorithms. It emphasizes choosing containers and algorithms based on specific needs and optimizing for efficiency.
The document summarizes key principles from Scott Meyers' book "Effective C++". It discusses best practices for variable declarations, passing parameters, using const, casts, member initialization lists, inlining functions, inheritance, composition, virtual functions, operator overloading, copy constructors, RAII, and designing interfaces. The overall focus is on writing efficient and well-structured C++ code.
Utah Code Camp, Spring 2016. http://utahcodecamp.com In this presentation I describe modern C++. Modern C++ assumes features introduced in the C++11/14 standard. An overview of the new features is presented and some idioms for mdoern C++ based on those features are presented.
C++ provides backwards compatability with C, but you will have an easier time if you stay away from certain C-style programming habits. This presentation outlines traps and pitfalls from C style programming in C++ and recommends pure C++ alternatives that lead to fewer surprises, fewer errors and better code. This presentation hasn't been updated for C++11 and is based on C++03.
Со времён С++98 стандартные контейнеры и идиома RAII позволяли избегать использования оператора delete,
что делало код более безопасным. С приходом С++11 и умных указателей отпала необходимость использовать оператор new, что позволило практически полностью переложить управление памятью на плечи компилятора. В
докладе объясняется идеология управления памятью и ресурсами в современном С++.
All 3 Clean Code presentations provide great value by themselves, but taken together are designed to offer a holistic approach to successful software creation. This first session creates the foundation for the 2nd and 3rd Clean Code presentation on Dependency Injection, as it explains expected base knowledge. Why writing Clean Code makes us more efficient Over the lifetime of a product, maintaining the product is actually one - if not the most - expensive area(s) of the overall product costs.
We will dive into the basics of Inversion of Control (IOC) and Dependency Injection (DI) to review different ways of achieving decoupling, using and exploring both: Best Practices, Design and Anti Patterns. This presentation requires knowledge and understanding of basics like DRY, SoC, SRP, SOLID etc. which are building the base for decoupled architecture. However, we will start at the basics of DI and will work towards intermediate and advanced scenarios depending on the participating group.
This presentation is based on C# and Visual Studio 2013. However, the demonstrated patterns and practice can be applied to every other programming language too.
Note: Moving forwards this presentation will be updated with the latest version of the slides for the last event I did the presentation instead of creating new separate slide decks here on SlideShare.
Presentation dates and locations:
2015-10-03 Silicon Valley Code Camp, San Jose, CA
2015-06-27 SoCal Code Camp - San Diego, CA
2015-06-25 Bay.NET South Bay, Mountain View, CA
2014-11-14 SoCal Code Camp - Los Angeles, CA
2014-10-11 Silicon Valley Code Camp, Los Altos Hills, CA
Со времён С++98 стандартные контейнеры и идиома RAII позволяли избегать использования оператора delete, что делало код более безопасным. С приходом С++11 и умных указателей отпала необходимость использовать оператор new, что позволило практически полностью переложить управление памятью на плечи компилятора. В докладе объясняется идеология управления памятью и ресурсами в современном С++.
The document discusses operator overloading in C++. It provides examples of overloading operators like ++, [], and == for an enumeration of months to provide more natural syntax when working with the enum. Operator overloading allows defining operators for user-defined types to provide conventional operator meanings and make code more clear and efficient. It can be used to define operations for enumerations that are less error-prone than alternative approaches like switch statements or functions.
This document provides an overview of multithreading concepts including when to use threads, threading primitives like mutexes and semaphores, common issues like race conditions and deadlocks, and alternatives to using threads. Key topics covered include GUI responsiveness, utilizing all processors, network connectivity, atomic functions, mutual exclusion, events and conditions, and memory barriers.
The document discusses the STL algorithms in C++. It begins by defining what algorithms and STL algorithms are. It then covers the different classes of STL algorithms including non-modifying sequence operations, mutating sequence operations, sorting operations, general C algorithms, and general numeric operations. Specific algorithms like for_each, transform, all_of, any_of and none_of are discussed in more detail through examples. The document aims to explain what STL algorithms are and how they can be used to operate on sequences and containers in C++.
The document discusses C++ memory management and smart pointers. It provides an overview of common memory issues with pointers, the new and delete operators, overloading new and delete, and memory pools. It then discusses different types of smart pointers like scoped pointers and shared pointers, which implement reference counting to prevent memory leaks and dangling pointers while allowing multiple pointers to the same data.
Streams are used to represent different kinds of data flow in C++. There are input streams like ifstream that allow reading from files and output streams like ofstream that allow writing to files. Each file stream has get and put pointers that indicate the current position for reading and writing. Functions like seekg(), tellg(), seekp(), and tellp() can be used to set and retrieve the position of these pointers to allow reading from or writing to arbitrary locations in a file.
The document discusses different types of memory areas in C++ including stack, heap, static, and const data areas. It compares pointers and references, explaining that pointers can be null while references must always refer to a valid object. The document also covers memory management topics like new and delete operators, placement new, and smart pointers. Common memory problems are outlined along with solutions like using destructors and smart pointers to avoid leaks.
The document discusses operator overloading in C++. Some key points:
- Operator overloading allows operators to be redefined for user-defined types.
- Unary operators can be overloaded using non-static member functions or friend functions. Binary operators can also be overloaded using these two methods.
- Not all operators can be overloaded - operators like ., ::, sizeof cannot be overloaded. The precedence, associativity, and arity of operators also cannot be changed.
CMake: Improving Software Quality and ProcessMarcus Hanwell
This document discusses CMake, an open-source, cross-platform build system. It summarizes CMake's features, including generating native build projects for various platforms from a common set of CMake files. It also discusses how CMake improves the software development process through features like automated testing with CTest and aggregation of test results on CDash. Kitware, the company that develops CMake, uses it for many of their own open-source projects and provides commercial support to other organizations using CMake.
Статический и динамический полиморфизм в C++, Дмитрий ЛевановYandex
На примере некоторых архитектурных решений Крипты Дмитрий расскажет о способах реализации полиморфного поведения в программах на C++, о преимуществах и недостатках этих способов, а также о новых возможностях C++11.
The document provides notes on effective use of the Standard Template Library (STL). It begins with prerequisites for understanding STL including C++, data structures, templates, smart pointers, and algorithm time complexities. The document then discusses why STL is useful, gives an introduction to STL components like containers, algorithms and iterators, and provides examples and best practices for using various STL containers and algorithms. It emphasizes choosing containers and algorithms based on specific needs and optimizing for efficiency.
The document summarizes key principles from Scott Meyers' book "Effective C++". It discusses best practices for variable declarations, passing parameters, using const, casts, member initialization lists, inlining functions, inheritance, composition, virtual functions, operator overloading, copy constructors, RAII, and designing interfaces. The overall focus is on writing efficient and well-structured C++ code.
Utah Code Camp, Spring 2016. http://utahcodecamp.com In this presentation I describe modern C++. Modern C++ assumes features introduced in the C++11/14 standard. An overview of the new features is presented and some idioms for mdoern C++ based on those features are presented.
C++ provides backwards compatability with C, but you will have an easier time if you stay away from certain C-style programming habits. This presentation outlines traps and pitfalls from C style programming in C++ and recommends pure C++ alternatives that lead to fewer surprises, fewer errors and better code. This presentation hasn't been updated for C++11 and is based on C++03.
Со времён С++98 стандартные контейнеры и идиома RAII позволяли избегать использования оператора delete,
что делало код более безопасным. С приходом С++11 и умных указателей отпала необходимость использовать оператор new, что позволило практически полностью переложить управление памятью на плечи компилятора. В
докладе объясняется идеология управления памятью и ресурсами в современном С++.
All 3 Clean Code presentations provide great value by themselves, but taken together are designed to offer a holistic approach to successful software creation. This first session creates the foundation for the 2nd and 3rd Clean Code presentation on Dependency Injection, as it explains expected base knowledge. Why writing Clean Code makes us more efficient Over the lifetime of a product, maintaining the product is actually one - if not the most - expensive area(s) of the overall product costs.
We will dive into the basics of Inversion of Control (IOC) and Dependency Injection (DI) to review different ways of achieving decoupling, using and exploring both: Best Practices, Design and Anti Patterns. This presentation requires knowledge and understanding of basics like DRY, SoC, SRP, SOLID etc. which are building the base for decoupled architecture. However, we will start at the basics of DI and will work towards intermediate and advanced scenarios depending on the participating group.
This presentation is based on C# and Visual Studio 2013. However, the demonstrated patterns and practice can be applied to every other programming language too.
Note: Moving forwards this presentation will be updated with the latest version of the slides for the last event I did the presentation instead of creating new separate slide decks here on SlideShare.
Presentation dates and locations:
2015-10-03 Silicon Valley Code Camp, San Jose, CA
2015-06-27 SoCal Code Camp - San Diego, CA
2015-06-25 Bay.NET South Bay, Mountain View, CA
2014-11-14 SoCal Code Camp - Los Angeles, CA
2014-10-11 Silicon Valley Code Camp, Los Altos Hills, CA
Со времён С++98 стандартные контейнеры и идиома RAII позволяли избегать использования оператора delete, что делало код более безопасным. С приходом С++11 и умных указателей отпала необходимость использовать оператор new, что позволило практически полностью переложить управление памятью на плечи компилятора. В докладе объясняется идеология управления памятью и ресурсами в современном С++.
The document discusses operator overloading in C++. It provides examples of overloading operators like ++, [], and == for an enumeration of months to provide more natural syntax when working with the enum. Operator overloading allows defining operators for user-defined types to provide conventional operator meanings and make code more clear and efficient. It can be used to define operations for enumerations that are less error-prone than alternative approaches like switch statements or functions.
This document provides an overview of multithreading concepts including when to use threads, threading primitives like mutexes and semaphores, common issues like race conditions and deadlocks, and alternatives to using threads. Key topics covered include GUI responsiveness, utilizing all processors, network connectivity, atomic functions, mutual exclusion, events and conditions, and memory barriers.
The document discusses the STL algorithms in C++. It begins by defining what algorithms and STL algorithms are. It then covers the different classes of STL algorithms including non-modifying sequence operations, mutating sequence operations, sorting operations, general C algorithms, and general numeric operations. Specific algorithms like for_each, transform, all_of, any_of and none_of are discussed in more detail through examples. The document aims to explain what STL algorithms are and how they can be used to operate on sequences and containers in C++.
The document discusses C++ memory management and smart pointers. It provides an overview of common memory issues with pointers, the new and delete operators, overloading new and delete, and memory pools. It then discusses different types of smart pointers like scoped pointers and shared pointers, which implement reference counting to prevent memory leaks and dangling pointers while allowing multiple pointers to the same data.
Streams are used to represent different kinds of data flow in C++. There are input streams like ifstream that allow reading from files and output streams like ofstream that allow writing to files. Each file stream has get and put pointers that indicate the current position for reading and writing. Functions like seekg(), tellg(), seekp(), and tellp() can be used to set and retrieve the position of these pointers to allow reading from or writing to arbitrary locations in a file.
The document discusses different types of memory areas in C++ including stack, heap, static, and const data areas. It compares pointers and references, explaining that pointers can be null while references must always refer to a valid object. The document also covers memory management topics like new and delete operators, placement new, and smart pointers. Common memory problems are outlined along with solutions like using destructors and smart pointers to avoid leaks.
The document discusses operator overloading in C++. Some key points:
- Operator overloading allows operators to be redefined for user-defined types.
- Unary operators can be overloaded using non-static member functions or friend functions. Binary operators can also be overloaded using these two methods.
- Not all operators can be overloaded - operators like ., ::, sizeof cannot be overloaded. The precedence, associativity, and arity of operators also cannot be changed.
68. Tutto il materiale di questa sessione su
http://www.communitydays.it/
Lascia subito il feedback su questa sessione,
potrai essere estratto per i nostri premi!
Seguici su
Twitter @CommunityDaysIT
Facebook http://facebook.com/cdaysit
#CDays15