Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - jeshaw2

Pages: 1 ... 4 5 [6]
76
Uml Process / Modeling Dependency Injection
« on: September 10, 2005, 09:19:17 pm »
Dependency Injection is becoming popular.  How are UML modelers diagramming composite classes having a dependency that is injected lets say with a setter method call?

For example, I tried reverse engineering this code:
Code: [Select]

// In Manager.java

public class Manager {

   public static void main() {

       Wheel aWheel = new Wheel();

       Car myCar = new Car(aWheel);  // Note the injection of a Wheel during construction of myCar
   }
}

// In Car.java

public class Car {

   Wheel myWheel;

   public Car(Wheel aWheel) {myWheel = aWheel;}

   private void rotate () {};
}

// In Wheel.java

public class Wheel {

   private int diameter;
   
   public void setDiameter (int dia) {diameter = dia;}
}

What I got was


I don't know why the Manager's associations were not modeled...

Anyway, this is a simple example of what I mean by dependency injection.  Car is a composite structure having an internal structure consisting of aWheel.  I don't get that sense from the diagram.  But I don't know how to diagram that better.  Yes, I can draw a Composit Structure diagram, but how do I show the dynamics of the dependency injection?  Is an Activity diagram the only way to show the dynamics of the injection?


77
Uml Process / Properties, Attributes and Slots
« on: September 27, 2005, 10:01:33 am »
Reading (in the UML 2 Superstructure)  the definition of the subject terms I've come to a conclusion upon which I seek consus.

"property is to element, as attribute is to classifier, as slot is to object."

Do I have this right?

78
Uml Process / Composite vs Component
« on: September 16, 2005, 04:57:03 am »
What are the essential or vital differences between a Composite and a Component?  Except fir scale and packaging, they look the same to me.

79
Uml Process / Diagramming Nested Classes
« on: March 14, 2005, 12:39:08 pm »
Java allows Nested classes of various types.  This includes: static and inner.   Inner classes are further classified as member, local, and anonymmous.

I'm wondering how the nesting of these classes are modeled in UML 2.0 ala EA?

For the curious, here is sample code for a Member Class:

Code: [Select]

class top {
   int i = 33;

   class my NestedMember { //member inner class
            int k = i;
            int foo() {return this.k;}
   }

   void doCalclulations() {

           myNestedMember mn1 = new myNestedMember;
           myNestedMember mn2 = new myNestedMember;
           mn1.k = 654 * mn2.foo();
    }
}


thanks
Jim

80
Uml Process / Tagged values
« on: February 05, 2005, 09:16:59 pm »
I don't understand what a tagged value is.  I mean: How does a 'tagged value' differ from an attribute in a class element?

Thanks

81
Uml Process / How to model "IsATypeOf"
« on: January 13, 2005, 12:51:01 pm »
In the ER Diagramming notation for databases, I can use a connector that says an object is a "Type of" another Object.  For example:  'balls' and 'cylinders' are a type of 'bearing', or, 'employees' and 'customers' are types of 'individuals'.  There is a specification of a data element in the generic object that is used to specify the type of the associated tuple in the "child" table.  Columns applicable to both types are declared in the Parent table.  Columns unique to the typed child table are declared in the child table.  In the physical model, all columns can be declared in one table or in separate tables.

How is all of this modeled in UML?  I've seen something similar in defining actors on a Use Case model, but nothing in the class diagrams

How is the code generation controlled to map into the desired table structure?


82
Automation Interface, Add-Ins and Tools / Shape Script Variable Text
« on: February 06, 2009, 12:12:18 pm »
I understand that I may use a shape script to add a compartment to an element in rectangle view, but how do I provide compartment text that varies from element to element?  For example, I add a compartment to a class element and add the class several times to my diagram.  The text in each instance of the class element the text needs to be different.  Sample code would be nice.

Thanks
Jim

83
Automation Interface, Add-Ins and Tools / Learning Shape Script?
« on: April 06, 2007, 03:48:14 pm »
Where is the starting point for learning EA's Shape script?    :-/

I need to add some compartments to the Class element to support AOP.

I mistakenly used Action Script in an earlier post, but that is not my need, so I removed the post.

Pages: 1 ... 4 5 [6]