O'Reilly logo

C++ Reactive Programming by Peter Abraham, Praseed Pai

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

From design patterns to reactive programming

Even though the design pattern movement is aligned with OOP, and reactive programming is aligned towards FP, there are close similarities between them. In a previous chapter, we learned the following:

  • The OOP model is good for modeling the structural aspects of a system.
  • The FP model is good for modeling the behavioral aspects of a system.

To illustrate the connection between OOP and reactive programming, we will write a program that will traverse directories to enumerate files and sub-folders within a given folder.

We will create a composite structure that contains the following:

  • A FileNode (inherits from EntryNode) that models file information
  • A DirectoryNode (inherits from EntryNode) that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required