Modeling and Design

Being in the design phase of a large-scale project for the State of Ohio, I have been giving a lot of thought to the problems of Modeling and Design.

You see, I am in an interesting position on most projects – I am an actual Solutions Architect.  In today’s IT environment the term ‘architect’ has grown to mean “good coder with big mouth” and I don’t really fit that mode.  I am not the best coder in the room most of the time – although the size of my mouth could be debated.

What I excel at is the designing of solutions, which leads me to use the term ‘software designer’ to describe myself.  This isn’t terribly good either, as it leads people to believe that I produce pretty graphic design and UX, which isn’t my specialty either.

What I am, in truth, is a Software Modeler.  I am the person that figures out what the domain model looks like based on the requirements of the system and the realities of the project.  The one who stands at the end of the room and scribbles boxes on the whiteboard?  Yeah, that’s me.

Thinking about this has really helped me to hone down the definition of SQL Modeling in my head.  People ask me “Why is Oslo hooked to SQL Server?  Is it just another data language?  Don’t we have enough of these?  I thought M was a language not a database thingie!  Oh woe is me!”  Well, the key is in the difference between design and modeling, and how tightly coupled the model and the database really are.

Software modeling begins and ends with data.  The user interface is, I hate to point out, now the purview of the business analyst.  When I get a functional specification for a project, it has the UI in it right there.  I don’t have to ‘design’ that any more.  All I have to figure out is how to do it.  This effort is modeling, and it is about data.

Today I needed to estimate an inventory system with a few quirks.  Without thinking, I got out my notepad, sketched an ER diagram, and worked from that.  How many POCOs?  How many adapters?  How big is the entity model?  Yes, eventually I had to estimate how long it would take me to build the screens, but the bulk of the work was in the domain model, where the work is done, as it should be.

Livescribe Notebook Page 48

Imagine if I could have instead described my model in text, without all of the brittleness that the ER diagram entails, and have that text description emit both the databases and the POCOs for me?  And then, if something changes, I could change my scratch model and my other code changes?  What if it didn’t break my changes or additions?  What if it didn’t create scores of stored procedures that are impossible to manage? 

Wouldn’t that be nice.

This, though, is the goal of SQL Modeling.  It is clear as day exactly where it fits in the product lifecycle – right there overtop of my fancy notebook scrawls.  Those boxes and chicken feet have a place somewhere, but it’s time for a modeling solution that actually is a solution.

Generic properties

As part of a project I am working on, I need to create an appointment calendar with appointments that can be tagged with and one (or more) of four tag groups.  The appointment viewer can then be filtered to see only appointments tagged with selected properties.

The tags are stored in a generic pot with all of the tags, and then are themselves tagged by Type. 
(Can amyone say MetaInformation.  Yeah, there’s an app for that.)  The tags of each type should have their own checkboxlist. The UI looks like this:


There are a number of ways that I could implement the collection that I bind to the listbox, but I am using Telerik controls and they would really like a generic list.  OK, I can handle that, right?  I can make a generic List of the particular POCO, and just pass it through.  But … how do I filter?  In the old days I would write a sproc, but these days, we have LINQ, and this is a job for LINQ to Objects (really the only LINQ that matters …)

protected List<Tag> Clients
        var clients = from x in Tags
                      where x.Type == "Clients"

                      select x;         return clients.ToList();

protected List<Tag> Resources
        var resource = from x in Tags
                    where x.Type == "Resource"

                    select x;
        return resource.ToList();
protected List<Tag> Staff
        var staff = from x in Tags
                      where x.Type == "Staff"
                      select x;
        return staff.ToList();

protected List<Tag> TextTags {
    {         var tag = from x in Tags
                    where x.Type == "Tag"
                    select x;
        return tag.ToList();

Now I can work from the Tags collection in the entity model, and easily get just the values I need.  I can get rid of the magic values with an enumerator, but I thought it was a good use of Linq.

Brew Plan for Cinco party

I posted a pic of the latest delivery by my favorite UPS guy, along with a little beer haiku:

Even on cold days
The ups driver can
Bring warmth to my heart

A few people asked about the brew plan, but it doesn’t fit in Twitter.  I thought I would post it here for fun.

Good Night In Mexico

(From TCJOH, page 179)

7lbs Dark DME

1lb Rice

1lb Light Crystal Malt

¼ lb Barley

1 ¼ oz Spalt

1oz Saaz

1oz Hallertaur

German Lager Yeast



(from BCS, page 151)

7lbs Pale Ale DME

¾ lb Special Roast

½ lb Victory

½ lb Crystal

¼ lb Pale Chocolate

2oz Williamette



Leaden Lager

(Hellbranch Recipe)

7 lbs ultralight DME

3oz saaz

Saflager S-23

Android development … in Windows

So my plan was to start some Android development with Eclipse in Linux, just to sharpen the saw. But you know what?  With all of the improvements in Linux over the last ten years, it still sucks.  If ANYTHING goes wrong, you are screwed.  You have to change some bit flag in some cryptic file that there are four references to in Google, and then restart seventeen times.

Specifically, what I did was install Eclipse in Jaunty Jackalope using Add/Remove.  That was admittedly my mistake – Jaunty doesn’t support 3.4 or 3.5 of Eclipse, which are needed for a quality experience in Android development.  Second mistake – I tried to install Eclipse 3.5 manually over top of 3.2.  HORRIBLE idea.  When I figured out what I had done, it was a mess to fix it.  In short, total time to compile Hello World, 5 hours.

Windows 7 experience: 10 minutes.  We will be talking about Windows.

To get started, you want to install the JavaSDK.

Next you want to install the Android SDK.

Finnally, you want to install Eclipse.

After all of the installations are done, you will want to configure the Android tools for Eclipse.  Part of this is adding the SDK components.  This is all well document, and most importantly, it is hard to screw up.

The only weirdness is the necessity to manually create the package file.  IT’s easy but weird.  From a command prompt, go to the location that you put the Android SDK (Mine is just in the Documents folder) and run this:

android create avd --target 2 --name my_avd

The you just need to create a new Android project in Eclipse.  I’d write about it, but it was so well documented in the Hello World documents.


And there we go.  Got the whole things running, in just about ten minutes.

The actual programming thing, well that’s next.

Sempf's Laws

Sempf's First Law: In any system, no single effect has a single cause.
Sempf's Second Law: All systems can be decomposed into binary decisions.
Sempf's Third Law: Given the correct catalyst, all systems will accelerate descent into entropy.

How you know you were a geek in the eighties

  1. You remember when AD&D went to Second Edition, and were ticked off about it.
  2. You know the Commodore 64 bootup sequence.
  3. Wargames was your favorite movie.
  4. After watching Wargames, you dialed into Delta's system and ordered tickets to Paris.
  5. You subscribed to Dragon Magazine and Boy's Life.
  6. You listened to Dr. Demento.
  7. There are three bins of Space Legos in your basement.
  8. There are CDs in your collection that are twenty years old.
  9. You ran a BBS from your TRS 80.
  10. You remember Donkey Kong's four screens, and know who Jumpman is now.
  11. Johnny Five - scaring the SHIT outta me since 1986.
  12. There is a a Mac Classic in your basement you have been meaning to turn into a Macquarium.
  13. You know at least one method for bypassing physical copy protection on floppy disks.
  14. After the Challanger disaster, you were the one that explained to everyone exactly what happened.
  15. You still have your big fuzzy marching band hat.
  16. You have a working IBM Luggable in the basement.
  17. If you STILL jump after the phones ring because of Lawnmower Man.

Describing one-to-many relationships in M

In M you can describe values and use MGraph to infer a data model.  for instance, I can tell it a little data, like this:

module TheStates
  States  => { "Ohio", "Indiana", "Kentucky" };

… and get back the SQL code for my inferred table:

set xact_abort on;

begin transaction;

set ansi_nulls on;

if not exists 
    select *
    from [sys].[schemas]
    where [name] = N'TheStates'
    execute [sp_executesql] N'create schema [TheStates]';

create table [TheStates].[States]
    [Item] nvarchar(max) not null

insert into [TheStates].[States] ([Item])
    values (N'Ohio'),

commit transaction;

The problem is with a real world model, say a collection of states that represents a route.  if you try to model that with an extent, like this:

module Proto
  Representative =>
    Id => "4";
    Name => "Bill";
    States  => { "Ohio", "Indiana", "Kentucky" };
  } where identity Id;

Well, at least it is a Not Yet Implemented error.

untitled3  4,3-8,22    Error   M3999   Not yet implemented: Initializing a collection with an expression that yields a collection (Microsoft.M.SemanticGraph.FromExpressionSymbol)

Still, without something that straightforward implemented, it is tough to call this a modeling language for data.  Hopefully it is in the works soon.

CodeMash v2.0.1.0. Burndown

Codemash 2010 is in the books, and once again it has proved that sub-1000 attendee regional conferences can provide at least as good – if not a better – experience than the PDCs and the TechEds of the world.  Every single attendee that I spoke with was blown away by the speakers, the open spaces, the staff, the location, the food and everything else.  With the exception of the local area network and AT&Ts poor showing signal-wise, I don’t think I heard a single complaint.

It was the best one yet, and I believe they will outdo themselves next year as well.  It’s a great con, and I think all of the people who put it together: Jim Holmes, Brian H. Prince and Jason Gilmore, along with the speaker board, the vendors and the countless volunteers.  It was a great team effort.

Honestly, I didn’t go to too many sessions this year.  I did manage to go do the Ruby Koans with EdgeCase, and that was eye opening.  Not only did I get started learning a new language, I also learned a fantastic way to teach a new language.  My other precompiler session was with Mary Poppendieck, on the topic of leadership and building sustainable competency in an IT organization.  She knows her stuff, and I think I found the mentor I needed going forward with the Technical Evangelist project at ICC.

Mary Poppendieck at CodeMash

The breakout sessions were not as mind blowing as I thought they would be.  There was a distinct shift in the presenters this year, with many fewer local speakers, and a lot of names I didn’t know, but with impressive titles.  I don’t think any one company had more than one presenter, except EdgeCase, who presented a remarkable SEVEN TIMES through the con.  Those guys are smart, but SEVEN TIMES?  I just don’t know.

Honesty, the quality of breakouts that I went to was about the same.  Rob Gillen had a very well delivered presentation on using Azure for parsing weather data, and that was really eye opening.  Other than that, though, it seemed to be a lot of the same old stuff.  Nothing was bad, mind you, just a little less inspiring than I thought given the 500 presentations that they had to pick from.

<sigh> No matter how I say that it just sounds bad.  I was really happy with the breakouts.  There, I said it.  I just thought there would be more ANAZING stuff.

Anyway, I was really honored to be asked to speak this year.  I did my Economics of Cloud Computing presentation, and it was really well received.  Many people stopped me afterward and mentioned how they liked the information (and then there was Pete Gordon, who told me my math was wrong.)


Anyway, I had the classic stupid technical problem at the beginning, but a reboot fixed it, and everyone waited patiently.  I could have used the time though – I had to rush through the cloud breakdown a little.  It was a bummer.  Oh:

Here is the link to the Economics of Cloud Computing Presentation.

Here is the link to the orginal Economics of Cloud Computing paper.

Here is my new page.  Go rate me – since I am not sure if evals were actually taken.

There is a lot to be said about holding a developer conference at the largest indoor waterpark in the country, too.  Aside from that there was a game room set up by Jeff Blankenburg, KidsMash, and this huge ball cannon tree root air swoosh thingie:

2010-01-13 19.15.03

A good time was had by all.

econofcloud.pptx (7.08 mb)

Christmas came (a day) early.

Went and got the mail and I was SO VERY happy to see my new picks from LockNewbie.  I got a short hook and a bogata to go with my long feeler, and replaced my existing short hook and half diamond  in my carry set.  I am still going to keep my set of bogata from Rai, because how could I not??


This should about do it for me, on a day to day carry-and-practice set.  I can get into a Master 140 in about 20 seconds using the long feeler and my custom tensioner.  Rai’s bogatas will get me into a lock with no security pins in under ten seconds usually. 

The bogata/short hook combo seems to be a great combination for spool and mushroom pins.  They have the same feel, so I can start with the handled bogata to get a false set, and then move to the VERY delicate short hook to pop the lock.

I got Gabrielle a bogata and a ball feeler too – it should work well with her picking style.  And they are RED.  All in all, very happy.

Get started modeling in ‘M’

Well, if you went to PDC and did the thing I always do, which is go to every talk that lists Don Box as a speaker, then you probably heard about SQ!L Modeling.  I don’t care about the SQL part – SQL is a database as far as I am concerned – it is an implementation detail.  As a software architect, though, I am very interested in Modeling.

So I get the bits and install them.  Great.  I have Quadrant as a Start Menu item, but Quadrant is Access.  Not interested (for this anyway).  I want to tell Visual Studio how I need my software built.  I need M.

The New Project Dialog has a Oslo Library that might be interesting.  I thought they had nixed Oslo though?  What’s up with that?  Anyway, the description says “A project for creating Oslo Flavored CSharp Library” whatever that means.  I just want to design software, people.  I don’t make ice cream.


I’ll go ahead and model SHARP, my event system, because I know that system well and have been modeling it for years.  To start, I name the Oslo Library SharpLibrary.  The resultant code is unusual, but it is a new language after all.

module SharpLibrary
    type Model
        Id : Integer32 => AutoNumber();
        Field : Integer32;
    Modelsamples : {Model*} where identity Id;

Don’t let the ‘module’ statement fool you – this isn’t a RAD application development language that will remain nameless.  M is a language that will model your middle tier.  Let’s model.  The goal is to build the simple SHARP model, which I used in VB for Dummies and the C# All In One.


I will start with the Conference entity, because it is sorta the middle of the system.  ID is as the example, but I want to add a Title and Description.  First thing is that M needs intellisense.  What’s a string again? String?  Varchar?  Oh, no of course it is Text.  Of course.

More later!

Who the heck is Bill Sempf?

Bill Sempf

Husband. Father. Pentester. Secure software composer. Brewer. Lockpicker. Ninja. Insurrectionist. Lumberjack. All words that have been used to describe me recently. I help people write more secure software.

profile for Bill Sempf on Stack Exchange, a network of free, community-driven Q&A sites

INETA Community Speakers Program

EFF Member 2013

Month List

Paying the bills


I spoke at

I'm speaking at Black Hat Europe

AppSec USA 2013