Use Cases and Database Modeling — An interview with Michael Blaha.
“ Use cases are rote work. The developer listens to business experts and slavishly write what they hear. There is little interpretation and no abstraction. There is little reconciliation of conflicting use cases. For a database project, the conceptual data model is a much more important software engineering contribution than use cases.“ – Dr. Michael Blaha.
First of all let me wish you a Happy, Healthy and Successful 2012!
Now, we look at Use Cases and discuss how good are they for Database Modeling. Hope you`ll find the interview interesting. I encourage the community to post comments.
Q1. How are requirements taken into accounts when performing data base modeling in the daily praxis? What are the common problems and pitfalls?
Michael Blaha: Software development approaches vary widely. I’ve seen organizations use the following techniques for capturing requirements (listed in random order).
— Preparation of use cases.
— Preparation of requirements documents.
— Representation and explanation via a conceptual data model.
— Representation and explanation via prototyping.
— Haphazard approach. Just start writing code.
General issues include
— the amount of time required to capture requirements,
— missing requirements (requirements that are never mentioned)
— forgotten requirements (requirements that are mentioned but then forgotten)
— bogus requirements (requirements that are not germane to the business needs or that needlessly reach into design)
— incomplete understanding (requirements that are contradictory or misunderstood)
Q2. What is a use case?
Michael Blaha: A use case is a piece of functionality that a system provides to its users. A use case describes how a system interacts with outside actors.
Q3. What are the advantages of use cases?
— Use cases lead to written documentation of requirements.
— They are intuitive to business specialists.
— Use cases are easy for developers to understand.
— They enable aspects of system functionality to be enumerated and managed.
— They include error cases.
— They let consulting shops bill many hours for low-skilled personnel.
(This is a cynical view, but I believe this is a major reason for some of the current practice.)
Q4. What are the disadvantages of use cases?
— They are very time consuming. It takes much time to write them down. It takes much time to interview business experts (time that is often unavailable).
— Use cases are just one aspect of requirements. Other aspects should also be considered, such as existing documentation and
artifacts from related software. Many developers obsess on use cases and forget to look for other requirement sources.
— Use cases are rote work. The developer listens to business experts and slavishly write what they hear. There is little interpretation and no abstraction. There is little reconciliation of conflicting use cases.
— I have yet to see benefit from use case diagramming. I have yet to see significant benefit from use case structuring.
— In my opinion, use cases have been overhyped by marketeers.
Q5. How are use cases typically used in practice for database projects?
Michael Blaha: To capture requirements. It is OK to capture detailed requirements with use cases, but they should be
subservient to the class model. The class model defines the domain of discourse that use cases can then reference.
For database applications it is much inferior to start with use cases and afterwards construct a class model. Database applications, in particular, need a data approach and not a process approach.
It is ironic that use cases have arisen from the object-oriented community. Note that OO programming languages define a class structure to which logic is attached. So it is odd that use cases put process first and defer attention to data structure.
Q6. A possible alternative approach to data modeling is to write use cases first, then identifying the subsystems and components, and finally identifying the database schema. Do you agree with this?
Michael Blaha: This is a popular approach. No I do not agree with it. I strongly disagree.
For a database project, the conceptual data model is a much more important software engineering contribution than use cases.
Only when the conceptual model is well understood can use cases be fully understood and reconciled. Only then can developers integrate use cases and abstract their content into a form suitable for building a quality software product.
Q7. Many requirements and the design to satisfy those requirements are normally done with programming, not just schema. Do you agree with this? How do you handle this with use cases?
Michael Blaha: Databases provide a powerful language, but most do not provide a complete language.
The SQL language of relational databases is far from complete and some other language must be used to express full functionality.
OO databases are better in this regard. Since OO databases integrate a programming language with a persistence mechanism they inherently offer a full language for expressing functionality.
Use cases target functionality and functionality alone. Use cases, by their nature, do not pay attention to data structure.
Q8. Do you need to use UML for use cases?
Michael Blaha: No. The idea of use cases are valuable if used properly (in conjunction with data and normally subservient to data).
In my opinion, UML use case diagrams are a waste of time. They don’t add clarity. They add bulk and consume time.
Q9. Are there any suitable tools around to help the process of creating use cases for database design? If yes, how good are they?
Michael Blaha: Well, it’s clear by now that I don’t think much of use case diagrams. I think a textual approach is OK and there are probably requirement tools to manage such text, but I am unfamiliar with the product space.
Q10. Use case methods of design are usually applied to object-oriented models. Do you use use cases when working with an object database?
Michael Blaha: I would argue not. Most object-oriented languages put data first. First develop the data structure and then attach methods to the structure. Use cases are the opposite of this. They put functionality first.
Q11. Can you use use cases as a design method for relational databases, NoSQL databases, graph databases as well? And if yes how?
Michael Blaha: Not reasonably. I guess developers can force fit any technique and try to claim success.
To be realistic, traditional database developers (relational databases) are already resistant (for cultural reasons) to object-oriented jargon/style and the UML. When I show them that the UML class model is really just an ER model and fits in nicely with database conceptualization, they acknowledge my point, but it is still a foreign culture.
I don’t see how use cases have much to offer for NoSQL and graph databases.
Q12. So if you don’t have use cases, how do you address functionality when building database applications?
Michael Blaha: I strongly favor the technique of interactive conceptual data modeling. I get the various business and
However, I fully consider the use cases by playing them against the evolving model. Of course as I consider use cases relative to the class model, I am reconciling the use cases. I am also considering abstraction as I construct the class model and consequently causing the business experts to do more abstraction in formulating their use case business requirements.
I have built class models this way many times before and it works great. Some developers are shocked at how well it can work.
Michael Blaha is a partner at Modelsoft Consulting Corporation.
Dr. Blaha is recognized as one of the world’s leading authorities on databases and data modeling. He has more than 25 years of experience as a consultant and trainer in conceiving, architecting, modeling, designing, and tuning databases for dozens of major organizations around the world. He has authored six U.S. patents, six books, and many papers. Dr. Blaha received his doctorate from Washington University in St. Louis and is an alumnus of GE Global Research in Schenectady, New York.