-----BEGIN PGP SIGNED MESSAGE-----

In article <3867370ffe2ee941cf3a4981cf080896 / ruby-forum.com>,
Yochen Gutmann  <yoche2001 / dergutemann.com> wrote:
>Michael Greenly wrote:
>> 
>> Is it by design that you intend to call handle_client with objects that 
>> don't have portfolios?  Then you need to either check for that in 
>> handle_clients or expect the exception and catch it where it's called.
>> 
>> If you didn't intend to call handl_client with a non-portfolio baring 
>> client than the best thing that can happen is raising an expcetion
>> 
>> I'm not really sure I get the conflict you were trying to get to?
>
>Sorry Michael, that I didnt make myself clearer. Yes, it is not intendet 
>that such  a non-portfolioed client can be called upon 
>handle_client_well. Thus the question is how to aovid this wrong usage. 
>Seemingly it cant (or at least only through a vast of checkings)).
>

_ If you really think this kind of checking is important, then
don't use Ruby. Languages are just tools and not every tool works
for every job. Exception catching generally works well enough and
if you haven't used this style of error checking before, then it 
takes some getting used to. Ruby is not everybody's cup of tea. 

_ Objective C has the concept of "interfaces" in which you define
a set of methods that you respond to and you can do things like
ask if an object implements that interface. I think there are 
various Ruby modules out there that implement similar
concepts. It wouldn't be all that hard to write a module to 
do this. 

_ Ruby is like most object based systems, it makes coding easy,
but punishes you for design mistakes. The kind of typing you
want to me is a red flag for a weak design. What I've
found in my experience with Ruby is that if I'm having problems
with this kind of thing, it's almost always a sign that my design
needs work. 

_ Booker C. Bense 

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBRNfCwGTWTAjn5N/lAQFIugP9FwfYKRrcqfI2N9JD1JZwavKCWqSZmDWR
ZUj7LWXDUyZPXsZaNKk9dA8EoSKlqzaBzefQZuJsXJBY7kibt6Uevp/uPWxRF/oz
89dgL6GgtzQNx19D6buGgyArt4d51Kozf8c4Pr9aTTpAAT0PIlbROxov6Ba2bNVP
kgizeguS6q0=
=lbIo
-----END PGP SIGNATURE-----