comp.lang.ada
 help / color / mirror / Atom feed
* Observer Pattern / Concurrency with ObjectAda
@ 2007-11-19 11:07 stefanmairhofer
  0 siblings, 0 replies; only message in thread
From: stefanmairhofer @ 2007-11-19 11:07 UTC (permalink / raw)


Hello!

I'm currently working on a software-pattern based project with
ObjectAda and I would require to implement an Observer pattern for my
program.

I've stumbled upon an example of the "Observer Pattern with an
Concurrent Subject" from Matthew Heaney
http://www.adapower.com/index.php?Command=Class&ClassID=Patterns&CID=287

And I was not able to run it on ObjectAda 7.2.2. Embedded (I get
access-errors, constraint-errors and sometimes deadlocks). When I
tried the program using MinGW with gccada it worked perfectly.

Apparently the Attach and Detach functions do not work properly and in
the main procedure Test_Observers the Clock declaration results in an
Constraint_Error / access error

procedure Test_Observers is

   Timer : aliased Clock_Timer;
   Clock : Digital_Clock (Timer'Access);  -- <-- Constraint_Error

begin
...

(little help : Timer = subject, which includes a task that informs the
observers via notify(),
 Clock = observer, which has the update() method)

Any ideas why it works with GNAT, but not with ObjectAda?

Thank you for your help!
Best regards
Mairhofer Stefan



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-11-19 11:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-19 11:07 Observer Pattern / Concurrency with ObjectAda stefanmairhofer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox