Hi,

What is the expected behaviour with regards to method modifiers and sub classes?

I was expecting that all "before" sub routines would be run before any around 
subs.

In current tests, I am finding that a sub classes "around" is called before any 
parent classes "before" subs.


For a test I have there classes Base -> Sub -> Test  and 3 Roles A, B & C 
applied to Base.
Role A provides a sub test().

Roles B&C and Classes Base,Sub,Test provide before,around & after subs for the 
test sub.  Calling test on an instance of Test gives:

Test->before test
Test->around test
Sub->before test
Sub->around test
Base->before test
C->before test
B->before test
Base->around test
C->around test
B->around test
A->test
B->after test
C->after test
Base->after test
Sub->after test
Test->after test

For classes Test and Sub, their around sub is called before the parent classes 
befores are called.
For roles, all "before" are called before "around" is called on the class where 
the roles are composed.

Is this correct?


Thanks in advance
Alex Hole
Computer Programmer
[cid:image001.png@01CD8ABD.744EDD70]
T: 0121 766 2204
E: ah...@connect-service.co.uk<mailto:ah...@connect-service.co.uk>
www.connect-service.co.uk<http://www.connect-service.co.uk>
Connect Distribution Services Ltd. | Connect House | Small Heath Business Park 
| Talbot Way | Birmingham | B10 0HJ


________________________________
Please consider the environment before printing this e-mail

________________________________
DISCLAIMER: This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they are 
addressed. If you have received this email in error please notify the system 
manager. Please note that any views or opinions presented in this email are 
solely those of the author and do not necessarily represent those of the 
company. Finally, the recipient should check this email and any attachments for 
the presence of viruses. The company accepts no liability for any damage caused 
by any virus transmitted by this email.

<<inline: image001.png>>

Reply via email to