Ask Your Question
1

Motivation behind VizImpl

asked Oct 16 '14

JiayiLiu gravatar image

Just noticed that, in the viz module, the implementation of the functions of the Viz3d class is not realized inside the class. Instead, it is implemented in a VizImpl struct which itself is a private member of the Viz3d class.

So whenever an Viz3d function is called, that dummy Viz3d function calls the real VizImpl function instead.

I'm just purely curious about the initial consideration of implementing it this way. Thank you!

Preview: (hide)

1 answer

Sort by » oldest newest most voted
2

answered Oct 16 '14

Guessing this is done to make a front and backend structure. The frontend will never change but the backend allows the author to effictively adapt the code with only the need of adapting the conversion/linking code between both pieces. It is a quite common approach in software programming.

Preview: (hide)

Question Tools

Stats

Asked: Oct 16 '14

Seen: 244 times

Last updated: Oct 15 '14