UML Modeling for Java with Rhapsody
by Peter Varhol01/25/2001
While there are sophisticated development environments and tools for building Java applications, including some good visual tools (IBM's VisualAge comes to mind), most of them are geared toward specific tasks in the development process, usually writing code. For most Java developers, there's no inherent connection between designing software systems and writing code.
I-Logix's Rhapsody changes the developer's point of view from writing code, or assembling software components, to modeling the system to be built. The design methodology it incorporates is the Unified Modeling Language (UML). UML is based on OMT, Booch, OOSE, and other earlier modeling techniques that by themselves only modeled a single aspect of the system. UML diagrams are able to represent unambiguously all aspects of the system being built.
Rhapsody is unique in that it builds Java applications visually but not in the same sense as VisualAge or Visual Café. Instead it uses a type of visual programming that translates detailed, formal graphical models based on UML directly into Java code.
UML provides a combination of visual modeling techniques that unambiguously describe a software system. These views describe the system's architecture, behavior, and component collaboration. Once these views are created, you can generate high-level code or executables that correctly reflect the software design.
UML defines a number of views that provide different perspectives of the system under development. Each view shows a different aspect of the full software model, and each is necessarily incomplete. Think of it like three dimensional photography. To get a complete picture of a car, for example, you have to photograph it from a number of different angles and perspectives. UML offers a total of nine views of a model, including class diagrams, Statecharts, use-case diagrams, and sequence charts. Not all are needed to represent unambiguously every software system, often three or four are sufficient.
UML and Rhapsody
Rhapsody in J (I-Logix offers implementations of Rhapsody for generating Java, C++, C, and Ada) provides more than just an environment for developing Java code. It's a visual design environment that enforces a comprehensive methodology for building formally correct system models. Like most UML design tools, it lets you build formal models that prevent ambiguities and illogicalities. Unlike others, it takes those designs and creates Java code that implements the UML design.
Compiling a UML model into Java code works in two parts. First, Rhapsody checks the model's syntax and to a certain extent its semantics. This is possible because the model should be logically consistent; the editor doesn't allow things that are illegal in the modeling language. It can also do some checking for internal consistency, primarily to make sure that the model as represented by one diagram coheres with any related diagrams.
Once the model is verified, the next step is to produce Java code. This works through a mapping between UML constructs and Java classes derived from the Java class library. What results from this process is a software implementation that uses the standard Java object model.
Rhapsody includes an editor for four different diagram types: sequence, object model, use case, and statecharts. Rhapsody diagrams are combined into one model, ensuring consistency across the different views. You can inspect the entire model or automatically review it for consistency and syntactical accuracy.
Figure 1. Use cases are a structured way of describing the behavior of an embedded system. (Click for full-size view) |
A good place to begin a Rhapsody design with UML is with use cases (see Figure 1 for an example). As the name implies, a use case is a structured way of describing the desired behavior of a system. Think of a use case as an entire class of examples. Individual variations of the class are called scenarios. Scenarios may help users accurately describe the requirements of the system, but they're not necessary to the design process.
A statechart joins behavior to architecture, very similar to an old-fashioned state transition diagram. Statecharts have additional structure and constraints so that they unambiguously define the movement from one state to the next. Anyone who has worked with state transition diagrams or even finite state machines will grasp the statecharts quickly (Figure 2).
Figure 2. A statechart is very similar to an old-fashioned state transition diagram. (Click for full-size view) |
Object modeling diagrams join architecture to collaboration. They have an architectural aspect because your code will likely be built along the lines indicated by the objects you define, even if you don't use code generation or object-oriented programming languages. And they have a collaborative aspect because properly designed objects are intended to pass messages to one another. Sequence diagrams illustrate the way different components of a system collaborate. They show the flow of data and control between different aspects of the system as the application executes.
Using these four for moderately simple (but not trivial) applications will probably take a novice from three to four days, most of which will be spent learning UML and the software. Once you've gained experience, you can expect your productivity over manual coding to improve by about fifty percent. For those who want to incorporate existing Java code, or rewrite some of the generated code manually, Rhapsody in J can encapsulate changes to the code, incorporate them back into the model, thus keeping the model and code synchronized.
If you need to pursue system views beyond these four, you must look elsewhere for tools, possibly committing to the entire Rational Unified Process. Using all nine UML views is probably most appropriate for complex and highly interactive software systems. But Rhapsody in J lets software designers use UML as a higher level of abstraction for developing Java code without the overhead of full UML.
Many modeling tools generate code. The value of Rhapsody is its use of a widely accepted, formal modeling language as the basis for design, and in a unique ability to incorporate code written by hand into the model. Software developers actually get to be software designers, while delegating the implementation to an automated process. The model also serves as excellent documentation of the implemented system.
Computer science educators (a job I once did) perennially espouse the virtues of designing software over coding, yet in many cases in real life designing takes a back seat to getting the application out the door. Modeling tools such as I-Logix Rhapsody force developers to do just what they should be doing. And in so doing, it removes the potential for errors in translating designs into actual code.
I-Logix markets Rhapsody in J to embedded systems developers, who have embraced both Java and UML more completely that general-purpose application developers. However, developers who are interested in spending most of their time designing software rather than writing code will benefit from the Rhapsody approach.
发表评论
-
perl
2007-11-07 05:36 838http://www.xlab.net/jochen/perl ... -
unix shell.
2007-08-21 20:51 1079标题: ... -
diplompruefung
2007-08-02 20:05 843Allgemeine VWL I für WiWis [W ... -
GUI
2007-07-13 05:08 906 -
Statechart diagram
2007-07-13 04:50 1848A statechart diagram shows the ... -
Statecharts
2007-07-13 04:39 993Statecharts Many situations req ... -
Building a Statechart Diagram
2007-07-13 04:33 1701Building a Statechart Diagram T ... -
State Chart XML (SCXML): State Machine Notation for Control
2007-07-13 04:12 1632State Chart XML (SCXML): Stat ... -
Diplomarbeit Writting Materials
2007-07-05 20:09 1299Designing a soft ... -
diplomarbeit
2007-06-10 21:32 3465UML. class , interface, re ...
相关推荐
Java Modeling in Color with UML--printed in color--provides four UML "archetypes" for common entities in business modeling. These have rather abstract names like the moment-interval. Each archetype is...
《Java Modeling in Color with UML》是一本深入探讨在Java开发中如何利用统一建模语言(UML)进行系统设计的书籍。UML作为一种强大的可视化建模工具,它能够帮助开发者清晰地表达软件系统的结构、行为和关系。本书...
根据提供的文件信息,本文将围绕“UML for Java Programmers中文版”这一主题展开,深入探讨UML在Java编程中的应用及其重要性。 ### UML简介 统一建模语言(Unified Modeling Language,简称UML)是一种图形化表示...
标题《Java modeling in color with UML》和描述表明了本书是一本关于使用颜色和统一建模语言(UML)进行Java建模的专业书籍。它强调了颜色在建模过程中的重要性,并由权威人士Peter Coad撰写。书中的核心概念是...
UML Modeling with Visio is a zip file which cantained two parts of a series article introducing how to use Visio, it is one of best document to learn UML with Visio for newer.
### UML for Java Programmers — 关键知识点解析 #### 一、UML概述 - **UML (Unified Modeling Language)** 是一种标准化的图形语言,用于软件系统的可视化建模。它帮助开发者理解系统的需求、设计、实现和测试...
Modeling Web Application Architectures with UML
Business Modeling with the UML and Rational Suite AnalystStudio ------------------------------------------------------ A Rational Software White Paper
面向对象分析和设计以及统一过程是软件工程领域的重要概念,而UML(统一建模语言)作为其可视化建模的重要工具,已经在业界广泛应用。本篇文档介绍了如何使用Enterprise Architect这一UML建模工具进行面向对象的软件...
### UML for Java Programmers中文版-无密码 #### UML概述 ...以上只是《UML for Java Programmers》这本书中涉及的部分知识点,通过对这些概念的学习,Java程序员可以更好地理解和应用UML来进行系统建模。
《UML for Java》这本书由Robert Cecil Martin撰写,是针对Java程序员学习统一建模语言(Unified Modeling Language,简称UML)的一本指南。UML是一种用于软件工程的标准建模语言,它提供了一套图形化的符号系统,...
### UML for Java Programmers知识点总结 #### 一、UML概述 - **UML** (Unified Modeling Language) 是一种标准化的图形表示方法,用于软件系统的建模。 - **类图**(Class Diagram): 描述系统中的类以及它们之间的...
•Uses friendly, easy-to-understand For Dummies style to help readers learn to model systems with the latest version of UML, the modeling language used by companies throughout the world to develop ...
IBM Pattern Modeling and Analysis Tool for Java,简称为GA,是一个专门针对Java Garbage Collector(GC)进行性能分析和诊断的专业工具。这款工具由IBM开发,旨在帮助Java开发者和系统管理员深入理解JVM内存管理...
Slides on Modeling systems with UML.