Mindscape


11 June 2007 in .Net & Code & Mindscape & Tools | Comments (2)

Mindscape LightSpeed Logo

In the weekend I was reworking a prototype of something I’m working on and I wanted to use LightSpeed to manage the data access and thought it would be appropriate as a code example of how to quickly and easily get started with LightSpeed. To clarify, I only needed LightSpeed for the persistence mechanism as opposed to the full domain modeling capability at this stage of my project.

The Problem
My application needed a mechanism for persisting configuration. The configuration this application stores is extensible and ideally will be extended by 3rd party plug-ins which means I needed to expose a service that can be used by these 3rd parties to store their custom configuration in a manner that will give access both to their plug-in as well as our application.

I’m also a staunch hater of >300KB XML configuration files and it’s early days in the prototype :)

Step 1: Create your model classes
I have a simple configuration entity that I wanted to be able to persist to a SQLite database (LightSpeed supports many different database engines by the way). At this stage of my prototype I’m effectively only storing a key/value pair, a human readable name and description and a type (e.g. string, color, int). In this code example you will need to reference LightSpeed in your project to gain access to the Entity<> class that we are inheriting off.

Note that LightSpeed takes care of the enum as well and will happily convert it to an int at the database level :) Too easy.

using System;
using Mindscape.LightSpeed;
 
namespace Mindscape.Carbon.Core.Configuration
{
  public class ConfigurationItem: Entity<guid>
  {
    public enum ConfigValueType
    {
      STRING,
      INT,
      COLOR
    }
 
    private string _referenceName;
    private string _value;
    private ConfigValueType _valueType;
    private string _displayName;
    private string _description;
 
    public string ReferenceName
    {
      get { return _referenceName; }
      set { Set(ref _referenceName, value, "ReferenceName"); }
    }
 
    public string Value
    {
      get { return _value; }
      set { Set(ref _value, value, "Value"); }
    }
 
    public ConfigValueType ValueType
    {
      get { return _valueType; }
      set { Set(ref _valueType, value, "ValueType"); }
    }
 
    public string DisplayName
    {
      get { return _displayName; }
      set { Set(ref _displayName, value, "DisplayName"); }
    }
 
    public string Description
    {
      get { return _description; }
      set { Set(ref _description, value, "Description"); }
    }
  }
}

Step 2: Create your database
Currently you create your database manually however we are working on tools to do this for you. Note that I’m using a GUID as the primary key on this table and we didn’t need to add it to the model object in the previous step, LightSpeed does this for you. You only need to supply the primary key type in Entity. Now you can jump into whatever database you’re working with and create the table.

In my case I was using SQLite and just used a simple create table command:

CREATE TABLE ConfigurationItem(
  Id                GUID            NOT NULL PRIMARY KEY,
  ReferenceName     NVARCHAR(50)    NOT NULL UNIQUE,
  Value             NVARCHAR(100)   NOT NULL,
  ValueType         INT             NOT NULL,
  DisplayName       NVARCHAR(100)   NOT NULL,
  Description       NVARCHAR(1024)  NOT NULL);

Step 3: Add LightSpeed to your configuration
We need to tell our application about the database that LightSpeed should be working with and we can do this in code or in the .config file for our project. In this example I’ve elected to put it into the app.config of my project.

  <configSections>
    <section name="LightSpeed" 
        type="Mindscape.LightSpeed.Configuration.LightSpeedConfigurationSection, Mindscape.LightSpeed" />
  </configSections>
 
  <connectionStrings>
    <add name="ConfigDB" connectionString="Data Source=MyDatabase.db3"/>
  </connectionStrings>
 
  <LightSpeed dataProvider="SQLite3"
           connectionStringName="ConfigDB"
           identityMethod="Guid"/>

Step 4: Work with your data
That’s it! All the configuration work has been completed and there is no heavy XML mapping file or complex setup to tell LightSpeed about the database. The whole philosophy behind LightSpeed is to help developers get work done quickly and I hope this example and your own work with LightSpeed proves that. In following posts I will provide detail about working with your data however here is a taster of how easy it is to now put new objects into the database:

    ConfigurationItem item = new ConfigurationItem();
    item.ReferenceName = "MyRefName";
    item.ValueType = ConfigurationItem.ConfigValueType.STRING;
    item.DisplayName = "Example Config";
    item.Description = "This is an example configuration key";
    item.Value = "example";
 
    Repository.Add(item);
    Repository.CompleteUnitOfWork();

In this example I had an extremely simple model however you can appreciate that there is significantly less leg work required to get a LightSpeed solution up and running. I will post more advanced real world examples to help you gain more from working with LightSpeed in the near future. Also please leave any comments or questions you have on my blog regarding LightSpeed.

How can you use LightSpeed?
We currently are in late beta with an RTM of LightSpeed just around the corner. You can grab the download of LightSpeed from the Mindscape EAP site. You can also post in the forums to discuss any challenges that you have or to ask questions. We welcome any feedback.

Update: LightSpeed was released and is now available to play with here: http://www.mindscape.co.nz/products/LightSpeed/

Hope that helps,

– JD

Average Rating: 4.8 out of 5 based on 297 user reviews.


15 May 2007 in Business & Mindscape | Comments (0)

I’ve just finished posting about how Mindscape has become the exclusive New Zealand partner for CastleStronghold. For more information about the arrangement then check out our formal announcement at our blog.

I welcome any questions regarding this.

- JD

Average Rating: 4.6 out of 5 based on 277 user reviews.


11 May 2007 in Mindscape | Comments (2)

Phew! We got our first Beta release pushed out to our beta testers today and what can I say – it’s a real buzz to be pushing products out to people even at this stage of the development cycle! It got me thinking about the school of thought that shipping early and often is important for ensuring a great product in the long term. There are additional benefits than just a great product, it gets the team buzzing that their hard work is being put to use.

What is LightSpeed?

LightSpeed is a domain modelling framework that is built on best practices and aims to enable users to get up and running with their domain models fast and easily. Our primary goal was to reduce the effort required to develop solutions that require a domain model. I’ll be posting more about this product in the next few weeks. I know I’m bias but this is one framework that I know I would personally use even if I wasn’t involved in the development, it really saves time and is easy to get working with.

LightSpeed’s design philosophy is centred on:

  • Convention over configuration.
  • Support idiomatic .NET domain models: (Data binding etc.)
  • Highly usable API and low barrier to entry.
  • Internalizes best practice patterns: Session per request, Unit of Work etc.
  • Testability built in.
  • Small, lightweight and performant.
  • Solve the 95% case – i.e. more like Rails than NHibernate.

Can I be a beta tester?

If you are interested in joining our Beta it’s not too late, email me and I’ll arrange for you to be added to the list.

I’m off to my brothers engagement party this weekend for a bit of a break. We have a whole pile of announcements to make next week, keep an eye on the Mindscape Blog to see them :)

- JD

Average Rating: 4.5 out of 5 based on 162 user reviews.


10 May 2007 in Events & Microsoft & Mindscape | Comments (0)

Remix 07

I’m really pleased to have been given the opportunity speak at Remix in Melbourne in late June. Clearly Mix07 in the US was pretty huge this year (so huge I’ve not added to the echo chamber about the cool announcements, everyone knows already :) and it’s great to see Microsoft creating an event down under to bring some of that vibe closer to home.

The event has two tracks, a developer and a designer track. It seems this year is all about focusing on bringing those two camps closer (about time I say!) so if you’re a developer you should bring your designer friends along with you. I’m delivering a presentation to each track, one on standards and the other on pushing your applications further.

Seats are limited so I’d strongly urge anybody who is interested to go and sign up. It’s inexpensive for a two day conference and you get a free copy of Expression Web for attending.

Click here to visit the Remix 07 website.

I look forward to seeing you there,

- JD

Average Rating: 4.7 out of 5 based on 225 user reviews.


1 May 2007 in .Net & Mindscape | Comments (0)

This is a bit of cross pollination but we are currently looking for beta testers for our first product. If you’re keen then head over to my post about becoming a beta tester on the Mindscape blog.

http://www.mindscape.co.nz/blog/?p=20

Thanks,

- JD

Average Rating: 5 out of 5 based on 183 user reviews.


27 April 2007 in .Net & Mindscape | Comments (0)

Mindscape

Recently it seems local .NET developers are picking up parts of the Castle Project (Monorail, ActiveRecord etc) and there has been a bit of discussion going on regarding how certain things should be done. It’s great to see this framework being picked up, it really does aid creating more robust and maintainable solutions. As with anything new that you’re learning it can sometimes be daunting and challenging though.

So where should you turn if you need guidance with using parts of the Castle Project? Mindscape.

We have really smart people here who not only know how to leverage it effectively but have also contributed code back to make the Castle Project better for everyone. If you’d like to talk to us about getting some guidance or help then contact us or contact me directly.

- JD

Average Rating: 4.6 out of 5 based on 260 user reviews.


4 April 2007 in Code & Microsoft & Mindscape & Windows | Comments (0)

Mindscape PowerShell Gadget

Andrew here at Mindscape has just put the finishing touches on his first version of a PowerShell Gadget for the Windows Vista SideBar. I’ve been fortunate enough to have been able to have a play with it while he’s been developing it and personally I think it’s pretty damn cool. I’m always firing up PowerShell for little commands here and there so by integrating PowerShell into the SideBar I no longer have to switch away from what I’m doing for too long.

Click here to see a screen shot of the Gadget in use

If you’re interested in checking this project out and downloading the gadget, check out the Mindscape blog post about it.

- JD

Average Rating: 4.7 out of 5 based on 197 user reviews.


23 March 2007 in Events & Mindscape | Comments (5)

Lately I’ve delivered a few presentations as you’ll likely know from my previous posts. I thought I’d write a few thoughts on what I’ve found while doing them. To set the scene for those who haven’t attended my recent talks, the audience size has been between about 150 to 500 people. Quite large by my standards, certainly the largest audiences I’ve spoken in front of.

A few things I’ve learnt from doing these presentations:

  • The first words are the hardest, get them out and you’re fine.
  • When you’re mic’ed up you don’t even notice it after about 3 seconds of speaking, I was a tad concerned about that.
  • The intense nerves you get before speaking are actually good if you can turn them into energy when you speak.
  • Check if you have a “nervous tick”, mine was saying “Good Times” which while amusing to most, I tried to ensure I didn’t say it too often after the first presentation.
  • Make sure you have some water, a dry throat tends to hit you suddenly.
  • Be ready for bright lights, often you can’t see the audience very well because of it (which can be a good thing if you’re nervous).
  • Look around the room, even if you can’t make out the faces you should look like you’re talking to the people.
  • Try to use pictures and less words on your slides, you’re less likely to read the slides to the audience and it’s more interesting to the crowd.
  • Don’t name your last slide consistently as “Call to Action”, the audience learns and reads it as “Pack up” when it’s potentially the most important message of the presentation :)
  • Many more things but I won’t go on :)

One thing I’d also suggest is that you find somebody who has done these types of talks before to work with when you first do them at this size. I was fortunate enough to doing them with Jeremy there as well who I’m pretty sure has done about a million big audience talks. He was really useful for being able to answer any questions I had and for making sure I didn’t let me imagination run away on me about how intimidating the audiences could be (I found the audiences great, I ended up feeling quite relaxed by the end of the presentations). So a big thanks to him.

Now I’m thirsty for some more presentations, that nervousness is like a drug :)

- JD

    Average Rating: 4.5 out of 5 based on 210 user reviews.