Eclipse og RSM en god IDE? Versjon 060208 med foiler også av Andreas Limyr og Gøran K. Olsen 6-Feb-06 INF2120 Prosjekt i modellering 1
Eclipse plattformen Eclipse is a kind of universal tool platform - an open extensible IDE* for anything and nothing in particular. www.eclipse.org *Integrated Development Environment 6-Feb-06 INF2120 Prosjekt i modellering 2
Eclipse plattformen En åpen plattform Open Source prosjekt som støttes av store aktører (bl.a. IBM, Oracle, Intel, HP og Ericsson) Plattformuavhengig og kan lastes ned til Linux, Windows, Mac ++ Skrevet i Java Gir mulighet til rask utvikling av plattformuavhengige verktøy Godt egnet til Java-programmering 6-Feb-06 INF2120 Prosjekt i modellering 3
Bruk av Eclipse For å starte Eclipse på ifi brukes kommandoen eclipse Ved oppstart blir du bedt om å velge en workspace. Dette blir området for de filene du kommer til å jobbe med når du bruker Eclipse Du møter så en velkomstsside der man kan lære litt mer om Eclipse. Bruk gjerne litt tid på å kikke på det. For å komme i gang trykker du på Workbench 6-Feb-06 INF2120 Prosjekt i modellering 4
Eclipse Workbench 6-Feb-06 INF2120 Prosjekt i modellering 5
Bruk av Eclipse Det finnes mange begreper i Eclipse; de viktigste er: View En måte å fremstille informasjon eller ressurser på Editor Et området for å manipulere data (f. eks en tekst editor) Perspective En sammensetning av view og editor (f. eks Java perspective) Har også betydning for hvilke knapper som er tilgjengelig på toolbars 6-Feb-06 INF2120 Prosjekt i modellering 6
Java-programmering i Eclipse Har alle laget og kjørt et Java-program under Eclipse? 6-Feb-06 INF2120 Prosjekt i modellering 7
Eclipse plattformen består av Kjernen Selve plattformen med grafikk, filbehandling, runtime og en del andre ting Java Development Tools (JDT) Støtte for å drive med Java utvikling i Eclipse Plug-In Development Environment (PDE) Støtte for å drive med Eclipse plug-in utvikling Dette får du når du laster ned Eclipse JDT og PDE er begge plug-ins som følger med Eclipse SDK 6-Feb-06 INF2120 Prosjekt i modellering 8
Plug-ins Det kan virke som Eclipse ikke kan brukes til annet enn å programmere i Java Og uten plug-ins er det (nesten) bare det du kan bruke den til Plug-ins er byggeklossene for å skreddersy plattformen så den passer akkurat ditt behov Du kan lage dine egne plug-ins 6-Feb-06 INF2120 Prosjekt i modellering 9
Plug-ins 6-Feb-06 INF2120 Prosjekt i modellering 10
Plug-ins Det finnes mange plug-ins som kan lastes ned Eksempler på plug-ins som kan lastes ned er: Støtte for utvikling med andre språk (c/c++, php, perl,cobol) WYSIWYG html editor Modellerings verktøy Feilsøkningsverktøy Spill Og det kommer stadig nye ting Dere skal bruke en sekvensdiagram plug-in (SeDi) 6-Feb-06 INF2120 Prosjekt i modellering 11
Installere plug-in Det er to hovedmåter å installere plug-ins på: Bruke den innebygde installeringen i Eclipse Eclipse har en innebygd hjelper til nedlasting og installering av plug-ins Laste ned plug-in manuelt Man laster ned en plug-in fra et sted og pakker den ut i plugins mappen til Eclipse Etter å ha installert en plug-in må man alltid restarte Eclipse før den registrerer installasjonen 6-Feb-06 INF2120 Prosjekt i modellering 12
Sekvens Diagram Editor plug-in Laget i forbindelse med Andreas Limyrs masteroppgave nå jobber Andreas på Sintef og lager programmer på Eclipse... SeDi er en del av framtidas Ifi-UML Total et samlet verktøy for bruk og eksperimentering med UML på Ifi SeDi er et første eksempel på hva en plug-in er SeDi støtter sekvens diagrammer i UML 2.0 Guider for installering og bruk ligger ute på hjemmesiden til kurset 6-Feb-06 INF2120 Prosjekt i modellering 13
Sekvens Diagram Editor plug-in Laget med utgangspunkt i en annen plug-in til Eclipse som heter GEF (Graphical Editing Framework) Rammeverk for å lage grafiske editorer Inneholder en egen grafikkpakke draw2d Dere skal installere den for å kunne bruke sekvens diagram editoren En klikk og dra editor med mange av figurene til UML 2.0 sekvens diagram 6-Feb-06 INF2120 Prosjekt i modellering 14
Sekvens Diagram Editor plug-in sequence diagram navigator same project diagrams 6-Feb-06 INF2120 Prosjekt i modellering 15
Eclipse ressurser Eclipse Help Innebygd i Eclipse www.eclipse.org offisiell hjemmeside http://eclipsewiki.editme.com/ - laget for og av brukere av Eclipse Installasjonsguide for SeDi er lagt ut på: http://www.uio.no/studier/emner/matnat/ifi/inf2120/v06/undervisni ngsmateriale/inf2120-sediinstallationguide-060206.pdf 6-Feb-06 INF2120 Prosjekt i modellering 16
IBM Rational Modeler / Architect 6-Feb-06 INF2120 Prosjekt i modellering 17
RSM at Ifi 2006 Linux rsm& hvis ikke dette virker, gi beskjed hvilken maskin dere er på Windows XP installér fra CD dette blir en image fortsett installasjonen derifra Utfør software update!! dette tar tid! Gjør det over natta! Husk å sette opp extension location der man kan legge plugins og features Alle skal være oppegående på RSM før Delleveranse 1 6-Feb-06 INF2120 Prosjekt i modellering 18
Extension Location Creating an extension location works under both the 3.0.x and 3.1.x releases of eclipse, under both linux and windows (and I assume all others). The steps to accomplish this under linux are as follows: As root, I install eclipse to /opt/eclipse As myuser, I create the directories ~/eclipse-config ~/eclipse-config/eclipse ~/eclipse-config/eclipse/features ~/eclipse-config/eclipse/plugins ~/eclipse-config/workspace I edit ~/eclipse-config/eclipse/.eclipseextension to contain: name=my Eclipse Configuration id=my.eclipse.configuration version=1.0.0 As myuser I install plugins/feature to ~/eclipse-config/eclipse (manually or through eclipse update mechanism after step 6 completed) As myuser, I start eclipse like "/opt/eclipse/eclipse -data /home/conway/eclipse-config/workspace -vmargs -Xmx512M" In Help->Software Updates->Manage Configuration... I "Add an Extension Location" to ~/eclipse-config/eclipse. The setting for this ends up being stored in ~/.eclipse 6-Feb-06 INF2120 Prosjekt i modellering 19
UML Model A UML model is a collection of UML elements, diagrams, and data such as relationships and requirements information, that describe a real-world system. A software architect uses UML to build models that describe the quantifiable characteristics of a system such as the: System's structure Behaviour Constraints Dependencies 6-Feb-06 INF2120 Prosjekt i modellering 20
Components of a UML model Model elements Diagram elements Diagrams 6-Feb-06 INF2120 Prosjekt i modellering 21
Model elements The building blocks of a UML model are called model elements. Model elements are the data representation of a real world object, actor, or system. 6-Feb-06 INF2120 Prosjekt i modellering 22
Diagram elements A UML diagram contains diagram elements (sometimes called shapes) These shapes are diagrammatic representation of model elements Diagram elements are not considered part of the (semantic) model 6-Feb-06 INF2120 Prosjekt i modellering 23
Diagrams A UML diagram describes the quantifiable aspects of a system that can be visually described Such as: Relationships, behavior, structure, and functionality For example, a use case diagram describes the interactions between the users of the system, called the actors, and the system 6-Feb-06 INF2120 Prosjekt i modellering 24
IBM Rational Software Modeler Provides a flexible development environment for creating and editing UML models. You can use the Model Explorer view to edit the source code and model structure of the semantic model. You can use the diagram editor to edit the visualized model. When you edit models, you should understand the differences between model elements and diagram elements. For example, when you right-click an element in the diagram editor, there are two delete options. If you click Delete from Diagram, the element is deleted from the diagram only, because the diagram element is only a visualization of a model element. Conversely, if you click Delete from Model, the element is deleted from both the model and the diagram. 6-Feb-06 INF2120 Prosjekt i modellering 25
Eclipse platform workbench Java Perspective 6-Feb-06 INF2120 Prosjekt i modellering 26
Eclipse platform workbench Modeller Perspective 6-Feb-06 INF2120 Prosjekt i modellering 27
Create a new project From File menu choose : 1. New 2. Project 3. Modeling 4. UML Project 6-Feb-06 INF2120 Prosjekt i modellering 28
Model Editor 6-Feb-06 INF2120 Prosjekt i modellering 29
Creating a new class diagram 1. Right-click your model 2. Add Diagram 3. Class Diagram 6-Feb-06 INF2120 Prosjekt i modellering 30
Adding a class to your model (1) Classes can be added from the Model explorer field: 1. Right click your new class model 2. Add UML 3. Class 6-Feb-06 INF2120 Prosjekt i modellering 31
Adding a class to your model (2) From the Palette on the right side of your screen: 1. Left-click the class icon 2. Left-click or click and drag in the editor 3. Enter the name of the class 6-Feb-06 INF2120 Prosjekt i modellering 32
Adding a class to your model (3) Or simply hold the mouse still in the editor: 1. A menu will appear 2. Choose what element you want to create 3. Enter element name 6-Feb-06 INF2120 Prosjekt i modellering 33
Adding attributes and operations to your class Attributes and operations can be added in different ways: 1. By holding the pointer over the class element for some seconds 2. Right-clicking the class in the Model Explorer view 3. Right-clicking the class element in the diagram 6-Feb-06 INF2120 Prosjekt i modellering 34
The Property view Every element in a diagram has properties A class can be public, protected or private Associations have multiplicity, roles, types A diagram has name and a type: DomainACSys <> class We have the property tab / view Let s look at the association property view 6-Feb-06 INF2120 Prosjekt i modellering 35
Association property view 1. Click once at the association between two classes 2. Choose the property tab 3. Here we can change the roles, label and the multiplicity of an association 6-Feb-06 INF2120 Prosjekt i modellering 36
Composite Structure Right-click class in Model Explorer Add diagram Composite structure diagram The classes from the class diagram is now included (if any composition) Hold mouse on diagram element to create port or connector, (as shown) 6-Feb-06 INF2120 Prosjekt i modellering 37
Smart things to remember Window, Reset perspective: The workbench returns to its default view. Fast view. Drag the view to the right bottom of the screen. Then you can look at it with a simple click. When you click somewhere outside the view, it closes. Restore a fast view by dragging it back into the workbench. Double-clicking a tab maximises the view, again back to normal Help menu wasn t made just for fun! Tutorials and samples: A good place to start! 6-Feb-06 INF2120 Prosjekt i modellering 38
In Rational Software Modeler (Class+struct.) model explorer model composite structure classes parts / properties operations (behaviors) diagrams 6-Feb-06 INF2120 Prosjekt i modellering 39