Wednesday, September 30, 2009

Presenting at SW Florida Code Camp - October 3, 2009

This weekend, October 3, 2009, I will be presenting three, count them three sessions at SW Florida Code Camp.  I’ll also be making an announcement on something super secret and image super cool that I’ve been working on for the past couple months.

Here are the abstracts on the sessions I will be presenting

ORM Smackdown

Do you build applications that sit on top of a database? If so what do you use for your DAL or Data Access Layer? Do you use ADO.NET, code generation or maybe an ORM (Object Relational Mapper)? In ORM Smackdown you will be introduced to an open source project that compares and contrasts eight different ORMs to show their strengths and weaknesses. If you are looking for a deep-dive on a particular ORM, this session might not be for you. But if you want to get a good overview of the different products and how they work from a 50,000 foot level, check it out!

Game Programming on Windows Mobile

Are you getting tired of the same-old, same-old building Line of Business applications in your day job? Maybe it’s time to do something a little more fun in your precious spare time and potentially pickup a little extra cash along the way. With Windows Marketplace for Mobile coming later this fall, right now is an excellent time to jump in and get involved. A great place to do this could be building casual games that run on Windows Mobile Phones. In this session we will start from scratch using the WiMo-GF (Windows Mobile Gaming Frameworks) and build a simple game that includes some relatively advanced concepts such as physics, collisions and gravity.

Windows Marketplace for Mobile

In this session, Nikita Polyakov (Mobile Devices MVP) and Kevin Wolf (Mobile Device Collector) will introduce you to what it takes to get your Windows Mobile Application or Widget published to Windows Marketplace for Mobile. We will cover signing up for the program and any special requirements for your software as well as the steps involved to submit your application.

Saturday, September 19, 2009

Oslo in the Next Generation Architectures

Note: This article primarily deals with constructing fairly large Line of Business applications.  If you are building control systems or software that is more oriented to be used within other applications (Graphics Libraries, ORM’s, etc…), this article may not apply to your type of development.  But who knows, we are breaking new ground here.

If you read my last post, I’ve asserted that when constructing a typical LOB type application, you should focus on your data model and work up from there.  The thought being that the most static part of your system will be the data and it’s relationships. 

I’m not going to dwell on it here, but I think some sort of ORM should be placed on top of that data model.  ORM’s are really a commodity.  They all have their strengths and weaknesses.  If you’re not using some sort of ORM you should at least see what they have to offer.  My ORM Smackdown project is a good place to check out different ORMs.  Although your technology for implementing a data model and an ORM might change, I will submit in one-way-or-another, these two components are fairly “settled law”.

As we start moving up the stack, the next layer is business logic.  The business logic layer is where most of the code for your application should live and is going to be somewhat dynamic with respect to time and changes in the business.  Yes, there is the potential for changes to happen to your data model, but if you have enough systems under your belt you know most of these changes are additions, not changes to the structure.  At a very high level there are two components of a the business logic layer, Business Rules and Functional Requirements.

According to Wikipedia a Business Rule is defined as:

A statement that defines or constrains some aspect of the business. It is intended to assert business structure or to control or influence the behavior of the business

And a Functional Requirement is defined as:

A functional requirement defines a function of a software system or its component. A function is described as a set of inputs, the behavior, and outputs

Oslo has the potential to change change the way we enforce the Business Rules and satisfy the Functional Requirements in our business logic layer.

Before I go too much further, I’m going to make a claim that I’ll need you to think about before we go too much further. 

There are two primary activities that a user or other system does when they interact with a system.  1) Annotate “something” with some additional data via user entry, calculation or call to a service.  2) Interact with “something” to enable a future state of that “something” based upon constraints.

This might not be obvious when you are building your software, but at a certain level of abstraction if you think about out it, these are probably valid statements.

Let’s bring this back to Oslo

As I stated before Oslo provides us mere mortals a mechanism of quickly and easily constructing a grammar or Domain Specific Language (DSL).  So the idea is that we build up small highly configurable “chunks” of functionality that could very easily be unit tested.  Then we use a DSL to glue these together to satisfy the functional requirements of the systems we are constructing.

Let’s take the example of submitting an invoice.  We are going to model our invoice as a finite state machine.  This sample is a greatly simplified business flow but let’s assume our invoice as three states, “New”, “Submitted” and “Paid”.  Our first syntax will be used used to define our states.  It might be something like:

The states of our invoice are New, Submitted and Paid. 

This defines a new entity or object in our system called Invoice.  It also defines that state our invoice can be in, which are New, Submitted and Paid.

Next we need to define some business rules, these could be defined as something like:

The invoice can transition between New to Submitted and from Submitted to Paid.

This maps the business flow that the invoice must follow.  It is possible for an invoice to go from New to Submitted but it is not possible for it to go from New to Paid.  This is obviously a simple process flow but for a more sophisticated process flow, I’m sure you could see how this might be useful.

Now if we want to add some additional states to our system we can use the following grammar.

The states of our invoice are New, Cancelled, Submitted, Overdue and Paid. 

To make things a little more interesting, our transitions will then be updated to:

The invoice can transition between New to Submitted, New to Cancelled, Submitted to Cancelled, Submitted to Overdue, and from Submitted to Paid.

Defining the states and transitions is the foundation and first step as well as something that can easily be managed by a DSL. 

This is the first layer we will be using to define business rules and functional requirements, there is much more to come, but this seems like a good place to end this post.  In our next post we show how we can use “M” to take the syntax and turn it into something that is useful for a computer.  As we progress through these posts, I will probably do one post like this that introduce the concept and a follow up on how that concept would be implemented in Oslo.

Until next time…

-ec

Tuesday, September 15, 2009

Enabling “Pen and Touch” features on your Samsung NP-Q1 UMPC

A couple/few years ago, I purchased a Samsung Q1 UMPC.  It came with Windows XP and performance was adequate, however I configured it for dual boot and install Vista on a second partition.  Performance with Vista was, well, ah, let’s just say the device hasn’t been used all that much recently.

I’ve heard good things about running Windows 7 on older machines so I went through the upgrade process on my Q1.  Windows 7 brought this device back to life (the drivers are easily spotted with a little bit of searching).  The only problem I had was that the touch screen acted like a mouse. That is to say it didn’t have any of the nice features that Windows 7 implemented for “Pen and Touch” or any advanced tablet features.  After doing a bit of research I was finally able to get my device acting as a “Pen and Touch” enabled computer.  It should be noted this isn’t a Multi-Touch device, just a single touch point.

Before you get started, I found it was easiest to just get an external mouse to configure the Q1. 

  1. Download and install the eGalaxTouch for Windows 7
  2. Copy and extract this driver to your Q1
  3. If you have a fresh install you should see something like HID Touch Driver (Universal) under “Mice and other pointing devices” in your Device Manager Note: It will be very close to that, I’ve already upgraded my driver and can’t remember the exact name.
  4. We can’t upgrade the default Touch Driver to our new one directly so will need to upgrade to one listed in the devices.
    1. Click on “Update the Device Driver”
    2. Select “Browse My Computer”,
    3. “Let me pick…”
    4. Un-check “Show compatible hardware” and look for “ELO TouchSystems” and install that.  The idea here is that we just need something we can upgrade so if you can’t find and that specific one, find one you can install.
  5. Reboot your computer
  6. Now when you open your Device Manager you should see the temporary driver you installed.  This will probably be under “Human Interface Devices”.  Your touch screen may or may not work at this point.
  7. Go through the same process to upgrade your temporary driver, but this time find the folder where you extracted the drivers from the second step above.
  8. Reboot again.
  9. If all went well, when you select the user you want to login with and see the password box, you will see an on screen keyboard.
  10. Once you login, be sure to open Hardware and Sound under control panel.  This is where you can calibrate your device and configure the rest of the Pen and Touch options.

image

You can also verify that your system is setup properly by clicking on “Computer” and “System Properties”.  You will see Single Touch Input Available.

By the way, don’t let the 1.0 WEI fool you that is just because I can’t run Aero on the device.  For what I’ll use it for, performance is better than Windows XP and much better than Vista.

-ec

Monday, September 14, 2009

Crazy Coins Approved for Distribution on the Xbox 360

The XNA game Crazy Coins that I built for the Xbox 360 has been approved for distribution on the Indie Games area of XBox LIVE Marketplace.  Look for it available for purchase on your Xbox market place this Wednesday.

CrazyCoinsImage

Sunday, September 6, 2009

Oslo, what is Oslo? No not the city in Norway

What is the primary thing we do as software engineers?  Write code?  Well maybe, but what is the purpose of the code we write?  I would argue that the primary reason we write code is to fill some sort of need, that need might be making your life easier or more enjoyable, saving time or helping your company decrease costs, improve sales or improve customer satisfaction.

Software is expensive to write and maintain, but why?  I will argue again because it’s written in “code”.  Wikipedia defines code as:

In communications, a code is a rule for converting a piece of information (for example, a letter, word, phrase, or gesture) into another form or representation (one sign into another sign), not necessarily of the same type.

This generally involves translating the problem you are trying to solve to the programming language du-jour.  I’m sure you’ve heard of the telephone game where someone tells a story, they tell that story to someone else and soon the story does not resemble the original.  Software development is incredibly frickin’ difficult and if you are lucky enough to have the original “story-teller” know enough and tell you an accurate account of what your system needs to happen, will you interpret it correctly and translate it to code properly.  Good luck.  All the latest techniques such as agile and all its offshoots claim to make your software highly, well agile, adaptable to change.  If you need to translate a moving target such as a highly complex set of business rules, today this is probably the right approach.

Before we get into my primary assertion that Oslo has the potential to be a game changer, please allow me to take a slight detour and explain an assumption and something I’ve learned over the years.

The most valuable asset you will have when designing a system is the model that describes that data and the relationships of that data within your system.  This is the core premise of Object Orientation.  With respect to time and changes in business operations, the behaviors, business rules and functional requirements will change, the data that is used by those components is the most static part of the system.  Spend your time up-front beating up your data model and specifically they relationships between the data.

Let’s assume that you allow me to claim that the data model is the most important part of your system and you have accurately modeled that data that represents your organization or problem.  Now what?  You need to describe how that data behaves with respect to actions and time.  This is could be described in something called a Finite State Machine.  If done properly, our data model should be able to accurately represent the data for the objects as they transition between states.  We need a mechanism to describe the conditions in which these transitions are possible as well as what additional behaviors are executed as they transition between states.

Now back to Oslo.

In my humble, yet reasonably experienced opinion this is where Oslo has the potential to become a game changer.  Let me explain.  Oslo has the potential to bring a fundamental shift not in the tools and technology we use to develop our systems but by providing a mechanism to facilitate a radically different approach in solving problems. It does this by letting us mere mortals quickly and easily build DSLs or domain specific languages without having to design lexers and parsers.  Since this is a fundamental shift in our discipline, it’s too early to target DSL’s to our end users.

The DSLs we define with Olso should be used by the people that know the problem to describe relationships, business rules, functional requirements and behaviors in a syntax that they can read, write and understand.  These DSLs will then be translated directly to something that can be executed without additional involvement of a “coder”. 

I’m a coder, so what does that mean to me?

In this brave new world where we provide the tools for the people that understand the problem to solve their own problems, we the coders will have some new roles:

  • Define a normalized data store
  • Construct the grammar for the DSL
  • Construct a generic and testable set of behaviors to be configured by the DSL
  • Put the user interface on top of the application

This is obviously a fairly large topic that I’ll be expanding on in the next few weeks but let me close by an example of DSL you might be familiar with:

image

This DSL is intended to be used by an end user, but start thinking about how you could use this same concept in your application to configure business logic.

When a payment is received on an invoice, transition that invoice from Pending Payment to Paid and send a confirmation email.

If you had a mechanism that would turn that grammar into some sort of expression tree, could you provide some sort of engine to execute it?

Until next time

-ec