Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

New answers tagged

2

The reason that multiple data structures exist is (and there isn't any one single data structure to rule them all) is because each data structure has different performance characteristics. It follows that, if you're moving data from one data structure to another, you're doing so because you now prefer the performance characteristics of the new data ...


0

I have a tree data structure where each node has a name, an id, a type and a number of children. Additionally each node has properties based on its type. Thereby each node with type A should only have children of Type B, C, D... and each node of type C should only have children with type D, E, F, etc. Implementing this at the data layer is relatively ...


1

An abstract class shall not depend on its concrete specialization. This is against the idea of abstraction and totally against the Open/Closed principle. There are two main approaches for solving your design issue: Abstract the rules, for example into an abstract NodeValidator class. In the tree-building process you could then rely on your abstract nodes ...


1

Yeah this seems like a pretty standard way of doing things. Check out how json.net allows you to add custom type serialisers for example


Top 50 recent answers are included