2008 Summer Road Trip

As mentioned on both Darryl's and JB's blogs - in February of next year Chris, Darryl & JB will be touring around New Zealand to tell you all about "2008" (SQL 2K8, VS.NET 2K8 & Windows 2K8 that is) and they're getting "locals" to participate in the various centers, and I just happen to be that "Local" for Auckland, though hopefully not too "Local".

So either follow the links above for the full announcement of centers and dates, or if you are local to Auckland then just click on the following link and sign yourself up for the session on Monday February 4th - it's also worth noting that if you both register and turn up (I believe you have to do both ;o) you go into the draw for one of 3 home servers... education and swag.

It should be a lot of fun, so register and come along next year!

Edit: just noticed Chris has also  posted, and included some extra details - so take a look!

Read More

Volta WinForms..

So I've been playing with Volta in my spare time this evening -
just had a go at tier-splitting a winforms application to see how
that works... so I did something pretty trivial, the form has a
button, you type a name into a textbox, click the welcome button,
it invokes a method on the welcome service and outputs the results
to the textbox... I plan to tier split between the client and the
underlying service, so that the service could be executed on a
"Server".




alt="2_simple_winform.png" border="0" height="300" widthsrc="300" />


public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void welcomeButton_Click(object sender, EventArgs e)
{
SomeService service = new SomeService();
welcomeOutput.AppendText(service.WelcomeMessage(nameTextBox.Text));
}
}

The service itself looks like this:



[RunAt("Server")]
public class SomeService
{
public string WelcomeMessage(string name)
{
return string.Format("Welcome: {0}", name);
}
}


Unlike a web-app, you can't seem to use "RunAtOrigin" for
indicating a tier-split between client/server - when you think
about this makes sense (you could have more then server for a
win-forms app, because the "origin" and the client are the same
thing, unlike the client (javascript) and origin (web server)
relationship that exists for a web app.



Now running the application spins up the Volta test server, if you
click on volta icon (btw, cudos to whoever did the volta
branding/logos - I love em) in the system tray, you can tick the
"log requests" to see what traffic between client/server is
occurring... clicking the welcome button shows two requests being
made for each button click.




alt="1_log_requests.png" border="0" height="323" widthsrc="590" />



Now moving our eyes towards the tier splitter's output, we can see
on the client side that our test service class is converted into a
proxy (obviously)


[RunAt("Server")]
public class SomeService
{
// Fields
private Guid __id;
private static ClientMap __map;
private static string __uri;

// Methods
public SomeService()
{
object[] parameters = new object[0];
this.__id = Proxy.Call(__Serializer.GetInstance(), __GetUri(), "SomeService", 1, null, null, parameters);
__GetMap().Add(this.__id, this);
}

private SomeService(__TypeSerializer __typeSerializer)
{
}

private static ClientMap __GetMap()
{
if (__map == null)
{
__map = new ClientMap();
}
return __map;
}

private static string __GetUri()
{
if (__uri == null)
{
string service = ConfigurationManager.AppSettings.Get("Server");
if (service == null)
{
throw new ArgumentException("Could not find application configuration entry for 'Server'.");
}
__uri = ServiceLocation.GetService(service, "__TierSplit.aspx");
}
return __uri;
}

public string WelcomeMessage(string name)
{
object[] parameters = new object[] { name };
return Proxy.Call(__Serializer.GetInstance(), __GetUri(), "SomeService", 0, this, null, parameters);
}

// Nested Types
public sealed class __TypeSerializer : AbstractTypeSerializer
{
// Methods
public override SomeService Deserialize(ISerializer serializer, IObjectReader reader)
{
reader.ReadSeparator();
reader.ReadMemberName("id");
Guid id = new Guid(reader.ReadPrimitive());
ClientMap map = SomeService.__GetMap();
SomeService byID = (SomeService)map.GetByID(id);
if (byID == null)
{
byID = new SomeService(this);
byID.__id = id;
map.Add(id, byID);
}
return byID;
}

public override void Serialize(ISerializer serializer, IObjectWriter writer, SomeService value)
{
writer.WriteSeparator();
writer.WriteMemberName("id");
writer.WritePrimitive(value.__id.ToString());
}
}
}



And on the server-side, our service has also been altered slightly,
note the inner __Service class:


[RunAt("Server")]
public class SomeService
{
// Methods
public string WelcomeMessage(string name)
{
return string.Format("Welcome: {0}", name);
}

// Nested Types
public sealed class __Service : Service
{
// Methods
public override string get_Name()
{
return "SomeService";
}

protected override void ProcessMethod(Service.Call call)
{
switch (call.GetMethod())
{
case 0:
call.Return(call.GetInstance().WelcomeMessage(call.GetParameter(0)));
break;

case 1:
call.Return(call.AddInstance(new SomeService()));
break;

default:
throw new InvalidMethodException();
}
}
}
}



Now what about those two requests - looking at the code we can
deduce that the two calls are occurring first for
construction/registration of the client proxy, and second for
handling the message - changing the client app to look like
this:


public partial class Form1 : Form
{
SomeService service = new SomeService();

public Form1()
{
InitializeComponent();
}

private void welcomeButton_Click(object sender, EventArgs e)
{
welcomeOutput.AppendText(service.WelcomeMessage(nameTextBox.Text));
}
}



And clicking the welcome button fixes the behavior, so that for
successive button clicks only one request is being generated.



Afraid that's all I have time for tonight... but I'll post more
about my Volta explorations this week when I get spare
moments.
Read More

Architecture Chat 21

So plenty of subjects today, though a small'ish turn-out, kinda goes with the time of year, and is probably also related to the bar camp Agile down in Wellington tomorrow, which I know at least one of the regulars is heading to.

Code protection and obfuscation was floated by Garreth - sparked off by his need to find a new code protection production, as the product he currently uses doesn't appear to be under development any longer (.Net Reactor I believe was the product).

In fact, it's worse than that - he suspects that the Author may have had an accident or something similar, because the releases stopped a few months back and the Author is no longer replying to questions or queries on the forum, but prior to that was a very active individual - He can't even be contacted by cell phone.  Incidentally if anyone reading this knows of the Author or his fate personally, we'd love to find out more.

Right - so deploying key logic on web-services and some of the alternative licensing products having a requirement of a windows service being installed alongside the product got discussed, with the good and the bad points - it was interesting to see that most of us didn't mind having a windows service installed on our machine to license the product, as long as it was well behaved and made it abundantly clear that this was being done by the product, and was named/described well (so you knew just what it was) - Garreth just
wanted to confirm this with some fellow developers because he's looking into a range of products including PRO-Tector from Nalpeiron that uses this approach, and was worried he might get too much "kick back" from his target customers (i.e. other developers).

From there we moved onto obfuscation products - we've talked about these before, including  Dofuscator and SmartAssembly which came highly recommended from AndrewMindscape.

All of this rounded up with a discussion around "should you even bother obfuscating" and the rationale behind Microsoft obfuscating key portions of their technologies such as SharePoint or Dynamics CRM (i.e. not just protecting IP, but perhaps protecting volatile
and undocumented behaviour which you might leverage or rely on which could be broken easily between service packs for even the same version of the product).

Garreth also recommended Kagi that none of us had heard of - which is a great e-commerce solutions/services provider that goes above and beyond using alternatives like Paypal or local credit card merchants, key differentiating points he made
were:

  • It takes care of varying Tax legislation etc. so you don't personally need to think about collecting VAT etc. - because they act as a "reseller' for your product.
  • Supports non-electronic processing i.e. Cheques, purchase orders, direct debit etc.
  • Entirely customizable UI, can be entirely gutted and made to look like your own site.
  • It understands selling Software and digital content, and provides call backs so you can integrate custom license generation etc.  Within the payment site and provisioning workflow.


It could be just the ticket if your thinking of selling some software and don't want to completely roll your own solution.

Next I ran quickly through the various product announcements etc. over the last 3 weeks - We pretty much bypassed everything and headed straight to Silverlight 2.0 and Volta (VS2008 is old news already, though the Isolated VS2008 Shell got a mention, however most were shocked at the size of the redistributable component - 315MB - that's a big ask if you want to leverage it for a simple product/project).

I was also hoping to get back to talking about the ParalellFX CTP which I've also been playing around with - but never got the opportunity.

So Volta has featured in previous discussions - some of us didn't even imagine it would see the light of day - yet we now have a preview in our
hot little hands which can be played with - I took it for a test drive this morning, and miraculously it works!?

With naught but an attribute I was happily able to move code between my client script and server... We discussed the implications of this, the intended audience (It looks very
appealing to existing win forms developers who have resisted until now from engaging a web platform, because it feels very "familiar").

I'm quite keen to take an existing windows forms application and see how easily I can move from thick client to web client/server using this approach i.e. just how much of the existing code base, event driven structure etc. can be maintained - even in its current
state I think it could do a pretty good job of converting some winforms apps I've built in the past, short of re-implementing complex visual controls.

Things I've still yet to try:

  • Unit testing with NUnit (can't see why it wouldn't work though)
  • Introducing additional tiers i.e. tier splitting between an application server, webservice and client script (not sure this works when using Visual Studio at the moment - the release notes suggest "no", so will probably require some spelunking and command line compilation at this stage.


We talked about Silverlight 2.0, its release date (probably near the end of Q1 2008) - and just what ships and what doesn't i.e. is there a compiler and does it live on the server, extensible control model, 2-way data binding etc.  Certainly Silverlight 2.0 is looking very comprehensive, and the Silverlight team look to have been/are very busy (I wonder how on track the Moonlight team are, considering the surface area of things to develop has grown somewhat from the original 1.1 scope).

Next we talked about DSL's ... what makes a DSL... the stages of DSL'ness from the "barely there" Fluent interface, through to varying grades of internal DSL and finally a custom language which requires parsing into a syntax tree (which F# is great for I think)
and being consumed by your application, or a Visually depicted DSL, ah-la Microsofts DSL SDK for VS.Net.

In the same conversation we also talked about operator overloading, making things explicit, avoiding operators all together (i.e.  "A == B" is far less meaningful in relation to a domain specific language then "A.Equals(B)" or even better "A equals B" - i.e.
being terse may prevent your DSL from being explicit enough to be read by the people who best understand the domain language and the concepts it's modeling to begin with.

We also talked about the things which make a internal DSL work well with languages like Boo i.e. the ability to drop braces, and whitespace awareness (which I hated, but I'm gravitating back towards liking it once more in the right context, because a couple
of spaces is a lot nicer to read then opening/closing braces and associated visual noise - and it's easier to show the raw code to clients when discussing problems because it's less confusing).

Along the same line we talked about operator overloading conventions and on a side note Peter gave Algol a mention for having such wonderful (!) set of operators and needing a special keyboard or a memory for keystroke combos ;o)

?, ?, ?, ?, ?, ?, ?, ??, ?*, %?, ?, ?:=, ?:=, ??:=, ?*:=,
%?:=, ~ ?, ?,?::=,:?:, :,::, ::=...

He also mentioned Postscript, though I don't know much about its operators etc. and didn't really feel like digging up some samples from the red book.  Incidentally F# lets you define new operators:

let ( <:-> ) a b = string.Format("{0} is happy about {1}", a, b) let ( <%=> ) a b = string.Format("{0} is confused by {1}", a, b) let m = "mort" <:-> "user defined operators" let n = "but mort" <%=> "his own code" let result = Console.WriteLine("{0}, {1}", m, n)

Which of course displays:

mort is happy about user defined operators, but mort is confused
by his own code.

From there we branched into discussing multi-language projects - i.e. why do we need to have separate languages in separate assemblies... a lot of us fondly remember the old days of in-line assembler, and would like opportunities to use a language like F#, Boo or one of the DLR based languages in-line within a C# or VB.Net project - i.e. within the bounds of a function/method... I see F# pattern matching as a great example of where this would be really handy - same goes for embedding your own DSL's in-line, or even leveraging a few lines of concise ruby code to do some string manipulation.

I suggested a compiler model much like Boo's would work well in allowing this to happen - though there are issues with just how you compile it, approach merging the separate chunks of IL etc. and cross-referencing.

PDF file parsing got discussed - there is a binary and text based standard (which is largely human readable) - Peter suggested that ABC PDF is very good at pulling apart PDF documents for information extraction in the Enterprise edition, and also supports CMYK colour, useful if you're working with professional printers.  Because there isn't much metadata stored in many cases, you often have to rely on specific style information to identify key bits of content.

We then had a talk about model driven architecture, and in particular, integrating UML models, code and business related information such as device and install inventories, and product life cycle information - we're finally starting to see some traction in New Zealand in this space, and it's ushering in the rise of the true "Enterprise Architect", with people becoming more aware of frameworks for Enterprise Architecture such as Zachman, TOGAF etc. and realizing the true value of driving from an ultimate and largely strategic
high-level organizational model of past, present and future systems (including when certain systems are going to be retired), all the way down to individual applications, business processes, use cases, test scripts/runs, classes, unit tests, machine inventories and even live application data that can be used to be make decisions... even as a develop this has real value, i.e. integrating with a system you could identify how many systems integrate with it, when it's due to retired/replaced/upgraded, maybe how many transactions it's processing, or how often it refreshes itself with key business data from other parts of the organization.   I saw a nice example of this just last week at the  EA Symposium presented by IAG.

It's definitely a subject I'd like to visit again in the future, and perhaps we can get one of the NZ experts in this field to come and participate such as Lukas Svodba (who also runs the arcast.co.nz site) - this also ties in with MDA and MDG, The later of which I'm still having difficulty reconciling with a largely agile test driven development process.

Also on that note I mentioned the JetBrains meta programming system and wondered if it will ever reach a v1 status, I had high hopes for it a couple of years ago.  It doesn't seem to have had much activity associated with it over the last couple of years (I almost wonder if it was largely an Idea which was well before it's time for a lot of the .Net community, that are only now starting to appreciate DSL's and considering working/developing at a higher level of abstraction - or lower level if you look at it from the perspective of the problem your trying to solve i.e. closer the metal of the problem domain itself).

We pretty much wrapped it up there, so that's year 1 of the Architecture Chats brought to a close (we decided against one more for this year, because of the holidays and not to mention our venue being overrun with rampant shoppers, probably removing any chance of finding a park or hearing ourselves think!)

Big thanks to Alex James (Meta me) for getting this chat off the ground, and thanks to all the regulars who come along every fortnight - you've all helped to make the Architecture chat one of the most successful and interesting recurring events I've had the pleasure of attending/participating in - and it's been great to have been able to swap ideas and information over the last year.

Have a merry Xmas and a happy new year one and all!

Read More

Connectivity woes

Well this blog, the wiki and all the other associated services disappeared for most of today... thanks to the magic of NoAuth ... for no reason that anyone could explain to me beyond "it sometimes happens" - Orcon lost Authority over my business DSL connection, and it reverted back to Telecom/Xtra (New Zealands "legacy" telco)... and it took must of today for them to get the authority changed back, I don't think this was any fault of Orcons, but it still pissed me off no end.

So apologies to anyone wondering where my blog went, or any of the related services - I do have plans to migrate the blog to US servers in the not to distant future.  And big apologies to all the Architecture chat participants, sorry I couldn't get a reminder email out sooner.

On a different note - It did identify a need for me to maintain a secondary connection, with a static IP, that I can fall back to if required... thankfully the three concurrent projects that have been in UAT over the last couple of weeks have all wound down now - so it didn't have as much impact as it could of.

Though at least they wouldn't have been able to log bugs about servers being unavailable, Trac would've been unavailable too ;o)

... so any suggestions as to what would make an adequate fall back technology (something other then DSL, I've used wired country two-way-radio to the sky tower in the past which has worked well, but it doesn't give much "bang" for buck and has a high up-front cost last time I checked) ... I'm not too worried about 1 day downtime, but if this had been 3 or 4 days it would've been quite damaging for me, customers and those intangibles like reputation.

At any rate - thanks for the patience, and I'll see some of you at the Architecture Chat tomorrow.

Cheers,

- Alex

Read More

2007-12-04 - Architecture Chat Tomorrow

That's right, it's time for another Architecture chat
Tomorrow

So as I mentioned last week - The Architecture
chat
is being held this thursday, 11:30am at Sylvia Park in
Auckland (at
Garrisons
), all are welcome and encouraged to come along and
share your views.

Some topics / announcements that have taken my eye over the last
3 weeks which might make good discussion fodder:

And some conversational topics related to what I've been working
on lately...

  • Agile model driven development and
    just how can you combine model driven architecture (MDA) with
    test driven development and code-level refactoring.
  • Writing parsers using F#,
    leveraging pattern matching & Active Patterns - and integrating with other languages like
    C#.
  • Visual DSL's - the good and the bad, and at what point does it become
    justifiable to roll your own for specific business needs?

If anyone has any topic suggestions either leave a comment or
email/IM me (IM details are on the left, in the "Who am I?"
section).



See you all tomorrow!



Edit: and as a late edition, I've also had a play/look into the
very recently released Volta if anyone is interested -
if you've got the time before xmas, I'd definitely suggest doing
their quick start
tutorial - interesting.


Read More