Skip Navigation LinksHome > SSW Standards > Better Software Suggestions > SSW .netTiers Suggestions

.netTiers is a set of open source code templates used in CodeSmith for object-relational mapping. It automatically generates a personnalized Data Tiers application (on a base of a SQL Server Database) in just a few minutes.

With the application it generated, you can manage data of a web application easily and efficiently. So It's a good tool for Website Maintenance.

In order to make it better, following points may help.

Do you agree with them all? Are we missing some? contact us with what you think.

  1. Add prefix before entity name
  2. Relate to a dual primary keys table
  3. Make it support pictures (binary fields)
  4. Support links to the child table, e.g. the OrderDetails table
  5. Change Date fields to use the normal MS AJAX date picker
  6. Add breadcrumbs (especially for child tables)
  7. When you click 'Edit', please disable the 'Add New' button
  8. Encourage people to use the command line to run the generation

  1. Add prefix before entity name

    Entities generated by NetTiers have the same names as their corresponding database tables. However, if the table name is equal to one of .Net Framework classes, e.g. Timezone, Visual Studio might raise compile errors. Because auto-generated namespace and System namespace are included and Visual Studio can't identify which namespaces the class should belong to. As a result, users have to revise the compile errors one by one. If the entity name is combined a prefix with the table name, most of the compile errors must be disappeared.

  2. Relate to a dual primary keys table

    It is such a complex work to collect all the relationships in NetTiers - one to one, one to many, many to many. If the table relationships are nested, the grid in the auto-generated page might be bound to a wrong data source.
    For example, there are 3 tables A, B and C. A has a primary key named 'KeyA', which is B's foreign key. B has a dual primary key 'KeyA' and 'KeyB'. C has a relationship with B based on 'KeyA' and 'KeyB'. In this condition, the databinding of C's page is incorrect.

  3. Make it support pictures (binary fields)

    The 'Picture' field is not rendered but a text 'System.byte[]' takes the place.

    'Picture' field not rendered properly
    Figure: 'Picture' field not rendered properly

    When I click 'Edit' button and then click 'Update' button, I got an error. Because the Text 'System.Byte[]' was bound to Image field.

    Error of updating Image Field
    Figure: Error of updating Image Field

    Moreover, when I want to add a new category, I cannot add a picture for it (e.g., select a picture and upload it).

    Can not add pictures
    Figure: Can not add pictures

    So please make it support pictures (view, add and update).

  4. Support links to the child table, e.g. the OrderDetails table

    It will be wonderful if there're links to child tables. For instance, sometimes I'd like to see order detail items of the first order just by clicking a link rather than go to OrderDetails page and search items with the order id.

    Add links to child table
    Figure: Add links to child table
  5. Change Date fields to use the normal MS AJAX date picker

    This would be good because we would always get the AJAX library included by default.

    Change Date fields to MS AJAX date picker
    Figure: Change Date fields to MS AJAX date picker
  6. Add breadcrumbs (especially for child tables)

    Without a breadcrumb, it's not convenient to go to previous pages and we don't know where exactly we are.

    Please add breadcrumbs, especially for child tables. E.g., Home > Orders > Order 123

    No Breadcrumb
    Figure: No Breadcrumb
  7. When you click 'Edit', please disable the 'Add New' button

    When you click 'Edit' button, you are going to edit a record. However 'Add New' button is still available. This is not proper.

    Please disable 'Add New' button when it's in Edit mode.

    'Add New' button is still available in Edit mode
    Figure: 'Add New' button is still available in Edit mode
  8. Encourage people to use the command line to run the generation

  9. When the generation is completed, it's better to encourage people to use a command line to do this generation as per rule Do you use code generators.

    E.g.,

    Tip: The command line to run this generation again is 'cs D:\DataDavidBian\Personal\New12345\NetTiers.csp'.
    You can also put this command in a Batch file (e.g., _Regenerate.bat) and double click it.
    Figure: How to encourage people to user command line

    With this command line, people do not bother to follow those steps to make this generation next time, instead just run the command line and the whole generation will be completed automatically. See our regenerate standard.

    Generation completed
    Figure: Generation completed

Acknowledgements

Adam Cogan