Rockford Lhotka's Blog

Home | Lhotka.net | CSLA .NET

 Monday, July 14, 2014

From around 1995 until 2010 there was really only one operating system for client computing: Windows.

Prior to 1995 there were a lot of options, though most not recognizable to users today: 3270 terminals, VT terminals, OS/2, Windows, DOS, CPM, and a bunch of others. Now most of these weren’t “client computing”, they were relatively dumb terminal technologies that provided access to a server (back then called a mainframe or minicomputer). Very much like today’s web browser (sans JavaScript).

Today we’ve returned to a chaotic landscape of client computing: browsers, Windows, iOS, OS X, Android, Linux (for the daring), and of course it isn’t like the pre-1995 technologies went away, they are just mostly emulated in Windows. What is interesting though, is that most of today’s client computing technologies do actually enable smart client software development. This includes the browser which can be used as a smart client technology via JavaScript development, even though the majority of browser “apps” are actually just colorful versions of 1990-era terminal-based computing where the processing is all on a server/mainframe/minicomputer/whatever-you-want-to-call-it.

What is interesting about this return to client-side chaos is that it has reopened the door for third party developer tools as a niche market.

In the early 1990’s there were quite a number of companies selling developer tools for other company’s platforms. Borland with C++, Delphi and TurboPascal, Gupta with SqlWindows, Powerbuilder, and a lot more.

When Windows became the dominant client computing platform most of these dev tools fell by the wayside (not that they went away, they just stopped being mainstream). This was because they couldn’t compete with Microsoft’s dev tools, which were always in sync with the platform in a way that was probably too expensive for third parties to match.

I think it is notable that our return to client computing chaos (or pluralism?) today has already led to numerous third party dev tool vendors that sell dev tools for other company’s platforms. Xamarin, PhoneGap, Telerik’s tools, and a lot more.

What is different to me is that in the early 1990’s I thought it was pretty obvious that Windows would become a dominant platform, and I tended to argue against using third party dev tools because I thought they’d have a rough go of it. As cool as Delphi was, I always recommended VB.

Today I’m not so sure. I don’t see any of today’s platforms becoming dominant in the foreseeable future. It is hard to imagine Windows returning to its monopoly status, but I can’t imagine iOS or Android or OS X displacing Windows as the primary corporate desktop computing environment either.

As a result we business developers need some way to build software independently of any particular platform or OS vendor, because we must assume all our business software will need to run on multiple platforms and OSes.

So today I find myself in the inverse of my early 1990’s stance, in that I’m reasonably convinced that building smart client software (at least for business) means using third party dev tools from vendors that aren’t tied to any one platform.

Of course I’ve spent the last 14 years in the .NET world, so naturally I gravitate toward a combination of Xamarin and Microsoft .NET as a way to use my C# and .NET knowledge across all platforms. I get to develop in Visual Studio on Windows where I’m most comfortable, and my resulting software runs on Android and iOS as well as on Windows Desktop, Phone, and WinRT.

As far into the future as I can see there’s no obvious platform/OS “winner”, so as a developer the question isn’t which platform to target, it is which third party dev tool reaches all platforms with a solid strategy that will stand out and thrive over the next many years.

Monday, July 14, 2014 1:00:31 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Monday, April 28, 2014

As well all know, portable class libraries are pretty cool, but are restricted by the “lowest common denominator” effect.

For example, CSLA .NET supports the use of DataAnnotations along with the richer CSLA rules engine.

In trying to create one of the new “Universal PCL” assemblies to support WinRT on Win8 and WP8 I ran into the fact that WP8 doesn’t support DataAnnotations.

“No problem” I thought, “we already have our own implementation for WP8 Silverlight, for Android, and for iOS. I’ll just use that code.”

Which worked insofar as that I have a Universal PCL Csla.dll that builds.

But it doesn’t work because I can’t actually use that Csla.dll from WinRT on Win8 because that WinRT already has DataAnnotations and so there are type collisions.

As a result it isn’t clear to me that I can actually create a Universal PCL for CSLA – at least not one that supports DataAnnotations across all platforms like I’m able to do if I create one assembly per target platform (like I’ve been doing since 2007 with Silverlight 2).

I guess this makes sense. The guidance around creating a PCL is that you have code that is simple enough that it doesn’t include any platform-specific implementations that would be solved easily using #if directives. The internal implementation of some parts of CSLA is far from simple, and we do use #if directives to optimize for and/or leverage features of each of the 9 platforms currently supported by CSLA (yes, we really provide business code portability across NINE different platforms).

My personal feeling is that I’d rather support all 9 platforms as efficiently as possible, rather than compromise one or more of them just to use a fancy and optional new concept like the Universal PCL.

(of course if Microsoft and Xamarin add DataAnnotations to Windows Phone 8.1, Android, and iOS then I wouldn’t need to implement it in CSLA and that would also solve this problem – so maybe someday :) )

Monday, April 28, 2014 2:07:47 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [2]  | 
 Thursday, March 06, 2014

I few weeks ago I posted about my new Nokia Lumia 1520 “phablet”: Lumia 1520- First thoughts

Tomorrow my new Lumia 1020 will replace the 1520.

Why?

Because the 1520 is just too big. Otherwise I really like it in a lot of ways – high def screen, easy to read content, very fast, slot for MicroSD card.

But it doesn’t fit nicely into my pockets, and it is very awkward to hold up to my ear when talking (yes, I often use BlueTooth, but not always).

Mostly though, even with my big hands (I’m 2m tall after all) I can’t use it one-handed. <insert texting while driving jokes here> In reality this has nothing to do with driving as I have a good hands-free setup in my truck. This has to do with normal everyday use of the phone, and the reality that it never works one-handed, even for basic things like pulling it out of my pocket to answer a call.

I have high hopes for the 1020. It is the size of my 920, which I loved, and has a much better camera. I don’t believe it has a MicroSD slot though, which is the only real negative I can see.

Thursday, March 06, 2014 1:56:47 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [2]  | 
 Monday, February 03, 2014

I’ve had my Nokia Lumia 1520 “phablet” for around 6 hours now and thought I’d record my earliest thoughts.

(phablet is a term used to describe a huge phone, big enough to be a small tablet – hence “phablet”)

Good:

  1. The phone is as solid and well built as other Lumia devices
  2. Even though it is bigger than my 920 I don’t think it weighs much more; not what I expected from such a large device
  3. From what I’ve seen thus far, the battery doesn’t go down unless I run the Waze app (which drains batteries even if your phone is plugged into a charger)
  4. Reading email, browsing, and other data consumption activities are a lot of fun on the bigger screen
  5. Not only is the screen bigger, it is 1080p so it is so clear and sharp! Watching Hulu Plus and NetFlix on this thing is nice!!
  6. Moving from one WP8 device to another is a breeze; all my data and apps are in the cloud so the new phone just spent a while downloading everything and it just worked!

Neutral:

  1. The GDR3 “Black” update auto-installed on startup, and of course it has nice features all by itself, but I had that on my 920 already
  2. Though the device is quite large, I mostly talk via BlueTooth headsets or Microsoft Sync in my truck, so I haven’t yet encountered any awkward moments of holding a phablet up to my ear

Bad:

  1. Stupid AT&T prevents the Data Sense app from installing to the device; my 920 was a developer device and so it wasn’t blocked (even on ATT), and I really, really, really miss having Data Sense already (yes, they say I should use the myATT app, but I’m on a corporate plan so that app is total junk, and even if it did work it wouldn’t show the useful info shown by Data Sense)
  2. The screen is so big that even with my massive hands I can’t really use the device with one hand
  3. A small number of apps from the 920 apparently can’t run on the 1520, though that could be related to me moving from an unlocked dev phone to an AT&T branded device where they appear to cripple some things
  4. Though the battery life seems to be excellent, charging the battery takes _forever_ – or I’ve got a bad device, because it has been charging for a really long time and isn’t fully charged yet (and no, the Waze app isn’t running in the background :) )
  5. The device is big enough to be somewhat uncomfortable in the front pocket of my jeans, so I’m trying the back pocket; hopefully I don’t accidentally sit on it and break the phone…

On Waze:

Twice I mentioned the Waze app. It is a wonderful app if you need to get somewhere through traffic, snowstorms, etc. The user-driven data sourcing for traffic and related events is all in realtime, and I’ve found that Waze gets me around traffic that other GPS apps (even with traffic data) wouldn’t avoid.

BUT, the Waze app does literally drain the battery on phones even when plugged into a charger, so it is something you can _only_ use when the phone is plugged into a charger, and even then only for a relatively short period of time (such as on your commute to/from work). Even then, I suspect it would totally drain a battery with a longer commute like people have in some cities…

Monday, February 03, 2014 9:30:47 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [1]  | 
 Tuesday, March 19, 2013

The final release of CSLA 4 version 4.5.20 is now available for download

http://www.cslanet.com/Download.html

It is also available via NuGet.

CSLA .NET is a software development framework that helps you build a powerful, maintainable business logic layer for WinRT (Windows 8), WPF, Web, service-oriented, Windows Phone, Silverlight, and workflow applications.

This new release adds support for Windows Phone 8 to the existing support for .NET 4, .NET 4.5, Windows Runtime (WinRT), and Silverlight 5.

It also includes some important bug fixes, and relatively minor enhancements in other areas of the framework. So if you are using any previous version of 4.5 you really should upgrade to this new release to realize these benefits.

One other note: this release uses a new WIX-based installer, and so it shouldn’t have the issues people encountered with the InstallShield-based installer used in the previous release. As always, I generally recommend using NuGet to include the assemblies in your projects, as that’s the simplest and most reliable approach.

Tuesday, March 19, 2013 9:56:18 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [2]  | 
 Friday, February 08, 2013

The strangest thing happened this evening.

My wife’s best friend is visiting and we’re watching The Daily Show and the Colbert Report on the Xbox using Hulu Plus – catching up on our backlog of funny.

All of a sudden the TV goes blank, and then a picture appears on the screen. A picture from the friend’s phone.

WTF!?!

So we stopped watching the shows and figured out what was going on (sort of).

She has a Samsung phone – one of the ones that is a “rip off” of the iPhone, so it is a pretty nice smart phone. And her phone is on our wifi.

When looking at a picture on her phone there’s a button at the top of the screen that, when tapped, sends the photo to the Xbox. It literally takes over the Xbox and shows the picture. And you can pan through pictures on the phone and they each appear on the Xbox (TV) – the images streaming from the phone to the Xbox.

On one hand this is pretty cool, and I wonder why my Windows Phone can’t do this?

On the other hand, it is a little scary to think that she was just playing around with her phone and was able (albeit accidentally) to hijack my Xbox.

Talk about a connected world!

Friday, February 08, 2013 11:21:54 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [4]  | 
 Wednesday, February 06, 2013

I have released a beta of CSLA .NET: version 4.5.11, working toward a final release in a few weeks.

CSLA .NET is an open source software development framework that helps you build a reusable, scalable, and maintainable object-oriented business layer for your applications.

This update includes a few interesting features/changes.

  1. Adds support for Windows Phone 8 (WP8) development on the Windows Phone Runtime (WinPRT) platform
  2. Simplifies support for ASP.NET MVC 3 and ASP.NET MVC 4, as well as ADO.NET EF 4 and 5 by splitting functionality into separate assemblies and nuget packages
  3. Changes the local data portal to have the same behavior as a remote data portal for async calls; specifically this means that the local data portal automatically shifts all async requests onto a background thread from the thread pool
  4. Transactional attribute now allows you to set the isolation level
  5. Various bug fixes

You can get this prerelease version from nuget in Visual Studio, or you can download the new Wix-based installer from the CSLA download page.

Wednesday, February 06, 2013 5:36:07 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [2]  | 
 Friday, August 03, 2012

With all the new terminology and conceptual surface area that comes with Windows 8, I think it is important to have some clarity and consistency around the terms and concepts.

Here are some of the basic terms:

  • Windows 8 – the new operating system that runs in a “dual mode”: Desktop (Win32) and WinRT (Windows Runtime)
  • Desktop – the Win32 OS API that supports today’s applications in Win8 (basically Windows 7)
  • WinRT – Windows Runtime: the new OS API that supports “modern” applications
  • Windows RT – Windows 8 on ARM devices (note: Windows RT and WinRT are not the same thing)
  • Windows 8 UI style – a user experience design language often used when building WinRT applications

Windows 8 basically includes two different operating systems.

One is the “old” Win32 OS we think of today as Windows 7. This is now called Windows 8 Desktop, and is available on Windows 8 Intel tablets, laptops, and desktops. This is only partially available on ARM devices, and you should not expect to build or deploy Win32 Desktop apps to ARM devices.

The other is the new Windows Runtime (WinRT) “operating system”. This is a whole new platform for apps, and is available on all Windows 8 machines (ARM, Intel, tablet, laptop, desktop). If you want the widest reach for your apps going forward, you should be building your apps for WinRT.

Confusingly enough, “Windows 8” runs on Intel devices/computers. “Windows RT” is Windows 8 for ARM devices. The only real difference is that Windows RT won’t allow you to deploy Win32 Desktop apps. Windows RT does have a Desktop mode, but only Microsoft apps can run there. Again, if you want to build a Windows 8 app that works on all devices/computers, build the app for WinRT, because it is consistently available.

Windows 8 UI style describes a user experience design language for the look and feel of WinRT apps. This isn’t a technology, it is a set of design principles, concepts, and guidelines.

Another source of confusion is that to build a WinRT app in Visual Studio you need to create a “Windows 8 UI style” app. What makes this odd, is that this type of app is targeting WinRT, and it is entirely up to you to conform to the Windows 8 UI style guidelines as you build the app.

“Windows 8 UI style” was called “Metro style”, but Microsoft has dropped the use of the term “Metro”. I am skeptical that this new “Windows 8 UI style” term will last long-term, because it obviously makes little sense for Windows Phone 8, Xbox, Windows 9, and other future platforms that may use the same UI style. But for now, this appears to be the term Microsoft is using.

Thinking about app development now, there are several options on the Microsoft platforms.

  Technologies Platforms
Full .NET 4.5 ASP.NET, WPF, Windows Forms, WCF, WF Windows 7, Windows 8 Desktop, Windows Server 2008, Windows Server 2012
WinRT .NET 4.5 Windows 8 UI style apps Windows 8 WinRT, Windows Phone 8, rumored for next-gen Xbox
Full .NET 4 ASP.NET, WPF, Windows Forms, WCF, WF Windows 7, Windows Server 2008, Azure PaaS
Silverlight Silverlight Windows 7, Windows 8 Desktop, Windows Phone 7, Windows Phone 8
Friday, August 03, 2012 10:03:20 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [6]  | 
 Saturday, November 12, 2011

One of the primary goals for CSLA 4 version 4.3 (the next version we’ll be creating) is to improve the performance of the MobileFormattter that is used for Silverlight and Windows Phone applications. This is made all the more important, because it will also be used in WinRT applications in the future.

Sergey (a CSLA dev team member, and Magenic colleague) has been doing some heavy research into this area, and we’d originally thought to do the changes as part of the 4.2 release. It turns out that doing a really great job of optimization will require some breaking changes – at least for people who aren’t using managed backing fields. So we are deferring the bigger changes until 4.3.

In the meantime, Sergey has blogged about how to improve performance of MobileFormatter in 3.8 and 4 (4.0, 4.1, or 4.2). These are changes you can make to your CSLA codebase now if you want some of the performance benefits without waiting for the “big change” that’ll come in 4.3.

Saturday, November 12, 2011 12:41:27 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [2]  | 
 Tuesday, January 18, 2011

csla_logo1_32I am pleased to announce the release of CSLA .NET version 4.1 with support for .NET, Silverlight and Windows Phone 7 (WP7).

You can download CSLA 4 version 4.1 at http://www.lhotka.net/cslanet/download.aspx

Although there are numerous new features in version 4.1, the primary focus of this release is Windows Phone 7. With CSLA 4 version 4.1 you can now author business classes that run unchanged across the entire .NET platform:

  • Windows Phone 7
  • Silverlight
  • WPF
  • ASP.NET MVC
  • ASP.NET Web Forms
  • WCF services (SOAP and REST)
  • asmx web services
  • Windows Forms

The ability to reuse your business layer on .NET, Silverlight and WP7 is incredibly powerful, enabling you to extend your application to users on Windows, the web, and now the phone.

You can learn how to use CSLA 4 to build scalable, flexible, and maintainable applications through the Using CSLA 4 ebook series. This ebook series is currently a work in progress and will be finished in the first half of 2011.

Tuesday, January 18, 2011 7:30:40 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Saturday, December 11, 2010

I have a WP7 device: the HTC HD7.

I’ve had it for a while now (since launch date in the US), but wanted to wait a little before blogging about it to really get a good feel for what I do and don’t like.

Also, by way of disclaimer, I’m coming to WP7 from Windows Mobile 6.5, so I can’t compare and contrast to other modern phones like iPhone or Droid.

In short, I really like Windows Phone 7, but there are better devices than the HD7 (unless you are on T-Mobile).

Coming from an older phone like I did, the new WP7 phone OS is remarkable. Wonderful. Truly a joy to use! And the HD7 has enough cpu, graphics and memory to make it fast and very enjoyable.

My only real issue is that the HD7 device’s camera button is so hard to push that it is almost impossible to take a good picture, which makes the camera nearly useless. That’s not the fault of WP7, that’s the fault of some HTC engineer with overdeveloped finger muscles or something…

The WP7 user experience is smooth and intuitive. It is loosely based on the Zune HD user experience, but Microsoft clearly learned a lot from the Zune HD about what did and didn’t work, and the phone’s user experience is consistently pleasant and easy.

One of the most touted features of the phone are the the “live tiles” on the home page. And they are nice. I’ve got mine customized to show phone, people, email and weather on the very first page, with messages and a few other commonly used items further down. There are a few other apps I’ve used now and then that I haven’t put on the home page, because it is just as easy to get to them using the voice navigation.

The cool thing though, is that the weather status and my wife’s Facebook status are shown on that front page through the live tiles, so the most important information is always right there Smile

I’ve downloaded some free and commercial apps from the Marketplace. That’s a seamless experience, and includes seamless updates of the apps as they become available. My only quibble with the Marketplace is that it doesn’t seem to filter between apps, music, videos, etc. So sometimes searching for an app can be tedious because it seems that a lot of songs use the same words in their titles, so it can take some time to sift through the songs to find the app you want…

In terms of apps, there are only three apps I am missing at this point:

  1. Bing (I want the voice-prompted navigation that comes with the Bing app – the built-in Maps app is ok for maps, but horrible for actual driving navigation)
  2. TripIt (the mobile web access is OK, but a smart client experience would be a lot better)
  3. EverNote (here the smart client (with offline caching of notes) is really important, and the web interface is a poor substitute – enough so that I’m considering migrating back to OneNote where I can share everything on my SkyDrive)

In terms of phone features, the only thing missing is tethering and/or using the phone as a wifi hub. My 6.5 phone did both of those things and I used them constantly, so losing this ability is a serious drawback. If I wasn’t such a Microsoft loyalist the lack of tethering would probably have prevented me from getting this phone – but as it is I’ve chosen to live with the pain.

On the other hand, the way WP7’s “hubs” integrate together is wonderful. The People and Pictures hubs, for example, automatically pull data from Facebook, Live, Outlook and so forth – automatically bringing together nearly all the information I care to see about everyone I interact with. This type of automatic data integration is amazingly useful, and directly increases my productivity from a business and inter-personal perspective.

And of course the fact that the phone is a Zune device (and so can use my beloved zune.net subscription) is just icing on the cake. While I still carry my Zune HD when traveling because it has enough memory to hold all my songs, I do have a couple Smart DJ playlists synced to the phone for times when I’m sitting somewhere and just need a little music. I always have the phone, but don’t always have the Zune HD.

Finally, there’s Netflix. The high-res screen on the phone makes watching video content reasonably enjoyable. Not comparable to a TV or even laptop screen of course, but certainly workable. So again, when I’m sitting somewhere and feel like a little diversion there’s always Netflix content available.

Would I recommend that someone get a WP7 device? Absolutely – WP7 is a joy to use!

Would I recommend the HD7? Probably not, but if you are on T-Mobile you are kind of stuck… And really, other than the stupid camera button, it is a perfectly decent phone (I really like the large screen and overall form factor).

Saturday, December 11, 2010 4:17:17 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [13]  | 
 Friday, December 10, 2010

Apparently music subscription services are struggling to gain traction

http://www.zdnet.com/blog/bott/more-itunes-alternatives-can-a-subscription-music-service-ever-succeed/2770?tag=nl.e539

I can understand that, because I was an anti-digital-music person for a long time. My thought was that I had no reason to pay for a music subscription when radio was free.

Of course radio isn’t free, and over time (as I’ve gotten older?) I find the DJ dialog and commercials on radio to be increasingly annoying. To the point that radio costs way too much – there’s less music than drivel and I just can’t take it.

The other alternative is to buy CDs, rip them and create your own collection. That way you “own” the music. And certainly compared to buying digital MP3s it is better to buy the CD. I’ve “purchased” digital music several times over the years, and several times I’ve had the originating company go out of business and so the DRM locked me out of my “purchase”. And I’ve had hard drive failures, and so lost my “purchase”.

Sure, a CD can get scratched, but if you buy a CD, rip it and then only use the digital copy, you always have the pristine master source, even in the case of hard drive failure.

However, a CD costs around $12, and zune.net costs $15/mo. So I can buy around 12-13 CDs each year, or I can spend the same money to have access to a few hundred thousand songs. Even over my entire lifetime, at 12 CDs per year I’ll never get a collection the size I have access to via zune.net.

So radio is out (because it just sucks), and buying CDs isn’t really cost-effective.

But there are streaming services like pandora and last.fm and others. They are free, or at least cheaper than zune.net, so why not use them?

I used to use pandora, but it started getting pretty flaky with its song selections. Lately I’ve been using last.fm because they came with my xbox gold subscription (and zune.net didn’t until recently). I like last.fm, they do a good job and they stream to my xbox and my Windows Phone 7.

However, streaming services don’t work when I’m on an airplane, in a hotel (you never get good bandwidth in a hotel), in northern Minnesota camping or fishing, etc. Basically they are for city people who don’t travel, not for people like me who travel and/or spend a lot of time in rural areas.

So how does zune.net differ from things like radio, CDs or streaming services?

For about $15/mo you get this:

  1. Access to several hundred thousand songs via streaming
  2. 10 free purchases (DRM free) each month (basically I get to “buy” for free almost an entire album every month)
  3. Smart DJ, which does what pandora and last.fm do: creating a themed “radio station” drawing music from my personal library plus the entire zune library (those hundreds of thousands of songs)
  4. The ability to sync Smart DJ playlists to my zune device or Windows Phone – so that music is available when I’m entirely offline

So think about this. For just over the price of a CD I get (more or less) a CD’s worth of music I actually own each month. I figure that’s $10 of the $15 covered each month right there.

But more importantly, for my other $5/mo I get unlimited streaming just like pandora or last.fm – and in a form that works when I’m entirely offline like on an airplane or sitting on a lakeshore in far northern Minnesota where there’s no cell coverage, much less Internet.

(it is this pure offline feature that even iTunes doesn’t have – and why zune.net is (for me) the ultimate solution)

In the end, yes, I understand the arguments against paying a subscription fee for music. But when compared to the alternatives, it has become clear to me that none of those arguments really hold water. The zune.net service is pretty much the perfect way to consume music.

Windows Phone | WP7 | Xbox | Zune
Friday, December 10, 2010 10:59:08 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [6]  | 
 Wednesday, October 27, 2010

The first WP7 app built by Magenic is now in the WP7 app marketplace: GuestList.

This app allows you to easily check in attendees at an event, using EventBrite as the backend service. You create your event in EventBrite, users register through their web site, and as they arrive at your event you get the attendee list on your phone, and easily check them in right there.

Chris Williams (Microsoft MVP and author of an upcoming WP7 developer book) did the development on this project, with assistance from Donn Felker (author of a similar app for Droid). Anthony Handley (from our Magenic Studios group) created the user experience flow and look and feel.

Very exciting stuff!

Wednesday, October 27, 2010 2:25:56 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [2]  | 
 Wednesday, September 01, 2010

Good news on the WP7 front:

Windows Phone 7 – Released To Manufacturing

And we know that the dev tools are planned for release in just a couple weeks – so this is all coming together fast.

Wednesday, September 01, 2010 2:47:02 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 

Lessons learned getting CSLA 4 to build and run in WP7.

  • Obviously WP7 is based on SL3, so SL4 specific code won’t work (which caused most of my initial build issues).
  • Human error plays a big role – I created several new projects for WP7, and even though they shared existing code files (via file linking), I forgot to set things like the assembly names and default namespaces – obviously that caused issues with serialization between client and server. Never underestimate the ability of the human to overlook simple things…
  • Don’t underestimate the impact of the tiny screen. While WP7 can run code from a full-screen app (the same business objects, etc), it is amazing how the need to fit into a tiny screen can impact the way you build your application!
  • VS10 doesn’t support signing assemblies, but you can do it by manually editing the csproj file.
  • VS10 doesn’t support resource files, but you can manually add a resx to the main project, then drag it into the Properties folder, then set the file’s properties (custom tool, etc) so it works correctly.
  • WP7 appears to throw different exceptions from .NET/SL for various things. There are a number of cases where I’m having to catch and rethrow exceptions to get the expected exception type – which is something I don’t need to do in .NET/SL. Since my unit tests often check for expected exceptions (testing failure conditions), I’m seeing a lot of these issues and having to tediously address them one by one.
  • VS10 crashes “for no reason” on some WP7 code. I have the same code in .NET, SL and WP7 and can walk through code in the debugger, but sometimes WP7 crashes Visual Studio – I assume this is due to the beta state of the tools.
Wednesday, September 01, 2010 12:24:12 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [2]  | 
 Tuesday, August 10, 2010

I started by getting the CSLA 4 codebase (from Silverlight) to compile in WP7.

As an aside – working with WP7 is really a smooth experience. The emulator works quite well, and the debugging experience is comparable to working with Silverlight. I can see where it would be hard to debug/test things requiring touch or other device hardware, but for basic app development the process is quite enjoyable.

Then we got UnitDriven running in WP7 so I could run my unit tests.

Then I spent some quality time fighting with reflection. Over the years, as .NET has evolved alternatives for reflection, CSLA has adopted those alternatives; dynamic methods and now lambda expressions. The specific things CSLA is doing can’t be easily done using the DLR, or I’d consider using that approach.

But WP7 is based on Silverlight 3, which predates the cool stuff in Silverlight 4. That means that the lambda expression concepts used in CSLA 4 wouldn’t build in WP7 – so I basically put TODO comments in their place to get the codebase to compile. Then I went back through and dug up the older 3.x code and tried to just plug it in, replacing the TODO comments.

That turned out to be a little harder than I expected. As part of replacing reflection, we enhanced the functionality of some of the code in CSLA 4, and the 3.x code didn’t handle all the same scenarios. I don’t want my WP7 code to be incompatible with the .NET/SL implementations though, so this basically meant rewriting the 3.x reflection code to support the CSLA 4 functionality.

After a few hours of work all my dynamic method calling unit tests now pass (except for the one that proves that dynamic method invocation is faster than reflection – obviously that one has no meaning in WP7 at the moment). That’s a relief, as it means that essentially all the core functionality of CSLA 4 now works.

With the notable exception of the data portal. It isn’t clear yet what’s failing, but it appears to have something to do with type resolution. I know that Silverlight and .NET don’t work the same in this regard, and I’m beginning to suspect that either I need to revert some other code back to 3.x, or that WP7 doesn’t act the same as Silverlight 3 or 4.

In any case, this is all very encouraging. I am now quite confident that we’ll be able to take CSLA 4 business classes from Silverlight and run them in .NET or on WP7 without change. Just think about building a business class and knowing that it can be used to create Silverlight, ASP.NET MVC, WP7, WPF, WCF, Web Forms, Windows Forms and asmx interfaces! Too cool!!

Tuesday, August 10, 2010 7:02:49 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [3]  | 

I am working on CSLA 4 for Windows Phone 7. Of course I want to get all my unit tests (or most of them anyway) running on WP7.

When we created CSLA .NET for Silverlight it was long before Silverlight 2 shipped, and there was no workable unit test framework for Silverlight. Even today, it is tricky to test async methods and features with mstest in SL. Perhaps most importantly however, I wanted to have the same exact unit test code running in .NET and Silverlight – and that’s a level of parity that is hard to achieve.

So Justin created UnitDriven and we donated it to the community through codeplex: http://unitdriven.codeplex.com.

And I have a few hundred unit tests for CSLA that rely on UnitDriven, so it isn’t a trivial thing to think about switching to something else – so it is important that UnitDriven work on WP7 too.

Fortunately Justin was able to get this done in an evening. It turns out that the only major change required was to the UI, because obviously the WP7 form factor is very space constrained compared to a full-size screen.

The end result is that there’s a preview release of UnitDriven that works on WP7 – you can download it from codeplex.

Most of my CSLA unit tests are passing at this point, which gives us some confidence that UnitDriven is working as expected. There are some UI issues still, especially with long test names and some scrolling issues.

But if you are looking for a way to write unit tests for your WP7 Silverlight code, and especially if you want to use the same unit test code on .NET, Silverlight and WP7, then UnitDriven is something you should consider.

Tuesday, August 10, 2010 1:22:31 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Tuesday, March 16, 2010

Hopefully this can save someone some time. I spent a couple hours setting up a virtual machine and installing the Windows Phone 7 dev tools, only to find that the phone emulator won’t run in a virtual machine. It turns out that this is because the emulator is a virtual machine and you can’t run a virtual machine in a virtual machine.

Tuesday, March 16, 2010 10:45:59 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [6]  | 
On this page....
Search
Archives
Feed your aggregator (RSS 2.0)
August, 2014 (2)
July, 2014 (3)
June, 2014 (4)
May, 2014 (2)
April, 2014 (6)
March, 2014 (4)
February, 2014 (4)
January, 2014 (2)
December, 2013 (3)
October, 2013 (3)
August, 2013 (5)
July, 2013 (2)
May, 2013 (3)
April, 2013 (2)
March, 2013 (3)
February, 2013 (7)
January, 2013 (4)
December, 2012 (3)
November, 2012 (3)
October, 2012 (7)
September, 2012 (1)
August, 2012 (4)
July, 2012 (3)
June, 2012 (5)
May, 2012 (4)
April, 2012 (6)
March, 2012 (10)
February, 2012 (2)
January, 2012 (2)
December, 2011 (4)
November, 2011 (6)
October, 2011 (14)
September, 2011 (5)
August, 2011 (3)
June, 2011 (2)
May, 2011 (1)
April, 2011 (3)
March, 2011 (6)
February, 2011 (3)
January, 2011 (6)
December, 2010 (3)
November, 2010 (8)
October, 2010 (6)
September, 2010 (6)
August, 2010 (7)
July, 2010 (8)
June, 2010 (6)
May, 2010 (8)
April, 2010 (13)
March, 2010 (7)
February, 2010 (5)
January, 2010 (9)
December, 2009 (6)
November, 2009 (8)
October, 2009 (11)
September, 2009 (5)
August, 2009 (5)
July, 2009 (10)
June, 2009 (5)
May, 2009 (7)
April, 2009 (7)
March, 2009 (11)
February, 2009 (6)
January, 2009 (9)
December, 2008 (5)
November, 2008 (4)
October, 2008 (7)
September, 2008 (8)
August, 2008 (11)
July, 2008 (11)
June, 2008 (10)
May, 2008 (6)
April, 2008 (8)
March, 2008 (9)
February, 2008 (6)
January, 2008 (6)
December, 2007 (6)
November, 2007 (9)
October, 2007 (7)
September, 2007 (5)
August, 2007 (8)
July, 2007 (6)
June, 2007 (8)
May, 2007 (7)
April, 2007 (9)
March, 2007 (8)
February, 2007 (5)
January, 2007 (9)
December, 2006 (4)
November, 2006 (3)
October, 2006 (4)
September, 2006 (9)
August, 2006 (4)
July, 2006 (9)
June, 2006 (4)
May, 2006 (10)
April, 2006 (4)
March, 2006 (11)
February, 2006 (3)
January, 2006 (13)
December, 2005 (6)
November, 2005 (7)
October, 2005 (4)
September, 2005 (9)
August, 2005 (6)
July, 2005 (7)
June, 2005 (5)
May, 2005 (4)
April, 2005 (7)
March, 2005 (16)
February, 2005 (17)
January, 2005 (17)
December, 2004 (13)
November, 2004 (7)
October, 2004 (14)
September, 2004 (11)
August, 2004 (7)
July, 2004 (3)
June, 2004 (6)
May, 2004 (3)
April, 2004 (2)
March, 2004 (1)
February, 2004 (5)
Categories
About

Powered by: newtelligence dasBlog 2.0.7226.0

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2014, Marimer LLC

Send mail to the author(s) E-mail



Sign In