Managing Information Technology

(Frankie) #1

50 Part I • Information Technology


comprehend at first, so let’s use an example that might be
more familiar to you—the family dog.
We can think of a dog and identify various attrib-
utes, which programmers call properties, to differentiate
one dog from another dog. Each dog has height, weight,
color, coat thickness, eye color, snout shape, and many
other features that might differ from other dogs. Each of
these properties thus has a value. Each dog, independent
of its property values, also does several actions; program-
mers call these methods. Eat, sleep, run, and fetch are
examples of these methods. Dogs also respond to several
actions done to them; these are called events. Hearing
their name called, being petted, or even being kicked are
examples of events to which the dog responds. The code
in Figure 2.12 shows an example of a class called Dog,
written in Java.
We said that to work with a class, we must create an
instance of the class called an object—this process is
called instantiation. From our class definition of a Dog
(Figure 2.12), we know that it has various properties,


methods, and events. For a family without a pet, however,
all that family has is a class definition. When the family
goes to the animal shelter to rescue a furry friend, they now
have an instance of the class, or an actual dog.
The code in Figure 2.13 shows how a Dog can be
instantiated from the class definition in Figure 2.12. We
instantiate a new Dog and then call the display method in
the newly created Dog object.
Objects also have two important features that make
them even more useful. One of them is encapsulation,
which allows the object’s creator to hide some (or even all)
of the object’s inner workings from other programmers or
users. The second feature is called inheritance, which
means that we can create subclasses and superclasses from
classes, and they then automatically have properties, meth-
ods, and events of their related class. For example, if I have
a class called Animal, I know that Dog should be a sub-
class of Animal. A Dog is a type of Animal (not the other
way around) and should take on the properties, methods,
and events of the class Animal.

J2EE Versus .NET
Java 2 Enterprise Edition (J2EE)and.NETare two competing frameworks proposed by an alliance of
companies led by Sun Microsystems and Microsoft, respectively, as platforms for application develop-
ment on the Web using the object-oriented programming paradigm.
J2EE, as the name suggests, is based on the Java language. In fact, J2EE is not the name of a prod-
uct. Instead, it is a collection of 13 different Java-based technologies put together in a particular fashion.
Thus, theoretically it is possible to buy each of these technologies from different vendors and mix and
match them as needed. In practice, however, it is typical for a company to buy a product that implements
the J2EE specification from a single vendor. Popular choices in this regard include WebSphere from IBM
and WebLogic from Oracle. One of the key advantages of J2EE is that because everything is Java-based,
the products can be run on a variety of platforms (e.g., Windows, UNIX, and Linux).
By contrast, applications written for Microsoft’s .NET framework are designed to run only on the
Windows platform. However, unlike J2EE, where one is limited to using Java as the programming lan-
guage, in .NET a programmer can choose among a variety of languages such as VB.NET, C#, J# (a variant
of Java), and even C++. In fact, within a single application a programmer can, for example, choose to
write portions of the program in VB.NET and others in C#.
There has been a lot of debate as to which framework is better. The answer depends on several
tangible and intangible factors. In the end, we think that the decision regarding which technology to
adopt will be based largely on the following factors:


  • Available programmer expertiseWhat do the firm’s programmers already know?

  • Complexity of the Web applicationFor large applications that have significant scalability and
    security requirements, the J2EE framework provides the flexibility needed to achieve the desired
    architectural and performance goals.

  • Degree of Web services support neededBoth J2EE and .NET are quite comparable in terms of their
    support for Web services standards including XML. The difference lies in the fact that support for
    XML is an integral part of the .NET framework, whereas at this time XML support has to be “bolted
    on” in J2EE.

Free download pdf