typedefs

nleclercq
Ok. Let's go. Could you help me to factorize some code in the polymorphic VIs? For instance, let's take the _TangoReadAttritute.vi. What would you do to factorize the underlying code?
If you wish to look at, I worked out the first 5 instances (alphabetically). It is not that I really need that now, it is more of an exercise and to show what could minimally be done to have a leaner and easier to maintain code.
I haven't checked the results for real, and don't exclude that some mistake slipped in, for that you need systematic unit tests.

Other incidental comments:

  • if the exercise would be carried on for all the 35 instances, you would get rid of 35 appearances of a deprecated VI.
  • I suppose that the typedef _DataType.ctl could be obsoleted and replaced everywhere by _AttributeDataType_t.ctl.
  • _TangoExceptionToLabviewError.vi has an input argument "location" whose use, for what I saw in the codebase, seems pleonastic. I think its value could be derived from the call chain, except from minor variances which look completely unintentional.
  • I speculate that perhaps more factorization could be done using variants or classes - but that is a more far fetched design decision, probably revolutionizing the API, and as of now I really miss the overview for proposing anything.
I just gave you PR a try and I'm quite impress by the result in terms of side effects on the existing code. I don't see any regression - at least with the provided client and server examples. Congrats for that.

My main concern is now focused on the "orphan" vis. Could we continue our discussion on github please? Thanks.
 
Register or login to create to post a reply.