Ayende @ Rahien

It's a girl

Macto, or How To Build a Prison

image

The sample application that I am going to build is going to be a prison management application. I am going to take this post as a chance to talk about it a bit, discuss the domain and then I’ll talk about the overall architecture in more details.

The domain of a prison is actually fairly simple, you have an inmate, and the sole requirement is that you would keep him (it tend to be overwhelmingly him, rather than her) in lawful custody.

The term lawful custody has a lot of implications, which are, in more or less their order of importance:

  • The inmate is in custody, that is, he didn’t manage to run away.
  • Custody is lawful, that is, you have legal authorization to keep him in jail. Usually that means an order by a judge, or for the first 24 hours, by a police officer.
  • Lawful custody itself means that you:
    • keep the inmate fed
    • in reasonable conditions (sleeping quarters, sanitation, space)
    • access to medical facilities. Indeed, in most prisons the inmates get better health care, especially for emergencies, than the people living in most big cities.
    • ability to communicate with lawyers and family

The devil, however, is in the details. I am pretty sure that I could sit down and write about 250 pages of high level spec for things that are absolutely required for a system that run a prison and still not get everything right.

In practice, at least in the prisons I served at, we did stuff using paper, some VB6 apps & Access, and in one memorable occasion, an entire set of small prisons where running on what amounted to a full blown application written using Excel macros.

Anyway, what I think that I’ll do is start with a few modules in the system, not try to build a full blown system.

The modules that I‘ll start with would be:

  • Staff – Managing the prison’s staff. This is mostly for authentication & authorization for now.
  • Roster – Managing the roster of the prisoners, recording Countings, etc.
  • Legal – Managing the legal side of the prisoners, ensuring that there are authorizations for all the inmates, court dates, notifications, etc.
  • Escort – Responsible for actually taking the inmates out for court, medical evacs, releasing inmates, etc.

That is enough for now, for that matter, it is a huge workload already, but that is about the only way in which I can actually have a chance to show a big enough system and the interactions between all the parts.

Comments

Kyle Szklenski
07/27/2009 08:08 PM by
Kyle Szklenski

I hope you meant a Roster class, not Rooster. :) That would be one hell of a rooster, managing all that!

Eyston
07/27/2009 08:10 PM by
Eyston

A large feeling of anticipation, and a nagging one of guilt. A week or two after writing about needing to take breaks to avoid burn out you are making a complex application for no other purpose than community example. Thanks.

Bobby D
07/27/2009 08:13 PM by
Bobby D

Really looking forward to seeing the app come together.. thanks for listening to the readers!

Kornelije Sajler
07/27/2009 08:56 PM by
Kornelije Sajler

Sounds very interesting. I can't wait to see progress of MactoPMS and great developer at work. I also hope that you will not stop and rework all app like Rob Conery did!

Mikael Henriksson
07/27/2009 10:20 PM by
Mikael Henriksson

Without doubt the most interesting sample application I have come across so far. Will be very nice to follow how you go about it.

Venu
07/28/2009 12:03 AM by
Venu

In your post "Feature by feature" that you had multiple folders in the same project / assembly for Model, Infrastructure etc.

You also mentioned that you think really hard before creating new assemblies. While I agree excessive layering is bad, what is the difference between this approach and creating seperate assemblies for model & infrastructure.

It is more separation of concerns than needless complexity

Ayende Rahien
07/28/2009 01:15 AM by
Ayende Rahien

Venu,

More projects == slower VS

Jake Scott
07/28/2009 07:30 AM by
Jake Scott

This should be good cant wait!

Kyle Szklenski
07/28/2009 10:18 AM by
Kyle Szklenski

Also, venu, who says you can't have separation of concerns with a single assembly? I think having a decent folder structure that all developers involved understand and more importantly use can be just as effective. Just have to make sure no one crosses the line, and since there's only one developer on this right now. . .

Daniel
07/28/2009 02:17 PM by
Daniel

Looking forward to this series.

Frank Quednau
07/29/2009 07:27 AM by
Frank Quednau

Excel Macros...Hm, thank God I've never been sentenced to 77.1*850 years in prison, it would take even longer than expected!

Comments have been closed on this topic.