Book a Demo

Author Topic: Modelling a function with EA  (Read 4383 times)

Propad

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Modelling a function with EA
« on: November 21, 2006, 09:47:04 am »
Hello,

I'm bit puzzled by the fact, that I see no clean way to model a simple function (not bound to a class, but residing in a C or Python module/source file).

My task includes a number of tasks, among others: a clean modeling of existing libraries, both in C and Python.

Much of the code there is implemented as simple functions. Now I want to put  those functions in a package (corresponding to C source files, or modules), I see no way to do that in an unambiguous manner.

I've also tried to see how EA handles imported Python and C-source files. Fact is, no functionas are imported. Typedefs, enummerations and namespaces (from C++) are imported just fine.

So I'm wondering what would be the clean way to do this.
Ma best guess by now is to inreoduce some streotypes: C_source_file, C_header_file, Python_module etc., then attach Operations and Attributes to instances of classes with those stereotypes.

Any hints?

Thanks in advance,
Propad

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Modelling a function with EA
« Reply #1 on: November 21, 2006, 12:59:37 pm »
It's difficult because UML doesn't actually allow for modelling operations that don't belong to a class.  (As it is for object oriented modelling)  For your C files, try importing as C instead of C++.  Other than that, adding a stereotyped class is probably the best way to go.
« Last Edit: November 21, 2006, 01:01:45 pm by simonm »

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Modelling a function with EA
« Reply #2 on: November 21, 2006, 11:56:40 pm »
..might be tricky, but ...
It would be nice to be able to model these beasts as components that just expose a bunch of (public) methods -- regardless of their internal structure.
Youn can do it manually, maybe a Suggestion to enable some type of RE on them???
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.

Propad

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Modelling a function with EA
« Reply #3 on: November 23, 2006, 01:37:45 am »
Hello Simon, Bruce,
first ofall, thanks for the answers!
Other than that, this is frustrating...
The wannabe modelling language for the 21st century ignores 80% of the codebase of the 20th century, and a whole bunch of living languages, including C, which is still THE language of  embedded systems... Ugly. Oh please don't take my rant too seriously. I'm just a frustrated purist ;-).
A nice day to everybody,
Nenad

thomaskilian

  • Guest
Re: Modelling a function with EA
« Reply #4 on: November 23, 2006, 09:11:51 am »
And unfortunately it does also not RE Assembler, Cobol and Fortran ;D

Don't take this as insult, but C is an Assembler, probably a good macro assembler, but not a programming language. Just that millions of C-programmers think so, it is not right.