ChristianG Posted August 4, 2010 Report Share Posted August 4, 2010 Hi you GOOP enthusiasts I redesigned the last two weeks my current application using GOOP (loving it, by the way). Now I came across one point where I need to use an overloaded constructor. I was wondering if it is good practice to use polymorphic VIs to do it or just forget about using overloaded methods. Why I want to do this: my current constructor has several inputs which were marked as "required" and now I need in one calling class just the generated object without any functionality (because of design reasons). I'm really curious about your positions about that cheers, Christian Quote Link to comment
ChristianG Posted August 9, 2010 Author Report Share Posted August 9, 2010 I guess you guys were all at the NI-Week the last couple of days, so that's why there was now answer. I thought about the overloading method and I didn't see why I shouldn't do it...So I just did it.... I have now for that particular class two constructors. One Class_Create.vi with some recommendet and some required inputs (so basically I use an overloaded method already) and one Class_CreateEmpty.vi with no connectors at all. Quote Link to comment
Jeffrey Habets Posted August 9, 2010 Report Share Posted August 9, 2010 I probably missed your first post. For what it's still worth.. That's how I usually do it too.. Another way would be to have just one constructor and tell it how to construct using e.g. an enum parameter (the Report Generation VI's class does this), but this requires you to have all possible parameters for all construction actions. I wouldn't recommend that. Quote Link to comment
ChristianG Posted August 9, 2010 Author Report Share Posted August 9, 2010 Hi Jeffrey thanks for your reply. So it seems I'm not on the wrong path...The idea with an Enum sounds interessing. Not for the particular class in mind, as this one has already a lot of connections to the VI, but for a simpler one... cheers, \c Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.