Re: Teaching Java, teaching what?
On 12/10/2013 5:56 AM, Silvio wrote:
On 12/10/2013 02:02 AM, Arne Vajh?j wrote:
And web is often less OO than desktop apps, which may move
focus from the purpose of the course.
I usually get nervous twitches when people start saying something is
more or less OO. There is no such thing as general OO-ness
Unless you will claim that there is only two possible
states non-OO and OO, then something can be more or less
OO than something else.
and saying
that web is less OO than desktop is complete nonsense.
Calling something nonsense is not a very convincing argument.
Try instead of writing an application able to add two integers
and display the result in Swing, Struts 1.x and JSF - and count
number of occurrences of inheritance, polymorphism and encapsulation
for each compare dto number of lines written.
I think you will find that Swing has a lot of OO features, while
Struts 1.x and JSF are more multi-paradigm oriented, which means
less OO.
An entry level course usually focuses on general stuff like classes,
instances, encapsulation and methods. I personally think command line
test code is best suited there since it distracts the least from the
main topics.
Swing brings an enormous amount of extra logic into the picture. Apart
from the fact that you have to discuss components and hierarchies,
But that is exactly what you would want to discuss in an OO course.
graphics,
Don't need that for a basic Swing app.
layout managers,
There will be a bit of black magic with that, but it is nothing compared
to CSS.
event handling etc.
That is very OOish.
it has a dirty API that
brings along a zillion names, adapters, patterns etc.
You can do basic Swing with a modest number of classes.
Arne