250 likes | 352 Views
Inside UML. CS6961 – Lecture 15 Nathan Dykman. Administration. Grading Started Please get in HW4, if you haven’t already. Okay, topics of discussion coming up: QA, Testing and Release Engineering Metrics Reverse Engineering of Complex Systems Real World Examples MDA and SOA
E N D
Inside UML CS6961 – Lecture 15 Nathan Dykman CS 6961 - Lecture 15
Administration • Grading Started • Please get in HW4, if you haven’t already. • Okay, topics of discussion coming up: • QA, Testing and Release Engineering • Metrics • Reverse Engineering of Complex Systems • Real World Examples • MDA and SOA • Refactoring • Did I miss anything? CS 6961 - Lecture 15
Today’s Lecture • Today: I’m going to give you a peek behind the UML curtain • Give you an idea of how UML is put together CS 6961 - Lecture 15
UML Worries • The main question people ask after dealing with UML after a while is: “Why it is so complicated?” • I’m sure you have some of these kinds of questions • Examples? • This lecture hopes to explain some of the complexity CS 6961 - Lecture 15
UML: Incompleteness • The major part that throws people is that UML allows incomplete models • But, in some cases, complete information must be provided. (Example?) • Some view this as a major shortcoming • It is a shortcoming, but not as big as it seems. • But is incompleteness really bad? • Think about regular code files here. CS 6961 - Lecture 15
UML: Incompleteness • The hard part about UML is that you can’t just save a model in “any old state” • There is work on this, actually. • But, most tools disallow some kinds of invalid models to be created • But, not all. A model can be semantically incorrect, but still created in a tool. • Why? CS 6961 - Lecture 15
UML: Ambiguity • One constant annoyance in UML is that if something isn’t there, doesn’t mean it isn’t somewhere. • What’s worse, in some cases, missing information “assumes” default values, in others, it is merely “unspecified” • The rule is to assume the least possible • This works in most cases, but not all. CS 6961 - Lecture 15
Class Example CS 6961 - Lecture 15
UML: Ambiguity • This problem comes from a subtle part of UML. Diagrams aren’t models. • A diagram is merely just a view on a model. A model is complete. • Why is a diagram just a view on a model? • Programming languages don’t do this, right? • So, we can view the previous example as three different views on a single class. • In the model, there is one class CS 6961 - Lecture 15
UML: Ambiguity • The problem is made a more difficult in that there is diagrams are the only UML syntax that tools provide • This made worse by the standard XML format of UML (XMI) • To my mind: XMI is pretty broken • The latest versions may help address this • But there are too many versions to deal with in the first place. CS 6961 - Lecture 15
Modeling Future • In the future, it is likely UML and other modeling languages will require better textual formats as well as visual syntax • There is already a standard “human-usable” format that looks more like code • Sadly, very little support for it. • Some tools provide a data-grid like editors. • But, we need things like XML, Relational Schemas, etc. CS 6961 - Lecture 15
UML: Complexity • Another major complaint about UML, is well, there is sure a lot of it • I agree with this. UML could lose some bulk • Main problem is nobody can really agree on what to cut, and everybody has something they want to add • UML in the middle of the “second-system” effect • Hopefully, feature set will shake out with more use CS 6961 - Lecture 15
UML: Complexity • Of course, just because it’s there, doesn’t mean you have to use it • In many cases, a large part of UML is for specialized audiences • Some talk of making a xUML language for these advanced bits • Strive to use the smallest subset that does the job • But don’t reinvent the wheel either. CS 6961 - Lecture 15
UML: Complexity • As model-driven development moves forward, hopefully the complexity will start to pay off • More complex code generation • Direct model execution or interpretation • Better integration with languages • For now, certain domains benefit the most • Telecommunications, embedded real-time are the best examples. CS 6961 - Lecture 15
Behind The Curtain • One common benchmark on computer languages is “can it describe itself” • Some languages make this dead easy (Scheme) • Others, more complex (Perl Compiler in Perl) • This “benchmark” has major drawbacks • “Little languages” (Domain specific programming languages) suffer in this area. CS 6961 - Lecture 15
The UML Metamodel • UML is used to describe UML. • Well, in reality, it’s more complex than that • Only a small subset of UML is used currently • Restricted class diagrams • Object Constraint Language (which has a metamodel as well) • Metamodeling still an area of research and development • My PhD work lives in this space, for example • EMF from IBM, Corona from Microsoft CS 6961 - Lecture 15
Metamodel Example CS 6961 - Lecture 15
Metamodel Example • As you can see, the metamodel really isn’t fit for normal consumption • Certain parts of the metamodel are much more complex than this • You have to learn how to “read the runes” • However, the UML metamodel is the core what is legal and illegal UML • What can relate to what, what contains what, the data, etc. CS 6961 - Lecture 15
Metamodel Example 2 CS 6961 - Lecture 15
Metamodeling • After seeing these models, I hope you feel a bit better about your class models • I mean, I could make you do this kind of thing. • Really. I did it, so you can too… Right? • Of course, these models aren’t example of “real-world models” • They have a very specific purpose. • “Real world” models much closer to code. CS 6961 - Lecture 15
UML: Extensibility • UML was built to be extended. • For most people, it is enough to know that there is a thing called a “stereotype” • An a collection of stereotypes is a “profile” • This should work for you as well • But UML can be extended in much more powerful ways (tool support missing) CS 6961 - Lecture 15
UML, DSMLs, Extensiblity • Microsoft’s new initiative focuses on “Domain Specific Modeling Languages” • Part of Visual Studio 2005 modeling tools is a toolkit for building new modeling languages • Codenamed Corona, now just part of VS 2005 • Keep a eye on this (It’s really cool) • UML, Eclipse/Java community will get shaken up by this, I think CS 6961 - Lecture 15
UML Deconstructed • Trust me when I say we can have a class just on the future of modeling, DSMLs, advanced model development… • Well, I hope so, because… • It’s a planned seminar next semester (CS 7940-00x, TBA) • Prof. Kessler likely to be the official instructor • I’ll be lucky to TA a 1000 level class after this… CS 6961 - Lecture 15
UML Seminar • Open to all that took this class • This includes seniors as well • If you’ve never taken a seminar, I encourage it highly! • Much different than this class • One credit hour: You must present a paper to the class (Suggested papers will be available) • Three credit hours: Independent project subject to my approval (limited to 2 students) CS 6961 - Lecture 15
Coming Up • An assortment of topics of interest to you • Or, pick your instructors brain. • Again, if you have any other suggestions, let me know. • Also, look for HW5 this week! CS 6961 - Lecture 15