Author Topic: Stupendiously stumped on Stubs  (Read 5199 times)

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Stupendiously stumped on Stubs
« on: September 20, 2006, 08:02:21 pm »
Total cranial implosion   :-/

I am trying to develop a component model for this new job and show explicitly where some components are replaced by "stubs" in the test bed.  For example, the component "SWIFT EMS" is replaced by the "SWIFT Message Simulator" component.

Any one got a idea of what the "correct" connector what I should use is?   "Delegate" looked promising but its not that.

bruce
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Stupendiously stumped on Stubs
« Reply #1 on: September 20, 2006, 10:19:03 pm »
How does a realization feel? From UML 2.1:
Quote
A Realization signifies that the client set of elements are an implementation of the supplier set, which serves as the specification. The meaning of ‘implementation’ is not strictly defined, but rather implies a more refined or elaborate form in respect to a certain modeling context.

You actual code is the specification (i.e. supplier) and your stub code is an implementation of the specification (i.e. client).
The Sparx Team
[email protected]

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Stupendiously stumped on Stubs
« Reply #2 on: September 20, 2006, 10:39:18 pm »
Thanks KP,  

That'll do me!

bruce
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Stupendiously stumped on Stubs
« Reply #3 on: September 21, 2006, 06:21:14 am »
Quote
How does a realization feel? From UML 2.1:
You actual code is the specification (i.e. supplier) and your stub code is an implementation of the specification (i.e. client).
Guys,

I would have said both codes (the stub and the full) implementations are Realizations of the Interface.

I mean, isn't that the point of the stub?

My AU$0.05
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

thomaskilian

  • Guest
Re: Stupendiously stumped on Stubs
« Reply #4 on: September 21, 2006, 02:25:50 pm »
I'd say that the stub DEFINES the interface while the implementation REALIZES it. IOW stub = socket symbol, implementation the box.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Stupendiously stumped on Stubs
« Reply #5 on: September 21, 2006, 04:16:11 pm »
Quote
I would have said both codes (the stub and the full) implementations are Realizations of the Interface.

I mean, isn't that the point of the stub?


Certainly for a class model, but Bruce is building a component model. Wouldn't that detail be better hidden at the component level?
The Sparx Team
[email protected]

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Stupendiously stumped on Stubs
« Reply #6 on: September 21, 2006, 05:03:43 pm »
Quote
I'd say that the stub DEFINES the interface while the implementation REALIZES it. IOW stub = socket symbol, implementation the box.
Well, in the general case, many stubs contain some limited functionality, and there may be many stubs (aka "Mocks") (see Domain Driven Design forums).  For example, an in memory mock, an XML based mock, the full code - all implementing a Data Transfer Component interface.

From a modeling perspective, I feel it's better to define the interface and then provide a variety of "mocks" up to to the full implementation.

Also, taking this route opens up the possibility of many full implementations, each technology specific.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!