An essential resource for Visual Basic (VB) programmers who want to develop applications that are both resilient and robust, Developing Applications with Visual Basic and UML describes a proven development process for designing and implementing object-oriented client/server applications in VB using the Unified Modeling Language (UML).
With the information and expert techniques presented in this book, readers can significantly enhance their Visual Basic programming skills as well as their overall understanding of how an effective development process impacts the quality of the final application.
1. The Project Dilemma.
The Project Dilemma.
The Synergy Process Model.
The Unified Modeling Language.
Visual Basic as an Industrial Strength Development Tool.
Visual Basic and the Concept of Object-Oriented.
Why the UML and Visual Basic?
Establishing the Project Charter.
The Sample Project.
The Process Model.
Finding the Pathways through the Use Case.
Shadow Use Cases.
Detailing the Happy Path.
Completed Process Orders Use Case.
Preparing the Preliminary Architecture.
Project Charter: Increments and Estimates.
Identifying and Categorizing Business Rules.
Creating the Class Diagram.
Identifying Attributes and Operations.
Finishing Up: The Analysis Model.
Building an Early Prototype.
Next Step of the Elaboration Phase.
The Sequence Diagram.
The Collaboration Diagram.
The State Diagram.
The Activity Diagram.
Selecting the Right Diagram.
Non-UML Extensions in the Design: Usage Matrices.
Next Phase of the Elaboration Phase.
Logical versus Physical Tiering.
Microsoft's Tiering Strategy.
Managing Transaction Scope within the Application and Microsoft Transaction Server.
Incorporating the Internet into the Solution.
Remulak Productions Execution Architecture.
Object-Oriented and Translating to the Physical Design.
Mapping Classes to Tables.
Mapping Simple Associations.
Mapping Inheritance to the Relational Database.
Mapping Aggregation and Composition to the Relational Database.
Mapping Reflexive Associations to the Relational Database.
Key Structures and Normalization.
Using a Visual Modeling Tool to Generate the Data Definition Language.
Stored Procedures and Triggers and the Object-Oriented Project.
Visual Basic Support of Data-Aware Classes.
The Data Translation Services and Data Access Services Layers.
Adding Code to Realize a Use Case Pathway.
Data Access Service Layer: DASVC Component.
Data Translation Service Layer: DTSVC Component.
Business Rule Service Layer: BRSVC Component.
Presentation Service Layer: UISVC Component.
Building Blocks for the Future.
Remote Solutions-Distributed Component Object Model.
Remote Solutions-Microsoft Transaction Server.
Use Case Points.
The Project Estimate.
Enhancements-Persistent and Transient Attributes.
Modifying Rational Rose-Persistent Attribute Setup.
Modifying Rational Rose-Running the Definition Script.
Modifying Rational Rose-Changing the Script to Recognize the Attribute.
Other Areas of Change.
What Does Object-Oriented Mean?
Object-Oriented-Right in Your Own Backyard.
By-Products of Object-Oriented.
No Silver Bullet.
COM at Work.
Visual Basic-Version Compatibility.
Use Cases-Use Case Details for Increment I.
Use Cases-Happy Path Task Steps.
Most software projects undertaken today don't come close to meeting their original goals or their estimated completion dates. My reasoning for this is that most project teams don't have a clue about what a development process is or how to customize one for a project's unique characteristics. In addition, most projects have little in the way of analysis and design artifacts to show how they got where they are. That is, projects traditionally lacked traceability.
Most authors of books on VB never consider it in "the large." Instead, they focus on the small view, filling the pages with nifty routines to load list boxes and call native Windows API functions. Although this view, too, is necessary, unfortunately no one seems to touch on project planning, software process, and the methodology for building enterprise-status VB applications. This is because it is a much more difficult topic to explore and present.
This book focuses on the most powerful approach available today to model and build industrial-strength VB applications: the Unified Modeling Language (UML) adopted in 1997 by the Object Management Group (OMG) as the standard for modeling object-based applications. With the UML, and a sound development lifecycle (which I introduce as the Synergy process in this book), VB projects can move closer toward predictable success, as opposed to the less desirable, luck-of-the-draw chances.
My career with computers began in 1979 when I began working on large IBM mainframe applications using technologies such as IBM's IMS and later DB2, what many of you today would call "legacy" applications. However, I prefer "heritage" or "senior" systems to "legacy." Not only did I learn about and work with some really great tools and super sharp people, I also learned the value of project planning and establishing a clear architecture and design of the target application. I saw this pay back in a big way as a sound process established a clear line of communication for the project team. More important, it provided the stepping stones for completing a successful project.
In 1990, I worked on a first-generation client/server application using Smalltalk on the OS/2 platform. This was the start of a new career path for me, and I was shocked by the "process" used to build "production" applications in the client/server environment. The planning was cavalier, as was the delivery of analysis and design artifacts (something that showed why we built what we built).
This pattern of "shooting from the hip" software development continued with my use of PowerBuilder and later VB. The applications delivered with these products worked, but they were fragile. I think that today many applications wear the "client/server" moniker when they are just as legacy as their mainframe counterparts, if not more so. Even worse, these became legacy applications a month or two after they went into production. The fault wasn't with the tool. Rather, it was with the lack of a sound process model and methodology that ensured that what got built was what the users actually wanted and that what got designed didn't fall apart the first time it was changed.
Slowly, I began to apply my own opinions about process and methodology to the applications built in the client/server environment. This worked quite well. The applications were more resilient and accepted change more easily, and the users typically had smiles on their faces.
This book combines all of my experience building client/server applications with the UML, which I feel is the best artifact repository for documenting the analysis and design of an application today. I hope that you will enjoy reading it as much as I enjoyed writing it.
This book is for anyone who wants to successfully build VB applications that can stand up over time. It provides an accurate road map for anyone to achieve the following goals.
Anyone building VB applications today needs this book.
Maybe it's best to start out with what you don't need to know to benefit from this book. First, you don't need to know anything about the UML. I present the essential aspects of the UML and, more important, how they relate to VB deliverables. Although the UML is expressed with nine separate diagrams, you will benefit the most from a core set.
Second, you don't need a formal background in object-oriented concepts. I discuss standard object constructs in the text and review many of these in Appendix C.
Third, you don't need to know COM or DCOM. I use both extensively throughout the book and cover some of the "plumbing" issues involved in Appendix D.
Finally, you don't need a formal understanding of the key technologies that surround MTS and the World Wide Web (Web). Each receives detailed treatment in the book.
This book does assume that you have a working knowledge of VB. Both the new VB programmer and the experienced VB programmer will benefit. However, I don't cover the basics of simple VB constructs, assuming that you already know these. If you have had no exposure to VB, buy this book anyway and open it after you have had some initial training in that programming language.
This book also assumes that you have experience with Structured Query Language (SQL) and with relational databases. Some exposure to Data Access Objects (DAO), Active Data Objects (ADO), and Open Database Connectivity (ODBC) would also help. The project used as a model in the book uses ADO exclusively with ODBC drivers.
Following is a summary of the book's chapters and contents.
This chapter reviews the current state of software development and my reasoning regarding why it's in the shape that it is today. It also reviews the concept of iterative and incremental software development and provides an overview of my Synergy methodology used as the guide in the book. It also touches on the primary components of the UML that will be covered in more depth later in the book.
This chapter covers some of the benefits that result from the adoption of VB as a development environment. It presents these in the context of VB's implementation of encapsulation, inheritance, and polymorphism. It then maps the UML to various VB deliverables. Highlights include mapping the UML class to VB class modules; mapping use case pathways to VB entity, interface, and controller types of classes; and mapping component diagrams to VB executables and DLLs and optionally to MTS.
This chapter explores the case study used in the book, Remulak Productions. This fictional company sells musical equipment and needs a new order entry system. It introduces a project charter, along with a tool, called the event table, to help quickly solidify the application's features. Further, the chapter maps events to the first UML model, the use case.
This chapter reviews the use case, one of the central UML diagrams. Included is a template to document the use case. Actors and their roles in the use cases are defined. The chapter reviews the concept of use case pathways, as well as the project's preliminary implementation architecture. Also reviewed is an approach to estimating projects that are built by using the use case approach.
This chapter explores the UML class diagram, the king of UML diagrams. It offers tips on identifying good class selections and defines the various types of associations. It also covers business rule categorization and how these rules can be translated into both operations and attributes of the class. Finally, it discusses the utilization of the visual modeling tool, Rose, as a means to better manage all UML artifacts.
This chapter reviews unique user interface requirements of each use case. It develops an early prototype flow and an eventual graphical prototype. Finally, it maps what was learned during the prototype to the UML artifacts.
This chapter discusses the dynamic models supported by the UML, exploring in depth the two key diagrams, often referred to as the interaction diagrams, sequence and collaboration. These are then directly tied back to the pathways found in the use cases. Other dynamic diagrams discussed include the state and activity diagrams.
This chapter covers the importance of separating logical services that are compliant with DNA. It explores technology solutions specific to the Remulak Productions case study, including distributed solutions using DCOM, MTS, and the Internet using HTML forms and ASP. Two scripting languages are used for the Internet portion of the applications.
This chapter explores the steps necessary to translate the class diagram into a relational design to be supported by both Microsoft SQL Server and Oracle databases. It offers rules-of-thumb regarding how to handle class inheritance and the resulting possible design alternatives when translating the class diagramto an RDMBS. It also explores VB's support for data-aware classes, as well as the importance of a separate Data Translation Services layer that contains the SQL logic related to each class.
This chapter finalizes the design necessary to implement the various layers of the application. It also presents the communication mechanism utilized between the layers and possible alternatives. Each class is delegated to one of three types: entity, interface, or control. These are used as the basis for the design implementation and as the solution to providing alternative deployment strategies.
This chapter explores the issues of generating VB code directly from the class diagram, again using Rose. It reviews the setup steps necessary to make the process go smoothly and discusses the importance of the entire process of round-trip reengineering, along with a process to ensure that it happens.
This chapter fills in the body of the VB class stubs generated in the previous chapter, focusing on a single pathway through a use case. It also presents all of the code necessary to make it a reality, from the user interface to the back-end.
This chapter uses the solutions built in Chapters 12 and 13 to explore the necessary steps to deploy it on various server configurations. It covers all of the tasks necessary to ensure a successful DCOM implementation, including using the deployment wizard and using various utilities to ensure that both the client and server are correctly set up.
I have the good fortune to work with top companies and organizations not only in the United States, but also in Europe, Asia, and South America. In my many travels, I am always coming across inventive ideas regarding how to use and apply the UML to build more-resilient applications that use not only VB but also C++ and Java. Please visit my Web site at www.jacksonreed.com, where you can get the latest on the training and consulting services that I offer, as well as all of the source code presented in this book. I welcome your input and encourage you to contact me at firstname.lastname@example.org.