Expert Texture
The blogged wandering of Robert W. Anderson
Archive for .NET
June 9, 2008 at 2:13 pm · Filed under .NET, Grid Computing
Last week Microsoft released the first CTP of the Microsoft Distributed Cache (code-named Velocity).
I am definitely excited about this release. While Microsoft is not breaking new ground here, the addition of a distributed cache to .NET is a great addition to the platform. Certainly there are competing technologies, but Velocity will be a very simple choice for developers and ISVs because we’ll be able to count on its availability.
This ISV is interested, so we tried it out.
We have many customers who use our Executive pattern to load and cache job-specific data for compute-intensive jobs on the Digipede Network. These data are often fetched through WS calls or directly from SQL databases. Often this is performed in the Executive.Start method. Before Velocity, the code might look like this:
protected override void Start() {
// read the CBOData object from the database.
_cboData = ReadCboData(cache.Get(JobTemplate.Parameters["CBODataStore"].Value));
}
Including Velocity in this example is really easy. The following snippet adds use of the Velocity cache:
protected override void Start() {
// get cache
CacheFactory factory = new CacheFactory();
Cache cache = factory.GetCache("CBOCache");
// see if our CBOData object is already there
string key = JobTemplate.Parameters["CBODataKey"].Value;
_cboData = (CBOData)cache.Get(key);
// if not, read it from the database.
if (_cboData == null) {
_cboData = ReadCboData(cache.Get(JobTemplate.Parameters["CBODataStore"].Value));
// store it in the cache for later use
cache.Put(key, _cboData);
}
}
With a few lines of code, we reduce the load on the database server and network and spend more time computing. (I’m making an assumption with this simple code that all Executives don’t start at once, an assumption made obsolete by seeding the cache from a master application).
Of course, this is a simple example, but there are many other use cases. For example,:
- Digipede-enabled applications can share results;
- master applications can load the cache with job-specific data; and,
- others where baking Velocity deeply into the Digipede Network start looking pretty interesting.
I have seen many posts on “must-haves” for a Velocity RTM. I mostly agree with the lists I have seen. I’ll have a list too mostly from the ISV perspective.
Cool stuff.
Tags: .NET, Digipede, ISV, Velocity
April 28, 2008 at 1:00 pm · Filed under .NET
David Treadwell was on the latest Gillmor Gang talking about the recent Live Mesh announcement. David’s title is Corporate Vice President, Live Platform Services and has been described as Ray Ozzie’s point man on the Mesh.
It was a pleasure talking with him — and thanks to David for the LiveMesh invitations.
The synchronization capability in this preview is a big deal not in what it provides, but for what it promises.
That is why it is a little disappointing that there is such a heavy emphasis on Windows and Windows Mobile. I discount the coming Macintosh support because support for non-Windows mobile devices is really the issue. If iPhones and Blackberrys are out of the equation, then the synchronization story isn’t so compelling.
Nobody should be surprised about Microsoft promoting Windows. And I certainly am not, but Microsoft’s new openness had me hoping for a different alignment of Microsoft strategy. One in which their S+S play would de-couple the Windows, Office, Windows Mobile, and Live businesses. I saw this happening through the Silverlight runtime everywhere. I hoped that the mobile Live Mesh synchronization client would be written on top of Silverlight. I hoped that the next Office Mobile would be too. Then Live services could serve any device running Silverlight. And so on. I’ve written about this previously, so I’ll leave it at that.
Instead, Microsoft is approaching Live Mesh as a set of open protocols that anyone can implement. So, an iPhone version could be written by a 3rd party using the Apple SDK. Just implement the protocols — of which FeedSync seems to be the major part — and you are all set. That is very good and much better than requiring the use of a Microsoft runtime to make it happen.
But, in addition to the open protocols, I would still have preferred a vision where the Silverlight runtime lies underneath the Microsoft implementations of the Live Mesh client. That way, when the next big feature set for Live Mesh is released, the new client code could conceivably run everywhere.
I want to make one thing clear: I’m not saying that Silverlight in its current form could support this at all. And I know Silverlight’s (nee WPF/E) genesis emphasized presentation, but at the end of the day, it is a .NET runtime.
As David says (from the Gillmor Gang transcript on TechCrunch):
Treadwell: I really view mesh and Silverlight as orthogonal and complementary technologies. Essentially what the mesh client does, it’s the runtime for doing synchronization and collaboration those kinds of things. I view Silverlight as a runtime that does the presentation engine. Mesh doesn’t really have anything for presentation, Silverlight doesn’t really have anything for synchronization and mobile communications. Working together I think you have a very good thought there about the combination of these and how they’ll come together. We’re working actively on that but we don’t have all the I’s dotted and t’s crossed.
Yes. They are orthogonal if Microsoft says they are. And Live Mesh and Silverlight will somehow come together though this appears to mean in terms of presentation. Fair enough.
And more than a little cool.
Tags: .NET, FeedSync, GillmorGang, Live Mesh, Silverlight, Treadwell
March 19, 2008 at 8:21 am · Filed under .NET, Web 2.0
Now that we have the Adobe CEO saying, We’re bringing Flash to the iPhone.
How many more days until we hear Microsoft publicly commit to Silverlight on the iPhone? I bet we hear it within two weeks.
Why do I care? It validates some of my earlier arguments. Here and here.
Scott Guthrie? What do you say?
Update: Adobe clarifies CEO’s iPhone Flash comments. Maybe Apple will fight to keep their platform closed after all.
Tags: Adobe, Apple, Flash, iPhone, Microsoft, Silverlight
March 12, 2008 at 9:00 am · Filed under .NET, Web 2.0
Alex Iskold of ReadWriteWeb tells us Why Apple Will Dominate Next Gen Computing. He is wrong.
Apple’s success isn’t about the software
Alex Iskold’s premise is that Apple’s software platform is superior, therefore they will dominate. He says . . .
Apple’s secret sauce has been its software.
First off, this is not Apple’s secret sauce. Apple’s not-so-secret sauce is their ability to deliver highly-polished total product: hardware + software + services + image.
Controlling the hardware and software is a baseline requirement for a company to do this, but they go beyond that to build beautiful, desirable, and highly functional total products. A good part of this is observable beauty and another part is pure marketing genius: the creation of desire and belief in the hipness of the product.
Compare Apple’s total product approach with . . .
- Microsoft licenses Windows Mobile for a variety of devices, not being a handset manufacture, it doesn’t control the total product. For example, Samsung Blackjack. Popular phone? Yes. Windows Mobile a flop? No, but for user experience it compares very poorly against the iPhone.
- Microsoft licenses Windows Vista to a wide range of OEMs. Same story. A little worse because when they did have influence over the total product, they botched it. Example? The Vista Ready campaign and surrounding lawsuits.
- Palm? They had the slickest PDAs for quite some time. They controlled the total product but forgot the services part so Blackberry beat them handily. There death nell was selling of the software and licensing WM5.
- The XBox 360. Microsoft builds the hardware + software + service. Runaway success. Home run.
My point?
It isn’t the software, it isn’t the hardware, it is the total product. When a company controls the total product they can achieve Apple-level success.
Why Apple won’t dominate
To dominate, Apple has to penetrate into the greater computing space (and stop being a high-priced niche brand). Either
- their hardware becomes ubiquitous; or
- they broadly license their platform to other hardware manufactures.
The first one is ludicrous: user preferences are too varied for a single hardware vendor to be the one solution. Apple has mostly done it with the iPod, but that is a piece of consumer electronics and pales in comparison to the complexity of computer systems in general. If they believe this to be a good strategy, they would likely have to greatly broaden their product mix and lower their prices.
The second one, while certainly possible, would greatly complicate the Apple story, Apple software quality, messaging, etc. And still, broadly licensing technology will not result in domination.
Only if Apple chooses one of these approaches can they possibly dominate next-generation computing. And then they have to execute brilliantly. And then several years have to pass for people to be in a position to replace hardware. And then a huge migration has to occur. And then, Cocoa what?
Anyone think this is Steve Jobs plan? No way.
And if it is? Short Apple. There is too much choice out there in terms of hardware, developer platforms, better licensing models, nascent cloud platforms, etc., for Apple to dominate.
Tags: Apple, iPhone, Microsoft, Palm, Platforms, ReadWriteWeb, Windows Mobile, XBOX
March 7, 2008 at 12:20 pm · Filed under .NET
A little late, but here are my notes on the Steve Ballmer keynote at MIX08.
The Q & A format was certainly better than having Steve Ballmer just talk for an hour, though I got a little tired of Guy Kawasaki’s cracks at Ballmer — about his wealth and method of travel, how Microsoft “should have hired” him. It got better when he stopped that.
I thought the best questions were from the Audience:
On .NET being baked into IE
Why isn’t IE built on .NET.
This has been a common theme, that is, the lack of .NET adoption for some major Microsoft products. Part of that is dog-fooding, but a bigger part is that the developer stories for these products are harder for lack of deep .NET support. For example, Office and IE are not based on .NET. Connecting between their unmanaged, COM, BHO worlds and the managed .NET world is more than a little painful.
Anyway, his response was that .NET wasn’t expected to be as proven and as far along by the time Vista shipped. Fair enough, but I would have been happier if the delays in Vista were related to a real WinFx in the OS than the reasons given.
The iPhone
What about Silverlight for the iPhone?
Steve Ballmer responded (paraphrased) . . .
Would love to get it on everything;
Can’t say we’ve been having talks about it; and
Licensing model not so good.
Right. The licensing model is not so good.
Maybe Microsoft can pay Apple a bunch of money so Silverlight can run on the iPhone. Then developers can build the apps for free?
Sounds good to me.
Tags: .NET, IE, IE8, iPhone, Longhorn, Microsoft, Silverlight, Vista
March 6, 2008 at 11:11 am · Filed under .NET
Onstage during his keynote at MIX08 yesterday, Scott Guthrie said they’ll be bringing Silverlight to “everything with an SDK”. Yesterday, I suggested this was a dig at the iPhone with its lack of an SDK.
Of course, that was yesterday and today we expected an announcement from Apple on the new SDK. I also surmised that the SDK wouldn’t be deep enough for Silverlight, but reports are that I was wrong.
So, my guess is that Scott was hinting at Silverlight for the iPhone.
Cool.
So, Scott, when we’ll we see it?
And Ray Ozzie, please get the Office Team onto .NET, specifically the Office Mobile Team onto Silverlight.
Tags: .NET, iPhone, Microsoft, MIX08, office, Office Mobile, Ozzie, ScottGu, Silverlight
March 5, 2008 at 1:55 pm · Filed under .NET
This is the third of three posts on the MIX08 keynotes. This is like live blogging without the live, since I’m writing this in Oakland. You can follow my comments at http://twitter.com/rwandering.
Scott Guthrie et al.
Most of the discussion was on Silverlight 2. This is the coolest thing Microsoft is doing in the Internet space and it is (happily) pervading a lot of their strategy.
Media
- Silverlight 2, adaptive streaming very cool.
- Advertising templates for Visual Studio. Struck me as odd, but it looks good, and advertising is the corner stone of free. I won’t be running out to try this one.
- Double-click and Silverlight. To keep “gold standard of reporting”, they support Silverlight for instream ad delivery. Makes sense.
Silverlight 2
- Silverlight 2 supports many languages (including JavaScript). This is such a benefit to the .NET strategy that blows the doors off of Air and Java.
- Silverlight 2 built-in controls will truly accelerate Silverlight adoption. New controls open-source with unit tests. Very cool.
The Silverlight demos did not disappoint
- Hard Rock International demo was really cool. They showed deep zooming to incredible detail and zooming way out to see the entire collection, tiled. Lots of Beatles stuff in there too. Yay.
- Aston Martin site cool too. The number of options that a user can select.
- Cirque de Soleil Human Resources system. Custom built HR system. This kind of application shows how IT can’t ever really be dead. That is, one-size-fits-all HR systems don’t work where a company sees competitive advantage or reduced costs in custom systems.
WPF Enhancements
- Performance.
- Better controls.
- Write custom effect that can be pushed down to the GPU.
Silverlight Mobile
Windows Mobile and Non-Windows Mobile, but what does that mean? Nokia Symbian, of course, but what else? Scott says more and more devices. In fact, he said,
Everything with an SDK.
Is that a dig at the iPhone? I wonder if the iPhone SDK when released will be deep enough to allow Silverlight. My guess is no.
Anyway, good job Scott. I’ve said it before, and I’ll say it again. The Microsoft .NET strategy really rocks.
Tags: .NET, iPhone, Microsoft, MIX08, Nokia, ScottGu, Silverlight, Symbian
March 5, 2008 at 11:22 am · Filed under .NET
This is the second of three posts on the MIX08 keynotes. This is like live blogging without the live, since I’m writing this in Oakland. You can follow my comments at http://twitter.com/rwandering.
IE8, Dean Hachamovitch, GM IE
Focus on standards compliance. This will be a great productivity boost for web-site developers.
1. CSS 2.1.
2. CSS cert.
- Funny that Microsoft is claiming that ambiguities in the specs make it hard to prove correctness. They are correct, but it sounds a little like whining. It also reminds me of the Server 2008 test.
- Test cases from Microsoft, good.
- IE 8 transition might be painful. For users.
3. Performance.
4. HTML 5.
- Back button can work with AJAX. This is a very big deal for improving the consistency of the browser user experience.
- Connection events in HTML 5 / DOM storage, re-connect, “make content available” later. Cool.
5. new dev tools
- Cool script debugger in IE8. Looks like the developer toolbar has gotten much better.
6. Activities
- User activities added to browser by users (kind of like smart links).
- Activities are defined in XML. Kind of cool, though I can see the browser becoming hard to use as a user adds a bunch of activities; however, that is up to them to manage.
- This format is the OpenService Format Specification. Share/Share-alike spec.
7. WebSlices
- Users can subscribe to parts of web-pages (driven by sites providing this as a service).
- This is the WebSlice Format Specification. Public domain spec.
8. IE8, Beta 1 for developers
- Released today. Cool. I will be checking this out. At first in a VM. I hope IE7 can live along side IE8. Since they didn’t mention this, my guess is no.
Tags: IE, IE7, IE8, Microsoft, MIX08, Silverlight
March 5, 2008 at 10:55 am · Filed under .NET
This is the first of three posts on the MIX08 keynotes. This is like live blogging without the live, since I’m writing this in Oakland.
You can follow my comments at http://twitter.com/rwandering.
Ray Ozzie
Ray Ozzie opened the MIX08 conference keynotes talking about the overall Microsoft strategy. He said all the right things about the transition to the cloud. Talked about three principles (social device mesh, business, fabric of small pieces). No surprises here.
In the context of the world of connected systems, he said (paraphrased) . . .
Magic of software to bring them all together into . . .a mesh
I love the expression “the magic of software”. Of course, we developers are not magicians, but when things are done right there is a real feeling of magic. This is especially true when disparate systems begin working together through elegant and open standards.
He spent most of his time talking about 5 scenarios . . . here are some thoughts.
1. Connected devices
His vision of bringing your different devices together reminds me of the Blackberry Enterprise Server, but for consumer devices.
2. Connected entertainment
License media / collections (playlists) / subscriptions once, use any device for playback. This is kind of a holy grail, I think. If this is managed through a SilverLight runtime we may have a hope that it is across devices.
3. Connected productivity
Office PC, Office Mobile, Office Live — seamlessly allow users to work across devices, using the right tool at the right time. No info on licensing costs, or on the details of Office Mobile. If the Mobile story requires Windows Mobile, then this isn’t so compelling.
4. Connected Business
Exchange in cloud. Other services too. Good. Very good.
5. Connected Development
Of course, .NET + Silverlight, Expression, . . . Good stuff.
Tags: Microsoft, MIX08, office, Ozzie, Silverlight
February 28, 2008 at 7:39 am · Filed under .NET
Last week, Bart de Smet wrote about calling the Task Scheduler in Windows Vista (and Windows Server 2008) from managed code. In his usual style, he does a great job diving into the topic.
It reminded me of something I did last year for Windows Server 2008 Certification: write code to start an unprivileged task in Windows 6 specifically written for installers.
If you are familiar with UAC, you know that applications identify their least required privilege level in their manifest. Applications that don’t require elevation identify themselves with the level="asInvoker" tag (the value may be confusing, but makes sense).
This creates a bit of complexity for installations that launch applications when they finish. If your installation required elevation, but the launched application does not, what should you do? Windows UAC guidelines say that you should launch them unprivileged. This makes sense: you don’t want an application to run elevated as a side-effect of the installation.
And you do this by starting the task in the Windows 6 task scheduler.
The UAC guidelines contain some C++ code for this, and Bart has a managed version, but for reasons of maintainability and consistency, we wanted VB Script. I was able to find some pieces of this online, but the following code is basically a port of the UAC Guidelines version with a check for Windows version too.
' Arguments
set args = WScript.Arguments
if args.Count >= 1 then
strCommand = args(0)
end if
if args.Count >= 2 then
strArguments = args(1)
end if
' Determine the version of Windows
set objWMI = GetObject("winmgmts:\\.\root\cimv2")
set colOS = objWMI.InstancesOf("Win32_OperatingSystem")
for each objOS in colOS
version = split(CStr(objOS.Version), ".", 2)
next
if CInt(version(0)) < 7 then
' pre Vista / Server 2008. Just run the task directly
set objShell = CreateObject("Wscript.Shell")
set objProc = objShell.Exec(strCommand & " " & strArguments)
else
' Vista / Server 2008 or later. Schedule it for immediate execution
scheduleTask strCommand, strArguments
end if
' Schedule a task for immediate execution; requires Windows 6 or later
private sub ScheduleTask(strCommand, strArguments)
' Some constants we need
TASK_TRIGGER_REGISTRATION = 7
TASK_ACTION_EXEC = 0
TASK_CREATE = 2
TASK_LOGON_GROUP = 4
on error goto 0
' Get the TaskService class
set pService = CreateObject("Schedule.Service")
' Connect to the task service.
pService.Connect
' Get pointer to root task folder.
set pRootFolder = pService.GetFolder("\")
Randomize(20000)
taskName = "MyBackgroundTask " & CStr(Rnd(1000))
' See if task exists, delete it if it does.
on error resume next
pRootFolder.DeleteTask taskName, 0
on error goto 0
' Create task
set pTask = pService.NewTask(0)
set pSettings = pTask.Settings
pSettings.StopIfGoingOnBatteries = false
pSettings.DisallowStartIfOnBatteries = false
' Create trigger
set triggerCollection = pTask.Triggers
set trigger = triggerCollection.Create(TASK_TRIGGER_REGISTRATION)
' Create a new action
set actionCollection = pTask.Actions
set action = actionCollection.Create(TASK_ACTION_EXEC)
action.Path = strCommand
action.Arguments = strArguments
' Register the task using users group
set registeredTask = pRootFolder.RegisterTaskDefinition(taskName, pTask, TASK_CREATE, "S-1-5-32-545", null, TASK_LOGON_GROUP, "")
' give 10 seconds for the task to start
for i = 0 to 100
state = registeredTask.State
if state = TASK_STATE_RUNNING then
break
end if
WScript.Sleep 100
next
' delete the task
pRootFolder.DeleteTask taskName, 0
end sub
You can see it takes arguments for the application and an argument to pass to the application. Also note that the VBS must be run elevated in Windows 6, otherwise tasks cannot be scheduled.
Ah, VB Script. You gotta love it. Or not, but I wish someone else had posted this!
Note to Microsoft: you would have saved a lot of people time if you had included a VBS version in your guidelines document.
Tags: Server 2008, Task Scheduler, UAC, VBS, Vista, Windows 6
Next entries »