- @RollingStone Land of hope and dreams #weekendrock #
Monthly Archives: June 2011
24
Jun 11
Twitter Updates for 2011-06-24
- @ulfroettger Die @lambertikirche ist wirklich gut. Einfach, aber gut. in reply to ulfroettger #
22
Jun 11
Twitter Updates for 2011-06-22
- RT @RonJeffries "But We Need a Database … Don't We?" http://t.co/N959E9y – Required reading #yam #fb #
- Make sure to subscribe to @Vectorworks global news site Planet Vectorworks http://bit.ly/cGW7kV for @Vectorworks news from around the globe #
19
Jun 11
Twitter Updates for 2011-06-19
- "The Temple of Soul has not closed, it just has a new address" (via @GabriellaDante) – RIP Clarence Clemons – http://nyti.ms/inuVSp #
- RT @backstreetsmag http://www.backstreets.com/clarence #springsteen #clarenceclemons #
- RT @JHKarlsson A version of the string calculator kata in C++ with Igloo: http://t.co/augBRty #TDD #IglooTesting #yam #fb #
18
Jun 11
Twitter Updates for 2011-06-18
- Structural changes – A @Vectorworks tool plug-in, developed TDD-style, of course – Episode 2 – http://t.co/txbFPlv #
17
Jun 11
Developing a Vectorworks 2011 tool plug-in, TDD-style – Episode 2
With a basic mock implementation of the tool point collecting part of a Vectorworks tool under our belt, let’s try to connect this class to a “real” Vectorworks tool event sink.
Using the MockRedGreenLineTool from within a CTool_EventSink doesn’t sound quite right. After all it’s supposed to be a mock implementation. We need to use a real tool implementation in the CTool_EventSink. Let’s do some restructuring to accomplish that. First, create a new class RedGreenLineTool with the code from MockRedGreenLineTool.
class RedGreenLineTool { public: virtual ~RedGreenLineTool() { } void AddPoint(const WorldPt3&amp;amp; p) { fToolPoints.PushData(p); } virtual void PopPoint() { fToolPoints.PopData(); } short GetNumToolPoints() const { return fToolPoints.NumItems(); } TSmallArray<WorldPt3> fToolPoints; };
Now, make MockRedGreenLineTool a subclass of RedGreenLineTool:
class MockRedGreenLineTool : public RedGreenLineTool { }
and create VectorworksRedGreenLineTool, which is also a subclass of RedGreenLineTool.
class VectorworksRedGreenLineTool : public RedGreenLineTool { }
This sure looks better to our TDD newbie eye. We have a common implementation for both the MockRedGreenLineTool used for testing and a VectorworksRedGreenLineTool used to connect the code to Vectorworks. Running the tests shows we didn’t break anything. Now we are able to use VectorworksRedGreenLineTool in a VWToolDefaultLine_EventSink implementation:
long CTool_EventSink::LegacyMain(long action, long message1, long message2) { long result = 0; switch (action) { case kToolDoSetup: result = VWToolDefaultLine_EventSink::LegacyMain(action, message1, message2); fRedGreenLineTool = new VectorworksRedGreenLineTool(); break; case kToolDoSetDown: result = VWToolDefaultLine_EventSink::LegacyMain(action, message1, message2); if (fRedGreenLineTool) delete fRedGreenLineTool; fRedGreenLineTool = NULL; break; case kToolPointAdded: { WorldPt3 toolPoint; if (gSDK->GetToolPt3D(gSDK->GetNumToolPts() - 1, toolPoint)) fRedGreenLineTool->AddPoint(toolPoint); break; } case kToolPointRemoved: fRedGreenLineTool->PopPoint(); break; default: result = VWToolDefaultLine_EventSink::LegacyMain(action, message1, message2); break; } return result; }
Using the debugger, we are able to verify that everything is working out as expected.
Not a lot of functional but structural code changes in this episode, but we ended up with a class hierarchy which hints at things to come. We expect to push code common between the mock and Vectorworks implementation of the tool up the class hierarchy and code specific to the mock or Vectorworks implementation of the tool in the subclasses.
Let’s see how this class hierarchy holds up in the next episode when we tackle creating a line – test first, of course.
17
Jun 11
Twitter Updates for 2011-06-17
- RT @FridayBruceFix The hungry and the hunted explode into Rock 'N' Roll bands #springsteen Clarence Clemons http://www.fridaybrucefix.com #
16
Jun 11
Twitter Updates for 2011-06-16
- "The goal isn't to scale or to create a movement. It's to write great programs." – http://bit.ly/kBdYle (via @mfeathers) #agile #
- RT @KentBeck i like the accountability of the statement "…and then i ran out of talent" #
- If you don't see the forest for the trees, cut down the trees. #perlsofprogrammerwisdom #
15
Jun 11
Twitter Updates for 2011-06-15
- Kurzer Chat mit dem Entsorgungsfachmann des Vertrauens über die Vergänglichkeit von Rechnern und dann 400kg Elektroschrott abgeladen. #
- Thoughtful piece by @timbray on the web app / native apps controversy – http://t.co/s2iEAoq #
14
Jun 11
Twitter Updates for 2011-06-14
- Soeben Zeuge geworden, wie zwei Angestellte der Gemeinde den lokalen Spielplatz harken & rechen. Die Zeit blieb stehen. #