Rockford Lhotka's Blog

Home | Lhotka.net | CSLA .NET

 Monday, June 11, 2012

A co-worker of mine at Magenic is not only also a tabletop RPG gamer like me, but he’s working on a Google+ Hangout project to more easily play RPGs and other tabletop games with people from around the world.

To this end, he’s doing a Kickstarter

http://www.kickstarter.com/projects/joshuha/tabletop-forge-the-virtual-tabletop-for-google-han?ref=home_location

So if you are interested in this sort of thing, check it out and consider lending your support.

(As an aside for those who are interested, I’ve been playing tabletop RPGs since around 1979 or 80. Over the past 25+ years my group and I have developed our own gaming system, and have played in an internally consistent fantasy world. In game time we’ve spanned hundreds of years, and have told some wonderful stories. We’ve also played short bits in quite a few commercial gaming systems and settings, but we always return to our own system and world.)

Monday, June 11, 2012 1:03:17 PM (Central Standard Time, UTC-06:00)  #    Disclaimer
 Thursday, June 7, 2012

I have put an early version of CSLA 4 version 4.5 (version 4.5.1) online. This is a stable alpha release that supports:

  • Microsoft .NET 4.5
  • WinRT Metro style apps on Windows 8
  • Silverlight 5

You can get it from the CSLA download page.

This version doesn’t currently support Windows Phone, mono, or Android because all work is being done using Visual Studio 2012. We’ll reintroduce support for those platforms as everything gets supported on VS12.

  • This 4.5 release has the same functionality as version 4.3.12, plus some functionality we’ve added only to 4.5. Most notably:
  • The .NET and WinRT data portal now supports the new async/await keywords through methods like CreateAsync and SaveAsync
        var obj = Csla.DataPortal.FetchAsync<CustomerEdit>(id);
  • The ViewModelBase class for WPF and WinRT now has an InitAsync method so you can await initialization of the viewmodel object
        var vm = await new MyViewModel().InitAsync();
  • Enhancements to business rule processing

See the 4.5 change log for more detail.

Because this is an alpha release, you should expect more changes as we improve support for .NET 4.5 (most notably ASP.NET Web Forms, MVC, and Web API), and for WinRT/Metro.

At the same time, this should be a reasonably stable release, especially on .NET where the platform is also stable. It is also reasonably stable on WinRT/Metro, though there are more changes involved there so there could be more bugs.

Please direct feedback to the CSLA forums.

Thursday, June 7, 2012 10:19:34 PM (Central Standard Time, UTC-06:00)  #    Disclaimer

The final release of a CSLA 4 update is now available (version 4.3.12) .

You can get it from the CSLA download page or via nuget.

One cool thing with nuget, is that (thanks to work by Johann Hough) the debug symbols are now available on a symbol server. This means you can step through the CSLA code while debugging if desired (and if you deployed CSLA to your project via nuget).

This release is an update to the previous version 4.3 that includes several bug fixes and a few new features. Most notably:

  • Fixed a concurrency bug with the data portal
  • Fixed a XAML data binding bug with the PropertyInfo control
  • Substantial bug fixes and enhancements to the Windows Forms CslaActionExtender control
  • Better exception messages when methods/properties can’t be found

There are others as well – see the change log for details.

Thursday, June 7, 2012 4:09:41 PM (Central Standard Time, UTC-06:00)  #    Disclaimer
 Friday, June 1, 2012

Like a lot of people, I eagerly downloaded and installed the Windows 8 Release Preview (RC).

Like a few people, I was already running the Consumer Preview on my machines (tablet and laptop), so I just reimaged both machines with the RC. And I reused the same computer names for each machine – which seems pretty reasonable to me (but isn’t as it turns out).

Much to my surprise, I was unable to download any apps from the Microsoft Store. The failure message wasn’t helpful – it just said there was “a problem”.

After some tweeting and emailing with colleagues, I spent a couple hours trying random things to resolve the issue. Eventually I did figure it out.

The problem is that the store or live.com gets confused when you connect using a fresh install of Windows where the computer has the same name as before the install.

In other words, I already had a ‘RockyTablet’ machine connected to the store and/or live.com, and now I had a “new” computer with the same name connecting. This confused Microsoft’s servers, so they wouldn’t let me download anything.

There are two solutions.

  1. Give your computer a new and unique name
  2. Go to http://skydrive.live.com and remove your existing computer from the list of computers. To do this, click on the computer in the list on the left, and then click the subtle “Disconnect computer from SkyDrive” link near the top of the page. This apparently deregisters your computer with live.com and/or the store and allows the store to start working

If your computer isn’t listed or registered with SkyDrive, I’m not sure what else you can do other than option 1. If there’s another way to find and remove a computer from live.com I haven’t found it…

Friday, June 1, 2012 3:50:44 PM (Central Standard Time, UTC-06:00)  #    Disclaimer
 Tuesday, May 29, 2012

A beta release of a CSLA 4 version 4.3 update is now available (version 4.3.11) .

You can get it from the CSLA download page.

This is an update to the existing version 4.3 code that includes several bug fixes and a few new features. Most notably:

  • Fixed a concurrency bug with the data portal
  • Fixed a XAML data binding bug with the PropertyInfo control
  • Substantial bug fixes and enhancements to the Windows Forms CslaActionExtender control
  • Better exception messages when methods/properties can’t be found

There are others as well – see the change log for details.

I expect the beta period to last about two weeks, followed by a final release of this 4.3 update.

Tuesday, May 29, 2012 9:59:40 AM (Central Standard Time, UTC-06:00)  #    Disclaimer
 Thursday, May 24, 2012

The Windows Azure team is putting together an event on June 7 where they’ll be providing some great info about Azure.

AzureBanner_300x250

The event is live in San Francisco, but for most of us it is streaming live over the Internet.

Over the past year or so Microsoft has rolled out new features and pricing models for Azure that make the platform more and more compelling. I think they are nearing the point where the question will change from “why should I use Azure?” to “why shouldn’t I use Azure?”.

Thursday, May 24, 2012 8:36:24 AM (Central Standard Time, UTC-06:00)  #    Disclaimer
 Friday, May 11, 2012

Unless I’m missing something, there’s no direct way to bind XAML-ish text to a WinRT RichTextBlock control.

For example, if I have some text like:

<Paragraph>
    This is some text. And some <Bold>bolded text</Bold>.
</Paragraph>

I would like to just bind this text to a RichTextBlock control for display. Sadly there’s no way to put content into a RichTextBlock control at runtime short of adding Block objects to the control’s Blocks collection.

As a workaround, I’ve been playing with the idea of a custom control like this:

using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Markup;

namespace Application11
{
  public class RichTextDisplay : ContentControl
  {
    public static readonly DependencyProperty XamlProperty =
        DependencyProperty.Register("Xaml", typeof(string), typeof(RichTextDisplay), new PropertyMetadata(null, XamlChanged));

    public string Xaml
    {
      get { return (string)GetValue(XamlProperty); }
      set { SetValue(XamlProperty, value); }
    }

    private static void XamlChanged(object sender, DependencyPropertyChangedEventArgs e)
    {
      var ctl = (RichTextDisplay)sender;
      var xaml = new System.Text.StringBuilder();
      xaml.Append(@"
<UserControl
  xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
  xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml""
  xmlns:mc=""http://schemas.openxmlformats.org/markup-compatibility/2006"">
  <Grid>
    <RichTextBlock>");
      xaml.Append(ctl.Xaml);
      xaml.Append(@"
    </RichTextBlock>
  </Grid>
</UserControl>
");
      var text = xaml.ToString();
      var xr = (Control)XamlReader.Load(text);

      ctl.Content = xr;
    }
  }
}

This isn’t ideal, but it does work. The RichTextDisplay control dynamically creates a RichTextBlock control, inserting the XAML document text into the body of the newly created control.

I suppose the other alternative would be to write code that parses the text to find the XAML elements and produces a series of Block objects that can be added to the control’s Blocks collection…

Friday, May 11, 2012 11:33:13 AM (Central Standard Time, UTC-06:00)  #    Disclaimer
 Monday, May 7, 2012

There are three fairly popular presentation layer design patterns that I collectively call the “M” patterns: MVC, MVP, and MVVM. This is because they all have an “M” standing for “Model”, plus some other constructs.

The thing with all of these “M” patterns is that for typical developers the patterns are useless without a framework. Using the patterns without a framework almost always leads to confusion, complication, high costs, frustration, and ultimately despair.

These are just patterns after all, not implementations. And they are big, complex patterns that include quite a few concepts that must work together correctly to enable success.

You can’t sew a fancy dress just because you have a pattern. You need appropriate tools, knowledge, and experience. The same is true with these complex “M” patterns.

And if you want to repeat the process of sewing a fancy dress over and over again (efficiently), you need specialized tooling for this purpose. In software terms this is a framework.

Trying to do something like MVVM without a framework is a huge amount of work. Tons of duplicate code, reinventing the wheel, and retraining people to think differently.

At least with a framework you avoid the duplicate code and hopefully don’t have to reinvent the wheel – allowing you to focus on retraining people. The retraining part is generally unavoidable, but a framework provides plumbing code and structure, making the process easier.

You might ask yourself why the MVC pattern only became popular in ASP.NET a few short years ago. The pattern has existed since (at least) the mid-1990’s, and yet few people used it, and even fewer used it successfully. This includes people on other platforms too, at least up to the point that those platforms included well-implemented MVC frameworks.

Strangely, MVC only started to become mainstream in the Microsoft world when ASP.NET MVC showed up. This is a comprehensive framework with tooling integrated into Visual Studio. As a result. typical developers can just build models, views, and controllers. Prior to that point they also had to build everything the MVC framework does – which is a lot of code. And not just a lot of code, but code that has absolutely nothing to do with business value, and only relates to implementation of the pattern itself.

We’re in the same situation today with MVVM in WPF, Silverlight, Windows Phone, and Windows Runtime (WinRT in Windows 8). If you want to do MVVM without a framework, you will have to build everything a framework would do – which is a lot of code that provides absolutely no direct business value.

Typical developers really do want to focus on building models, views, and viewmodels. They don’t want to have to build weak reference based event routers, navigation models, view abstractions, and all the other things a framework must do. In fact, most developers probably can’t build those things, because they aren’t platform/framework wonks. It takes a special kind of passion (or craziness) to learn the deep, highly specialized techniques and tricks necessary to build a framework like this.

What I really wish would happen, is for Microsoft to build an MVVM framework comparable to ASP.NET MVC. Embed it into the .NET/XAML support for WinRT/Metro, and include tooling in VS so we can right-click and add views and viewmodels. Ideally this would be an open, iterative process like ASP.NET MVC has been – so after a few years the framework reflects the smartest thoughts from Microsoft and from the community at large.

In the meantime, Caliburn Micro appears to be the best MVVM framework out there – certainly the most widely used. Probably followed by various implementations using PRISM, and then MVVM Light, and some others.

Monday, May 7, 2012 2:01:55 PM (Central Standard Time, UTC-06:00)  #    Disclaimer
On this page....
Search
Archives
Feed your aggregator (RSS 2.0)
April, 2019 (2)
January, 2019 (1)
December, 2018 (1)
November, 2018 (1)
October, 2018 (1)
September, 2018 (3)
August, 2018 (3)
June, 2018 (4)
May, 2018 (1)
April, 2018 (3)
March, 2018 (4)
December, 2017 (1)
November, 2017 (2)
October, 2017 (1)
September, 2017 (3)
August, 2017 (1)
July, 2017 (1)
June, 2017 (1)
May, 2017 (1)
April, 2017 (2)
March, 2017 (1)
February, 2017 (2)
January, 2017 (2)
December, 2016 (5)
November, 2016 (2)
August, 2016 (4)
July, 2016 (2)
June, 2016 (4)
May, 2016 (3)
April, 2016 (4)
March, 2016 (1)
February, 2016 (7)
January, 2016 (4)
December, 2015 (4)
November, 2015 (2)
October, 2015 (2)
September, 2015 (3)
August, 2015 (3)
July, 2015 (2)
June, 2015 (2)
May, 2015 (1)
February, 2015 (1)
January, 2015 (1)
October, 2014 (1)
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 2019, Marimer LLC

Send mail to the author(s) E-mail



Sign In