Aside

Your Application is CRUD!

How many times have you heard that a tool will save you heaps of time because it automatically generates some sort of CRUD layer for you? Depending on how good you’ve been for Santa you could get a generated data layer, service layer or even an entire application. Great! More time for coffee!

Well, yes and no.

Most of the CRUD frameworks organise themselves around the concept of creating, reading, updating and deleting a record in a database table. Administrative functions that exist to keep the actual line of business operations ticking over tend to fit this scenario perfectly. So now we have a bunch of frameworks and tools that can help us generate our generic record administration (users, customers etc) and reference data maintenance modules. What about the rest of the application?

Deciding to develop a CRUD Orientated Application (I can’t believe I just coined the acronym “CRUDOA”) lets you off the hook with regards to many important design decisions. You don’t have to care about user experience or business process improvement, because your approach has already been decided. One thin facade around the database coming right up!

Most business users are concerned with performing business functionality. This usually takes the form of some sort of operation or work flow step that forms part of a larger process. They don’t care whether the operation creates a record in 1 table or 40. This is usually where the aforementioned business process improvement and user experience analysis is required to make sure that your users don’t end up throwing their monitors through the window in frustration.

Obviously if you have any desire to avoid having rotten fruit pelted at you by disgruntled users then you’re going to want to put some thought into how they use the system. A generated framework that only has one paradigm (that of editing a row in a database table) greatly restricts your ability to do this. This effectively puts a generated CRUD layer out of the running for any part of the system that is not solely concerned with record maintenance. Then again if you’re a developer working on Toad or SQL Server Management Studio then your entire system may consist of record maintenance, and you can probably stop reading this post as large portions of your system will be orientated around exactly that.

So if the real meaty bits of line of business applications are not suited to CRUDOA then why are we constantly looking for ways of aligning our architecture along that path? Why would be use a CRUD data access layer if we rarely perform CRUD operations? Why would we generate a CRUD service layer and UI to feed into that CRUD data layer if it’s not a suitable paradigm?

We do this because the tools generate the code for us, and generated code is awfully tempting to use. After all, it’s sitting right there and all you had to do is press a button to get a large section of functionality for free. Only it’s not actually free, because our requirements often force us to stray from the golden path offered by the CRUD tools, meaning we then have to spend a large portion of our time trying to shoe horn a domain operation or cross entity transaction script into a CRUD approach.

The good news is that a lot of the tools only generate CRUD as a default. There’s no reason you can’t create an operation-orientated Rails site. You also don’t have to accept the default SQL that is generated by your favourite data access layer. The defaults may be attractive at first, but unless we’re happy to stay on the golden path (and end up with a mediocre application that has no user buy-in) we are going to waste time trying to stick a square peg into a round hole by modifying the CRUD framework to be, well, not CRUD.

About Garry

I'm a Solution Architect living in Perth, Western Australia. I work primarily with Microsoft technologies, but I have an open mind and like to branch out into other areas in my spare time. I'm also a Microsoft Virtual Technology Solutions Professional (VTSP) in the Integration space and like to stay active in the local development community.

,

11 Responses to Your Application is CRUD!

  1. Daniel April 27, 2008 at 3:03 am #

    You’d better put up a definition of CRUDOA on c2.com’s wiki.

  2. Garry April 27, 2008 at 3:20 am #

    I’ve submitted it to OASIS. I’m expecting a phone call any day now to get ratification of the standard. I’m going to be pretty busy over the next few months defining the CRUD* extensions, such as “Reliable Mimicry of MS Access” and “Secure Editing of Data in SQL Management Studio”.

  3. Daniel April 27, 2008 at 5:11 am #

    Oh, and the CRUD-Reliability – tranactionality over phpMyAdmin and MySQL

  4. Garry April 27, 2008 at 5:23 am #

    Yeah, that one starts off with “Take out a pen and paper and write down the old values from the phpMyAdmin table view. If you make a mistake, you can change the new values back to the old ones you wrote down previously. If you are performing a cross-system transaction and wish to maintain transactional integrity then you may wish to use two pieces of paper and two browser windows, one for each system. That way you can ensure a rollback is performed in an appropriate manner.”. Pure genius!

  5. Minecraft Update June 8, 2013 at 11:19 am #

    Does your blog have a contact page? I’m having problems locating it but, I’d like to shoot you an e-mail.
    I’ve got some ideas for your blog you might be interested in hearing. Either way, great blog and I look forward to seeing it develop over time.

  6. points totally free July 22, 2013 at 6:09 am #

    It’s perfect time to make a few plans for the long run and it is time to be happy. I’ve read this put up and if I may I wish to recommend
    you some fascinating things or tips. Maybe you could write next articles referring
    to this article. I wish to read even more things approximately it!

  7. Embroidery Services July 29, 2013 at 3:08 pm #

    Have you ever thought about writing an e-book
    or guest authoring on other sites? I have
    a blog based on the same subjects you discuss and would love to have you share some stories/information.
    I know my viewers would appreciate your work.
    If you’re even remotely interested, feel free to shoot me an e mail.

  8. Bret July 30, 2013 at 6:09 pm #

    Wow, awesome blog format! How long have you ever been running a blog for?
    you make blogging look easy. The full glance of your website is magnificent, as smartly as the content
    material!

  9. Louisville Air Conditioning Installation August 7, 2013 at 2:26 am #

    Hey would you mind letting me know which web host you’re utilizing? I’ve loaded
    your blog in 3 completely different web browsers and I must say this blog loads a
    lot faster then most. Can you suggest a good internet hosting provider at a reasonable price?

    Kudos, I appreciate it!

  10. mobile games.net April 11, 2014 at 10:30 pm #

    Hello to every body, it’s my first pay a visit of this web site; this blog consists of
    awesome and in fact good information in support of visitors.

  11. moviestarplanet hack iphone September 2, 2014 at 6:26 am #

    At first I found the right moviestarplanet hack way, welcome to
    enjoy their vacant time playing exciting
    games at affordable prices. They offer mobile games and install these
    and other devices to make any sense. These free time package of fun to play games on it.
    However, games are released ever moviestarplanet hack so often. Mobile technology has given a very simple, but the one and start your creative ‘juices’ flowing using the Java script.

    So there is to get free from Dertz.

Leave a Reply