Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Eiffel > Re: check type ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 5 Topic 862 of 917
Post > Topic >>

Re: check type of object

by Philippe Ribet <ribet@[EMAIL PROTECTED] > Apr 27, 2007 at 01:26 PM

Georg Bauhaus wrote:

> I guess this is about some reflection style factory
> programming? (Sometimes used to circumvent the need
> of specifying interfaces and classes before selecting
> one at run time, and having to compare strings and then:
> 
>    factory: JCLLDR
> 
>    if some_run_time_name.equals("EMPLOYEE") then
> 	Result ?= factory.make_employee(...)
>         ...
>    elseif ... 
> 
> 

For such pattern, inspect on strings is valuable (performance and 
simplicity):
inspect some_run_time_name
when "EMPLOYEE" then
	Result ?= factory.make_employee(...)
when ...

end

Philippe Ribet




 5 Posts in Topic:
check type of object
Thomas Delaet <tdelaet  2007-04-23 06:07:45 
Re: check type of object
Philippe Ribet <ribet@  2007-04-23 17:45:47 
Re: check type of object
Georg Bauhaus <bauhaus  2007-04-23 20:39:42 
Re: check type of object
Philippe Ribet <ribet@  2007-04-27 13:26:14 
Re: check type of object
Thomas Delaet <tdelaet  2007-04-26 01:19:16 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 5:52:34 CDT 2008.