Why one of the reasons to say that a design is bad is about deployment???

A

amoya

Sorry, my english is very bad.

I'm studying a example about rectangles. I don´t have the source code.

The Rectangle class has two methods shown. One draws the rectangle on
the screen, the other computes the area of the rectangle. Two different
applications use the Rectangle class. One application does
computational geometry. It uses Rectangle to help it with the
mathematics of geometric shapes. It never draws the rectangle on the
screen. The other application is graphical in nature. It may also do
some computational geometry, but it definitely draws the rectangle on
the screen.

The author of the paper say that one of the problem is "we must include
the GUI
in the computational geometry application. If this were a C++
application, the GUI would
have to be linked in, consuming link time, compile time, and memory
footprint. In a Java
application, the .class files for the GUI have to be deployed to the
target platform."

I don't understand this problem?? what means deployment??
 
O

Oliver Wong

amoya said:
what means deployment??

Deployment refers to all the things that need to be done to put the
program (after it's finished being programmed) on a computer and making it
runnable for the users. In some cases, this is as simple as just copying the
..class files onto the harddrive. In other cases, you might need to be
concerned about installing a JRE, setting registry values, installing an
HTTP or SQL server, registering them as services in the OS, etc.

The concept of "Installing a program" is a subset of the concept of
"Deployment".

- Oliver
 
T

Thomas Weidenfeller

amoya said:
The author of the paper say that one of the problem is "we must include
the GUI
in the computational geometry application. If this were a C++
application, the GUI would
have to be linked in, consuming link time, compile time, and memory
footprint. In a Java
application, the .class files for the GUI have to be deployed to the
target platform."
I don't understand this problem??

So don't I. Not because of your description, but I think the author of
the paper is wrong. But first:
what means deployment??

Simplified, it means installation.

Back to the paper. The paper's author seems to assume that GUI code
(assuming he means code from java.awt.geom.Area or similar) is linked
into the code, and that he has to copy/load the whole of java.awt ("the
GUI") to the target platform during installation of the application,
because he uses things like java.awt.geom.Area.

Which is wrong. These classes are part of the Java Standard edition
(J2SE). Already when he installed/deployed the JRE, these classes are
put onto the target platform. They are there, regardless of if they are
used by an application or not. It doesn't matter if his application uses
them or not, they still hang around as part of the JRE. If they do the
job, it is actually more clever to use them, than building your own.

/Thomas
 
C

Chris Uppal

Thomas said:
Back to the paper. The paper's author seems to assume that GUI code
(assuming he means code from java.awt.geom.Area or similar) is linked
into the code, and that he has to copy/load the whole of java.awt ("the
GUI") to the target platform during installation of the application,
because he uses things like java.awt.geom.Area.

I agree that the GUI code will probably be already installed on the target
machine. But that doesn't mean that the original class wasn't badly designed.

As a purely practical point, if the class mentions, but never actually uses,
the AWT/Swing stuff, then some of those classes will have to be loaded,
prepared, maybe even initialised, which would not be the case otherwise. In
the worst case, you might even cause AWT to start up its event threads. None
of that is good.

But what's really wrong is the design itself. The linking "problem" is just an
/example/ of why ill-considered coupling is bad. Or call it a symptom if you
like. Having GUI code in a class that is intended for general-purpose use
(including non-GUI applications) is poor separation[*]. It confuses the API.
It adds unnecessary coupling. It almost certainly reflects a lack of thought
by the designer.

([*] It reminds me of the way that URLClassLoader drags a load of networking
concepts and linkages into code that has nothing whatever to do with networks.)

-- chris
 

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

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top