Re: dynamic type checking - a pauline conversion?
From: Jeff Brooks (jeff_brooks_at_nospam.com)
Date: 03/23/04
- Next message: Jeff Grigg: "Re: XP Stories (was: Re Second Dimension ...)"
- Previous message: Universe: "Re: Second Dimension of Object Oriented Modelling"
- In reply to: thoff: "Re: dynamic type checking - a pauline conversion?"
- Next in thread: Cristiano Sadun: "Re: dynamic type checking - a pauline conversion?"
- Reply: Cristiano Sadun: "Re: dynamic type checking - a pauline conversion?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 23 Mar 2004 03:08:07 GMT
thoff wrote:
> On code comparisons...i always wonder if someone wrote
> code to show a cleaner implementation in APL, perl, ruby, groove,
> etc if you would switch languages? If not, i am not always sure
> what the point is.
If a language is a lot better at a few solutions i might take the time
to learn it. I seriously don't expect anyone to stop developing in their
favorite language when they see my example. I don't even expect anyone
to actually write the code in Java. If they think about how much effort
it takes in java and see how little code i required in Smalltalk they
might take a look at Smalltalk. That is really the most i can hope for.
> Some questions i immediately ask are: is paging a large set from the
> database handled automatically? Are transactions handled automatically?
> Can i update objects through the collection? Is the query handled
> on the database side or the smalltalk side? Are updates from other
> clients seen through the collection?
That depends on the implemention of the collection that is used.
Think of it this way. If the jdbc library in Java had a QueryList class
that implemented List that was returned from a query any code that could
work on a List would also work on the results of query.
One of the reasons this doesn't work in Java is checked exceptions are
part of the method signature. List can never throw an SQLException. It
would be natural to return a List from a query and iterate over it but
exceptions in Java messes that up.
The QueryList could support paging, transactions, notifications, updates
etc. It could return records that when changed updated the database. The
records could also support notifications from other clients.
One of the problems with Java typing is small differences in interfaces
cause people to make different interfaces. Code is bound to the name of
the interface/class. Doing things like iterating a collection requires
different code different types of collections. For example, in java
array iteration, List iteration, and database query result iteration all
have different "interfaces" so either your code doesn't work with them
all or you have to create a new interface, and adapters for each of the
collections. The new interface isn't known by any other developer so
their code can't work with it. Also, you have to change your existing
code to work with the new interface.
In Smalltalk there is a standard way of iterating all collections so
code like a filter that works with an Array, will work with a
Collection, and also the results of a query from a database. Also,
because Smalltalk is dynamically typed anything that behaves like a
collection regardless of what class it is derived from will also work
with my filter code.
Jeff Brooks
- Next message: Jeff Grigg: "Re: XP Stories (was: Re Second Dimension ...)"
- Previous message: Universe: "Re: Second Dimension of Object Oriented Modelling"
- In reply to: thoff: "Re: dynamic type checking - a pauline conversion?"
- Next in thread: Cristiano Sadun: "Re: dynamic type checking - a pauline conversion?"
- Reply: Cristiano Sadun: "Re: dynamic type checking - a pauline conversion?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|