Loading...

Balancing Object-Functional Design in React.js Guided by Tests by Naresh Jain

117 views

Loading...

Loading...

Rating is available when the video has been rented.
This feature is not available right now. Please try again later.
Streamed live on Oct 8, 2015

When we think of OO, most people think of modeling THE real world in software by mapping every real world object (nouns) to entities in software. These entities are then modeled using Is-A-Has-A relationship to build complex, polymorphic hierarchies with deep object graphs. State is stored and mutated in-place inside the object to achieve the desired functionality. This paradigm leads to a fairly convoluted design and encourage imperative style of programming.

Not everyone who has designed large complex systems, think of OO the same way. For instance, people who Test Drive, do not have the luxury of a big-up-front design, instead they focus on small and incremental design. IME, TDD facilities a design that is side-effect free and encourages a declarative style of programming. While decoupling and composing objects in a functional style with the right granularity of abstraction.

Let's assume we've to build a web commenting and discussion feature (like Disqus). And we've a requirement to implement this as a React component. Can we apply pure functional principles to design this? Or will the design be better if we try a classical OO JS approach? In this live demo, we'll build this component from scratch and see how TDD will help us drive an object-functional design to strike a pragmatic balance between the 2 paradigms.

Register: http://techjam.org/#balancing-object-...

Loading...

When autoplay is enabled, a suggested video will automatically play next.

Up next


to add this to Watch Later

Add to

Loading playlists...