September 2005 - Posts
I've got to say, I am really loving LINQ. This stuff is so very cool. One thingy I think is missing though is a formal way of defining a transformation.
A common scenario is data or xml needs to come into and out of business objects. In the first versions of .Net the means of doing this was reflection based via serializers, or you could create a hard coded serializer, but it was and is a lot of code, and it was tied to the actual business object structure. Often the data coming in doesn't exactly match that type or name or structure. This is where transformations need to be done. What I would like to see is a formalised transformation structure/mapping, much like an interface or dynamic interface.
E.g
Private Transformation AcemCo_To_WidgetCo
(Name As String) To (Name As String)
(Address1 as String & Address2 As String) To (Address As String)
(DOB As String) To (DateOfBirth AS Date)
End Transformation
So given the above, let's say I had an object, that had the features of the AcmeCo object, Name, Address1, Address 2 and DOB, I could then
(1)
Apply Transformation AcemCo_To_WidgetCo On myAcmeObject To myWidgetObject
Or
(2)
myWidgetObject = Apply Transformation AcemCo_To_WidgetCo On myAcmeObject As New WidgetObject
In the first case, I would be applying the transformation to the myAcemObject and then transferring the values to an existing myWidgetObject. In the second sample, I would be creating a new WidgetObject from the transformation.
Note on the transformation declaration I did not define the incoming type and outgoing type though. That means this transformation would be completely dynamic, and could be applied to any types that meet the field or property requirements of the transformation specification ,such as Name, Address etc.
But we could also make this strongly typed, by specifying the types on the transformation:
Private Transformation AcemCo_To_WidgetCo As AcmeType to WidgetType
(Name As String) To (Name As String)
(Address1 as String & Address2 As String) To (Address As String)
(DOB As String) To (DateOfBirth AS Date)
End Transformation
This code could then be fully verified at compile time, and would be straight property gets/sets.. No reflection required.
I think I would like to see Transformations in VB, and maybe other languages too 
You can make it possible to browse the GAC like a set of folders and files and hence access assemblies that are only in the GAC. Typically I just use a command prompt to do this, but there's a registry hack which lets you do it from explorer:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion]
"DisableCacheViewer"=hex:10
Toogle the value to 0 to go back to the usual view, non zero for folder and file view. Now when you do that you might find some interesting assemblies. My favourite at the moment that comes with VS 2005, is:
C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.Zip
Oh, and an interesting side effect of this is you can now browse to a file in the GAC and add it as a reference to your Visual Studio project.
Enjoy 
Without doubt, there's some pretty cool stuff coming our way with LINQ, especially XLINQ in VB 
And although I've seen some criticism of DLINQ, I think it advances us miles ahead of where we are today. The challenge there now is for 3rd party ORM vendors to integrate that in a seamless way, and for Microsoft to ensure it is extensible to allow them to do so, including, but not limited to, providing other expression tree evaluators for different kinds of database engines.
But what really interests me is the XLINQ stuff. More and more, XML is becoming a standard way to communicate and share data/documents. So these capabilities are v.cool, and vastly simplify the experience. Vb adds to this by allowing you to declare a dynamic interface in respect to XElements . The interface can define elements and attributes you expect to be there. SO this allows for a very loose coupling, where the XML just has to have certain elements or attributes and yet you can work with it use strong intellisense for those known members.
This is interesting because it lets things like "agents" work on/with elements in a documents without having to know the entire document. Sure you could achieve the same with Xpath, but far less elegantly and with no implied type. VB also added dynamic identifiers, which is just a simplified way of using CallByName, which is a vastly simpler way of using reflection.
So is there a direction there ? We can see the strengthening, the evolving of VB's dynamic programming capabilities. Likewise we can see quantum leaps forward in the new query language syntax and integrated XML. Are these two things distinct or is there a bigger picture, a bigger point of convergence ?
Let's look at XML. At present it's pretty rudimentary, a simple "shape" for containing data. But look at html, or xhtml to be more precise. Sure it's document centric still, but suddenly the xml (xhtml) conveys information about actions, about interaction. Now look at XAML, it declaratively provides information for object instantiation, event wiring, and actions. It's "interactive data" streaming to a machine near you soon 
So the view of XML as just serialized data, is perhaps old school way of looking at it, very old school. What XML is, is descriptive language that can be used to describe not only data but also actions and interactions. Can anyone now see that point of convergence, where dynamic languages and XML interact to provide extremely powerful ways of interacting ??

Stop everything and check out the VB9 language futures at :
http://msdn.microsoft.com/vbasic/future/
there's even an example compiler you can run with the Beta of VS.NET 2005 !!
So make sure you check out the LINQ docuement then the DLINQ and XLINQ ones as well.. oh and of course the VB 9.0 one too 
My favourite has got to be the tight integration of XML with VB. (note C# does NOT have this)
Here's an example from the LINQ document :
Dim x = <People>
Select <Person Age=(p.Age) >p.Name</Person> _
From p In people _
Where p.CanCode
</People>
Robert Scobble posted a video of Bill Gates up on Channel 9. This was really cool, as I was having a conversation about Bill Gates just the other day, about how much I love watching/listening to him talk. The thing I love about Bill's talks is he talks about the future, the big picture. He's always willing to talk about general direction and things that might be 10 years out or more. Just about everyone else talks only about version now, version next or maybe version next ++, but generally they are focused on the current or upcoming product. Bill on the other hand adds the continuity, the context that the rest seem to be missing 
So why the woes, well the channel 9 site makes it damn hard to get that video.
first, they design the page such that it only renders correctly in IE *if* you allow activeX, otherwise you'll never see the download button. Firefox renders the page fine. The fix is probably simple such as explicitly sizing the DIV the video is in rather than implicitly letting it determine it's own size.
the next issue is the size of the download --> 240 MB +. That's just ridiculous. In case they haven't heard no we ALL don't have broadband. it's making it accessible as much as telling anyone in a wheelchair they need to buy a stair climber robot rather than them provide ramps instead of stairs. In case they haven't heard in many countries broadband just isn't available. Here recently the truth came out about how our infrastructure has been under funded by the tune of billions of dollars. Just out of curiosity I compacted the video in movie maker, making it suitable for dialup. The result... a mere 5 MB, easy enough for everyone to download and yet still clear enough to make out Bill's body language as he spoke.
Come on Robert, how about making these videos accessible to everyone ?
Geoff points out a “VIP sighting” in the background of Betsy's video . And yes the beer I am carrying is a VB 
thanks Geoff, real shame you weren't there.
Oh, and nice to meet you Betsy
Secret Geek blogs about the Snippet Editor the Vb team and I have been working on in our spare time (is there such a thing ?
) TechEd Oz attendees got a world first preview of the soon to be released version.
I also finally got to meet Leon, and considering he "seems" like such a nice guy being forced to suffer under c# these days, well just for Leon, I'll make sure we include C# in the Snippet Editor
(okay, sure I might have already added that, but shhhh!)
How do you deal with this ? Obviously if the application is run under the limited user's account it can't update shared files in the program files. As a consumer who runs as a limited user I came across this annoyance when using new software from one of the local banks (I won't say "which Bank" <hint, hint>). Their software checks for updates on start-up, and fails if it can't apply them. So it was requiring permissions to write to the shared program files path, which is what I ended up giving it to fix the situation, but that's hardly secure.
The options I see you could do is:
(1) install only to the user's path
(2) install to the shared path having updates only in the user's path.
(3) change permissions on the shared path
(4) use a windows service for updates
1 isn't a bad option, IMO. It's definitely the simplest but not the most secure. 2 is messy, IMO and would cause a lot of duplication. It's no more secure than 1. 3 is a security liability. 4 is probably the ultimate. It can also use bits and work in the background rather than inconveniencing the user each time they start the application.
Which approach do/have you used ?
Well TechEd Oz was definitely BIG !! I had a great time, thanks Chuck and Frank and all the MS people that helped to put it together. I hope those who attended Nick and mine's session had a great time. I definitely appreciated all the positive feedback you guys gave
I didn't get to as many sessions I wanted to, and some of them were things I already knew, but overall the session I did see where great.
The T-shirt count was down on previous years unfortunately. Some of the sponsors had those cool soft Frisbees (was that Citrix ?). To you exhibitors/sponsors --> All I can say folks is you missed out on a lot of free advertising
The Microsoft crew did have some shirts for me though (thanks guys) so look for me advertising their wares at a location near you 
Apart from TechED, I took the opportunity to do some driving around the east coast of this BIG country. Saw lots of BIG beaches, beautiful country side, and some other BIG things like the BIG banana, the BIG avocado etc ...
(only in queensland huh ?) Still, one of the nicest things about seeing all that beautiful country side was getting home and seeing one of the orchards was in full bloom, a sea of white blossoms against such a lovely green countryside
Yag's blogging about the PDC and he's let the cat out of the bag ... well almost... That's right, this Friday stay tuned to your PC's for some amazing videos about the future of programming. Paul Vick and Amanda Silver will rock your world with the amazing stuff they, Yag, Erik Meijer and countless others have been working on. This is going to be really really BIG !!
Now you have been forewarned. All you C# devotees, store up your antidepressants... you'll need them. hopefully they'll set up a C# users feeling like loosers hotline; we really don't want any un-necessary carnage.