Why mess with AWT when they had to bring up Swing?

E

EvErEady

Hi!

I was just wondering why Sun decided to change the classes for AWT when they
were going to bring Swing into the picture; they could've just left AWT the
way it was for compatibility with Java 1.1 applications and introduce its
creative ideas in Swing in Java 1.2.
 
T

Tor Iver Wilhelmsen

EvErEady said:
I was just wondering why Sun decided to change the classes for AWT when they
were going to bring Swing into the picture; they could've just left AWT the
way it was for compatibility with Java 1.1 applications and introduce its
creative ideas in Swing in Java 1.2.

Because Swing builds on AWT.
 
R

Roedy Green

I was just wondering why Sun decided to change the classes for AWT when they
were going to bring Swing into the picture; they could've just left AWT the
way it was for compatibility with Java 1.1 applications and introduce its
creative ideas in Swing in Java 1.2.

What changes are you referring to? Did you break one of your Apps?
 
T

Timo Kinnunen

EvErEady said:
Hi!

I was just wondering why Sun decided to change the classes for AWT
when they were going to bring Swing into the picture; they could've
just left AWT the way it was for compatibility with Java 1.1
applications and introduce its creative ideas in Swing in Java 1.2.

Sun wanted to reuse code from AWT to build Swing. They could have
extracted all the AWT functionality needed into some com.sun.* package,
change that all they wanted and implement AWT and Swing on top of that
without any coupling between AWT and Swing. Instead of doing the right
thing, my guess is they decided to change AWT and subclass it because it
was less work at the time.

Other factors that might have affected the decision: a hope of
interoperability between Swing and AWT components, making a statement
"our APIs are good, we're not going to just deprecate AWT", seemingly
lesser learning curve when migrating to Swing, early optimization.

So now we have IE's AWT, thankfully-defunc PersonalJava's AWT, AWTs in
PersonalJava-reborns Personal Profile and Personal Basis Profile and AWT
in J2SE. The horror, the horror...
 
T

Tor Iver Wilhelmsen

Jos A. Horsmeier said:
But isn't that quite 'au contraire' every object oriented design principle?

No, you build on existing code: After all, don't you subclass Swingf
classes when writing your own Swing applications?
 
J

Jos A. Horsmeier

Tor Iver Wilhelmsen said:
No, you build on existing code: After all, don't you subclass Swingf
classes when writing your own Swing applications?

True all true, but maybe it wasn't clear that I was responding to both
you and EvErEady --

Tor Iver Wilhelmsen said:
Because Swing builds on AWT.

Changing 'base' classes just to be able to 'build' on the changed classes
is not very OO-ish, is it?
OTOH, I haven't noticed any funny changes in AWT just to accommodate
the Swing classes ...

kind regards,

Jos
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top