[Rock-dev] improvement TaskContext.get

Sylvain Joyeux sylvain.joyeux at dfki.de
Thu Nov 3 15:26:31 CET 2011


On 11/03/2011 02:51 PM, Alexander Duda wrote:
> Currently I have a helper method for this in Vizkit.rb but I think it
> would be nice to move it into the method get
>
> thoughts?
I cannot disagree more. That's looking too much like silent error to me, 
and forbids giving any information about the reason for the failure.

I also don't like the caching behaviour ... I'm not sure of seeing all 
the implications of it, and that's a too important method to play that game.

Here's what I would propose: implement TaskContext.find(expression) 
which returns nil if the task cannot be found (but no caching !).

Ideally, the base method would even be find_all(expression), which 
returns all the tasks matching the expression (so that 
find_all(:provides => 'camera_base::Task') returns all cameras for 
instance). #find and #get would simply be built on top of it.
-- 
Sylvain Joyeux (Dr.Ing.)
Space & Security Robotics

!!! Achtung, neue Telefonnummer!!!

Standort Bremen:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany

Phone: +49 (0)421 178-454136
Fax:   +49 (0)421 218-454150
E-Mail: robotik at dfki.de

Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.:    DE 148646973
Steuernummer:  19/673/0060/3
-----------------------------------------------------------------------


More information about the Rock-dev mailing list