Rockford Lhotka's Blog

Home | Lhotka.net | CSLA .NET

 Wednesday, January 19, 2011

I’ve started the process of porting CSLA .NET version 4.1 to MonoDroid. I expected this to be relatively easy because I’ve already got a version of CSLA 4 running on WP7, and from everything I know about MonoDroid it should be pretty comparable (excluding anything to do with XAML and UI concepts of course).

After a couple hours of trying to get the Android emulator to run on my machine, I discovered that the hybrid C++ and Java worlds really don’t “get” Windows. They interpret Windows configuration in different ways. I’m not sure which one is lame and out of date (by around a decade), but either C++ or Java apparently needs help…

Fortunately some googling (with Bing of course Smile) turned up the answer in the form of an environment setting named ANDROID_SDK_HOME that both C++ and Java will honor. The problem is that my User directory isn’t on the C drive, and either C++ or Java can’t handle this concept. Setting ANDROID_SDK_HOME to the path of my actual User directory solves the issue so the emulator works as expected.

The Android emulator is extremely slow, but functional. Just deploying my tiny little test app takes several minutes, and my computer is no slouch. It is clear that Android developers don’t round-trip very fast in terms of running their code to see if it works. I feel sort of like I’m back in 1992 on a VAX where the compile-link-run cycle took minutes. I’m obviously very spoiled with the performance of things like the WP7 emulator or the ASP.NET development web server, where the compile-debug/run cycle takes seconds (at most).

The process of getting CSLA 4 to at least build in MonoDroid took around 4 hours of work. Not that I’m done, but the code does compile at this point. The holdups and issues are:

  1. MonoDroid doesn’t have ObservableCollection and a set of related types, so I’ve started implementing them myself
  2. MonoDroid doesn’t know about “Add service reference”, it only knows about “Add web reference”, and that means I need to create a new data portal proxy/host pair
  3. It doesn’t look like the System.ServiceModel assembly that comes with MonoDroid actually works – my one remaining build error has to do with this assembly – and this probably means some other client-side data portal elements will be affected (like LocalProxy) – I think this indicates some bad factoring on the part of CSLA in terms of the client-side data portal implementation though, so in an odd way this might be beneficial in that the problem highlights a design flaw that needs fixing
  4. There are some bugs in MonoDroid in VS, where setting some project properties “doesn’t take” – change the property values in VS and they aren’t saved to the project file – but edit the project file in a text editor and the changes are honored – not a big deal, and MonoDroid is in an early beta, so this sort of thing is to be expected
  5. There’s no XAML or directly comparable concept on Android, so I’m not even trying to port Csla.Xaml, only the core Csla project – I’ll probably need to create a Csla.Android project with UI components appropriate to the Android UI technology

I mocked up the initial types to implement ObservableCollection, and it won’t take a lot more effort to make them have the functionality required by CSLA. I don’t feel the need to completely replicate those types – only the parts CSLA cares about.

Creating a data portal proxy/host pair isn’t hard, the data portal is designed with this sort of flexibility in mind. However, this will be the first non-WCF proxy/host pair I’ve built on the Silverlight/WP7 code base, so I’m looking forward to establishing that it is as easy as it should be.

The unexpected dependencies on System.ServiceModel are probably the most worrisome aspect of this project so far. I suspect unraveling the dependencies and fixing the design/implementation may lead to some breaking changes in the Silverlight/WP7 code. On the other hand, if my early suspicions are correct, the design is probably flawed and I’ll be able to improve things as a result.

The question is whether I leave the SL/WP7 code alone and just fix the dependencies in the Android code base. That’s probably what I’ll do in the 4.x timeframe, because I really try to avoid substantial breaking changes in point releases…

The loss of Csla.Xaml is not ideal. At the very least I think a Csla.Android project will need ViewModelBase and ViewModel, but I suspect other Android-related UI components may be required.

Anyway, I’m quite impressed by MonoDroid. It seems pretty complete, pretty functional, and pretty well integrated into Visual Studio. Other than my issues with the emulator configuration the install was painless.

To head off this question before it is asked: I do expect I’ll create a version for MonoTouch at some point.

But MonoDroid has a much lower barrier of entry since it installs on Windows and works in Visual Studio. MonoTouch requires a non-trivial cash outlay to buy a Mac, and a non-trivial time outlay to learn the Mac, MonoDevelop, some Mac svn implementation, etc. Where I’ll probably have a working version of CSLA 4 for Android in under 20 hours, I strongly suspect it will take more than twice that long (and a lot of money) to get a version working in iOS.

In this regard I must give kudos to Google, Android and MonoDroid – they have a much lower barrier to entry than Apple currently provides.

Wednesday, January 19, 2011 11:30:11 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [10]  | 
 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]  | 
 Friday, January 14, 2011

Dunn Training is offering a CSLA 4 training class on February 23, 2011 in Atlanta.

http://www.dunntraining.com/training/schedule.htm

If you are looking for CSLA .NET classroom training, this is a great opportunity. Here’s a quote from a student who attended the December class:

Dunn’s CSLA training was phenomenal!!! It significantly advanced our team’s knowledge of CSLA and helped layout the roadmap for our future development. Mark Berry  holistically demonstrated how CSLA works with MVVM, Silverlight, WPF, Expression, OO Programming and Code Generators. He also successfully answered extremely challenging CSLA questions that were thrown at him during class. Our team is pretty knowledgeable with CSLA and the other technologies, but Mark took us to an entirely new level, sprinkled in some nice tips, tied it all together, and reenergized our team. The training was well worth the money.

Friday, January 14, 2011 5:36:03 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Wednesday, January 12, 2011

Anyone who expected HTML5 to be more standard or consistent than previous HTML standards hasn’t been paying attention to the web over the past 13+ years.

Google’s decision to drop H.264 may be surprising as a specific item, but the idea of supporting and not supporting various parts of HTML5 (or what vendors hope might be in HTML5 as it becomes a standard over the next several years) is something everyone should expect.

I have held out exactly zero hope for a consistent HTML5 implementation across the various browser vendors. Why? It is simple economics.

If IE, Chrome, FF and other browsers on Windows were completely standards complaint in all respects there would be no reason for all those browsers. The only browser that would exist is IE because it ships with Windows.

The same is true on the Mac and any other platform. If the browsers implement exactly the same behaviors, they can’t differentiate, so nobody would use anything except the browser shipping with the OS.

But the browser vendors have their own agendas and goals, which have nothing to do with standards compliance or consistency. Every browser vendor is motivated by economics – whether that’s mindshare for other products or web properties, data mining, advertising, or other factors. These vendors want you to use their browser more than other browsers.

So in a “standards-based world” how do you convince people to use your product when it is (in theory) identical to every other product?

When products have a price you could try to compete on that price. That’s a losing game though, because when you undercut the average price you have less money to innovate or even keep up. So even in the 1990’s with Unix standards vendors didn’t play the pricing game – it is just a slow death.

But browsers are free, so even if you wanted the slow death of the price-war strategy you can’t play it in the browser world. So you are left with “embrace and extend” or “deviate from the standard” as your options. And every browser vendor must play this game or just give up and die.

This happened to Unix in the 1990’s too – the various vendors didn’t want to play on price, so they added features beyond any standard with the intent of doing two things:

  1. Lure users to their version of Unix because it is “better”
  2. Lock them into your version of Unix because as soon as they use your cool features they are stuck on your version

The same is true with browsers and HTML5. All browser vendors are jockeying now (before the standard is set) to differentiate and shape the standard. But even once there is a “standard” they’ll continue to support the various features they’ve added that didn’t make it into the standard.

This is necessary, because it is the only way any given browser can lure users away from the other browsers, thereby meeting the vendors’ long term goals.

People often say they don’t want a homogenous computing world. That they want a lot of variation and variety in the development platforms used across the industry. Over the past 13+ years HTML has proven that variation is absolutely possible, and that it is very expensive and frustrating.

Working for consulting companies during all this time, I can say that HTML is a great thing. Consultants charge by the hour, and any scenario where the same app must be rebuilt, or at least tweaked, for every browser and every new version of every browser is just a way to generate more revenue.

Is HTML a drag on the world economy overall? Sure it is. Anything that automatically increases the cost of software development like HTML is an economic drag by definition. The inefficiency is built-in.

The only place (today) with more inefficiency is the mobile space, where every mobile platform has a unique development environment, tools, languages and technologies. I love the mobile space – any app you want to build must be created for 2-5 different platforms, all paid for at an hourly rate. (this is sarcasm btw – I really dislike this sort of blatant inefficiency and waste)

But I digress. Ultimately what I’m saying is that expecting HTML5 to provide more consistency than previous versions of HTML is unrealistic, and moves like Google just took are something we should all expect to happen on a continuing basis.

Wednesday, January 12, 2011 11:49:44 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [10]  | 
 Tuesday, January 11, 2011

One of the nicest things about TFS is the way it can be customized and extended to fit different types of process.

A colleague of mine, Mario Cardinal, works for a company who has built an Agile/SCRUM extension: http://urbanturtle.com/awesome/

This really highlights how TFS can be used as the basis for a deep solution around a specific process, methodology or project philosophy. Cool stuff – and if you do SCRUM you should probably take a look at Urban Turtle to see if it can help you out.

Tuesday, January 11, 2011 12:41:56 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Tuesday, January 04, 2011

The completed first draft of the Using CSLA 4: Creating Business Objects ebook is now online and available for purchase. UsingCsla4-02-120

If you’ve purchased (or now purchase) the Using CSLA 4 ebook series you’ll also have access to this new ebook.

This is book 2 of the series. The next book will be Using CSLA 4: Data Access, followed by Using CSLA 4: Security. These first four ebooks cover all the core concepts around using CSLA 4 to build your business layer, along with various options for building a data access layer and implementing authentication.

After these four are complete I’ll move on to ebooks covering how to use a CSLA .NET business layer to create applications with different types of UI, including Silverlight, WPF, ASP.NET MVC and Windows Phone 7 (WP7).

Here’s the top-level outline of the Creating Business Objects book’s contents:

  1. Introduction

  2. Key Object Concepts

    1. Stereotypes

    2. Serialization

    3. Object Lifetime

    4. Object Relationships

    5. Object Identity and Equality

    6. Platform Differences in .NET and Silverlight

    7. Property Declarations

    8. Method Declarations

    9. Metastate

  3. Solution Structure

    1. Project Types and Assembly References

    2. Combining Project to Create Solutions

  4. Object Stereotypes

    1. Editable Objects

    2. Read-Only Objects

    3. Execution Objects

    4. Criteria Objects

    5. LINQ Types

    6. Windows Forms Types

  5. Business Rules

    1. Business and Validation Rules

    2. Authorization Rules

For those who are wondering, the first ebook is almost through the editing process and the “draft” designation will then be removed.

Tuesday, January 04, 2011 5:41:03 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
On this page....
Search
Archives
Feed your aggregator (RSS 2.0)
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