DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Use Case Exceptions

  1. #1
    news.devx.com Guest

    Use Case Exceptions

    Hello,

    I had a question about how much detail is necessary for alternative
    courses/exceptions.

    The use case I'm currently working on involves a user/group structure, and I
    have a use case that involves maintaining the group memberships. The issue I
    have is concerning the depth of the exception descriptions I should go into.

    If, when modifying a groups memberships, the database that the permissions
    are stored in goes down, the changes are not done. This is an exception, and
    to the user, would be stated as something like "Modify not performed due to
    database being down". But is it something that the user performing the
    modify should even know about?

    Thanks!

    Dan Slack



  2. #2
    MarkN Guest

    Re: Use Case Exceptions


    Depends on how you want the app to function and the overall design. If you
    are really doing OO I would tell the user the the changes couldn't be saved
    at this time. Try later or something like that.

    Now if you use something like MQ Series you can queue up the change if the
    database is down and tell the user the change will be may shortly.


    Mark


  3. #3
    Guy Smith Guest

    Re: Use Case Exceptions


    >If, when modifying a groups memberships, the database that the permissions
    >are stored in goes down, the changes are not done. This is an exception,
    >and to the user, would be stated as something like "Modify not performed


    >due to database being down". But is it something that the user performing


    >the modify should even know about?



    Dan,

    As a rule.. if you put an exception in the use case, then you can confirm
    that it is handled when you trace your use cases to what is implemented.
    If you don't you are likely to miss implementing the exception. So it is
    important to capture all exception paths but you want to do so at as high
    a level as possible.

    Say you have a use case in which the user enters an address and submits it
    to the system. Do you want to make an exception path for every specific
    occurance you can think of i.e. "invalid zip code", "invalid character in
    the name", "invalid state" etc? Probably not. You'll be writting exceptions
    for the next year. But since it is appropriate for the system to respond
    if invalid data is entered you need to capture this exception path. Capture
    it, but be generic... "If validation of user input fails, highlight the errors
    and allow the user to re-enter values". Notice that you are not specifying
    "how" to validate the input, only that you need to.

    If the database is down and the update cannot be accomplished, the user is
    definitely going to want to know it. Handle the exception but do it generically
    i.e. "If the update fails, inform the user an error occured and the update
    failed". Notice that this is "what" needs to be done.

    That said, there is nothing to keep you from having an exception path to
    specifically handle the database down error (although a "database" is more
    a "how" you are implementing your security). If it is a condition you want
    to ensure is handled when you trace your use cases to implementation then
    include it as it's own exception path. This is a good practice if the user
    specifically requests certain functionality. Going back to the address example,
    say the user asks you to *make sure* the zip code matches the state. Create
    an exception path for "zip code doesn't match state". Then, when you trace
    your use case to the implementation, you can ensure the user's requested
    functionality is implemented.

    Guy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center