You are on page 1of 15

Introduction

In today’s world we all are going for computers and making our life easier
and simple by writing a lot of software that is to be used for daily purpose. For example, for
railway or airline reservations, we have very sophisticated software that does this task. For
developing such software we not only spend a huge amount of money but also, require well
skilled person who must have knowledge of programming languages. You all must know a
lot of programming languages like C, PASCAL etc. Knowing any programming language is
not enough for developing software system, but it also requires approach from problem to
solution. This approach may be the traditional one or the object oriented one. Each one has
its own advantages and disadvantages but nowadays all are trying to follow a unified object
oriented approach. While the traditional approach stresses on doing things (Algorithms),
Object Oriented Approach stresses on data management.

Software

It is a collection of Programs that when executed do our task in the prescribed manner.
Every software is build through a long and systematic procedure. This procedure must follow
some sort of approach.

Complexity in Software Development


Every software system is complex. Complexity is an essential
characteristic of any software that can be managed, but can’t be simply discarded. Those, which
are not complex, are specified constructed, maintained and used by the same person. Such
systems have very limited purpose and a very short life span.

The Complexity derives from the following elements:

“Complexity of the Problem Domain or the Impedance mismatch between user of a system and
its developer”. Whenever software is being developed the external complexity usually springs
from the impedance mismatch that exists between the users & the developers. This means that
understanding the system to be developed, by the developer, and communicating his viewpoint
to the user, can be difficult process. It is mainly because both user and developers belongs to
different working domains and the user may find it difficult to articulate his/her requirements and
vice versa. Even if he/she does so, we precisely have few instruments for capturing these
requirements.

“Changing requirements during development.” Apart from the problem is that user requirements
are very dynamic in nature i.e. they tend to vary during the course of development.

Difficulty in managing the Development Process.

It may be possible that the whole system is divided into hundreds of modules and the
amount of work is divided among the team members. If the numbers of team members are more,
then coordination among the team members becomes more difficult. In such cases the key
management challenges is to maintain unity and integrity of design. Since every person has his
individual style of working, the code written by any one person may become difficult to
understand for any other person.

Easy User Interface

The main aim of any software engineer while developing any software
system is to provide user friendliness as much as possible. While designing software, this has to
be the ultimate aim in mind. If the user doesn’t find the interface easy , it might have to be
redesigned or additional training will have to be included to the end users, which will acquaint
them to the interface designed by you.

Flexibility Possible through Software

Any Industry whether automobile, manufacturing or any other, they all


have some standards, which are followed while manufacturing products, but in case of software
industry there are no such standards set, which makes it very difficult for any developer to offer
the ultimate flexibility. Flexibility is required, as the developer needs to express almost any kind
of abstraction. This type of flexibility forces the developer to craft virtually all the primitive
building blocks upon which these higher levels of abstraction standards.

The Traditional Approach and its Drawbacks

Emphasis is on doing things


The language till date like C, FORTRAN and BASIC are all procedural
languages. They all emphasize on algorithm side of programming. It consists of figuring out the
actions that the computer should take and then using any suitable programming languages to
implement these actions. A program prescribes a set of procedures for the computer to follow to
produce a particular outcome. This approach to programming makes managing the software
development process very difficult.

Most Functions share global data.

Because data needs to be accessed across modules, it must be made global.


However due to this globalization, data security is lost. Data itself is rendered vulnerable with
traditional approach. You need to define many global data structures, so that any module can
access them. This leaves data open to modifications by any module/function.

Do not model real world problem very well.

If any real world entity, as simple as book is to be modeled, it’s very


difficult because there is no way to bind the behavior of entity to the data it represents.

Computer Organization:
Regardless of differences in physical appearance, virtually every computer may be envisioned
as divided into six logical units or sections:
1. Input unit. This “receiving” section obtains information (data and computer programs)
from input devices and places this information at the disposal of the other units so that it
can be processed. Most information is entered into computers through keyboards and
mouse devices. Information also can be entered in many other ways, including by
speaking to your computer, by scanning images and by having your computer receive
information from a network, such as the Internet.
2. Output unit. This “shipping” section takes information that the computer has processed
and places it on various output devices to make the information available for use outside
the computer. Most information output from computers today is displayed on screens,
printed on paper or used to control other devices. Computers also can output their
information to networks, such as the Internet.
3. Memory unit. This rapid-access, relatively low-capacity “warehouse” section retains
information that has been entered through the input unit, so that it will be immediately
available for processing when needed. The memory unit also retains processed
information until it can be placed on output devices by the output unit. Information in the
memory unit is typically lost when the computer’s power is turned off. The memory unit
is often called either memory or primary memory.
4. Arithmetic and logic unit (ALU). This “manufacturing” section is responsible for
performing calculations, such as addition, subtraction, multiplication and division. It
contains the decision mechanisms that allow the computer, for example, to compare two
items from the memory unit to determine whether they are equal.
5. Central processing unit (CPU). This “administrative” section coordinates and supervises
the operation of the other sections. The CPU tells the input unit when information should
be read into the memory unit, tells the ALU when information from the memory unit
should be used in calculations and tells the output unit when to send information from the
memory unit to certain output devices. Many of today’s computers have multiple CPUs
and, hence, can perform many operations simultaneously—such computers are called
multiprocessors.
6. Secondary storage unit. This is the long-term, high-capacity “warehousing” section.
Programs or data not actively being used by the other units normally are placed on
secondary storage devices (e.g., your hard drive) until they are again needed, possibly
hours, days, months or even years later. Information in secondary storage takes much
longer to access than information in primary memory, but the cost per unit of secondary
storage is much less than that of primary memory. Examples of secondary storage
devices include CDs and DVDs, which can hold up to hundreds of millions of characters
and billions of characters, respectively.
Machine Languages, Assembly Languages and High-Level Languages

Programmers write instructions in various programming languages, some directly understandable


by computers and others requiring intermediate translation steps. Hundreds of computer
languages are in use today. These may be divided into three general types:
1. Machine languages
2. Assembly languages
3. High-level languages
Any computer can directly understand only its own machine language. Machine language
is the “natural language” of a computer and as such is defined by its hardware design. Machine
languages generally consist of strings of numbers (ultimately reduced to 1s and 0s) that instruct
computers to perform their most elementary operations one at a time. Machine languages are
machine dependent (i.e., a particular machine language can be used on only one type of
computer).
For example:-
+1300042774
+1400593419
+1200274027

Machine-language programming was simply too slow and tedious for most programmers. Instead
of using the strings of numbers that computers could directly understand, programmers began
using English-like abbreviations to represent elementary operations. These abbreviations formed
the basis of assembly languages. Translator programs called assemblers were developed to
convert early assembly-language programs to machine language at computer speeds.
For example:-
load basepay
add overpay
store grosspay

Although such code is clearer to humans, it is incomprehensible to computers until translated to


machine language.

Computer usage increased rapidly with the advent of assembly languages, but
programmers still had to use many instructions to accomplish even the simplest tasks. To speed
the programming process, high-level languages were developed in which single statements could
be written to accomplish substantial tasks. Translator programs called compilers convert high-
level language programs into machine language. High-level languages allow programmers to
write instructions that look almost like everyday English and contain commonly used
mathematical notations. A payroll program written in a high-level language might contain a
statement such as

grossPay = basePay + overTimePay

Obviously, high-level languages are preferable to machine and assembly language from
the programmer’s standpoint. C, C++, Microsoft’s .NET languages (e.g., Visual Basic .NET,
Visual C++ .NET and C#) are among the most widely used high-level programming languages;
Java is the most widely used.

What is an Object?
“An Object is an entity that has well defined structure and behavior.” Everything
in this world is an object, from a nail to a hammer, from lever to an aeroplane. From human
perspective object is nothing but a tangible or visible thing or something that exists in time and
space.
Characteristics of an Object
Five basic characteristics of object:
1. State,
2. Behavior,
3. Identity,
4. Responsibility

We can define object as “An object represents an individual, identifiable item, unit or entity,
either real or abstract, with a well-defined role in the problem domain i.e. objects has identity,
state, behavior and responsibility.”
e.g. A Car is an Object.
State of an Object
“The State of an object encompasses the current values of all its attributes. An
attribute can be static or dynamic.” For example
1. Consider a window as an object. The height, width, the background color and the co-
ordinates of a window can be its attributes. Now, the current values in those attributes
will describe the state of that Window (e.g. minimized, maximized, resized etc.)
2. Considering the Car as an Object, the attributes such as the average, make and fuel type
of the car are going to remain constant throughout the life of the car. Such non-changing
attributes are termed as static. Whereas the dynamic attributes change frequently and may
contain different values at different time intervals.

Behavior of an Object
“Behavior is how an object acts or reacts, in terms of its state changes and operations
performed upon it.”
For example : Considering the same example of Window, we can say that, Totality of Operations
we can perform upon a window and consequent changes in attribute defines behavior of a
window. State of the attributes of a window object changes whenever we resize that window. In
short, Behavior of an Object corresponds to its functions.

Identity of an Object
“Identity is that property of an object which distinguishes it from all other similar
objects.”
Every object existing in this world can be distinguished from each other. In other words, every
object has its own identity.
To have an identity is absolutely essential for an object because while interacting
with many objects in a system, you need to identity that particular object with which you want to
interact. The identity enables us to distinguish that object from the rest.
For example while using Windows OS; we can give more than one window on the screen. Each
window is uniquely identified by the unique number assigned to it by the Windows OS, called as
a “Handle” to the window. This number ensures that user interaction with each window remains
unique. Account number uniquely identifies an account among all others. A single attribute or
group of attributes can be identity of an object.
Responsibility of an Object
“The Responsibility of an object is the role it serves within the system.” The
responsibility of an object decided by what role it is playing in the system. For example, the
responsibility of window object is to provide an easy and consistent user interface.
Operating Systems
Early computers could perform only one job or task at a time. This is often called single
user batch processing. The computer runs a single program at a time while processing data in
groups or batches. In these early systems, users generally submitted their jobs to a computer
center on decks of punched cards and often had to wait hours or even days before printouts were
returned to their desks.
Software systems called operating systems were developed to make using computers
more convenient. Early operating systems smoothed and speeded up the transition between jobs,
increasing the amount of work, or throughput, computers could process.
As computers became more powerful, it became evident that single-user batch
processing was inefficient, because so much time was spent waiting for slow input/output
devices to complete their tasks. It was thought that many jobs or tasks could share the resources
of the computer to achieve better utilization. This is called multiprogramming.
Multiprogramming involves the simultaneous operation of many jobs that are competing to share
the computer’s resources. With early multiprogramming operating systems, users still submitted
jobs on decks of punched cards and waited hours or days for results.
In the 1960s, several groups in industry and the universities pioneered timesharing
operating systems. Timesharing is a special case of multiprogramming in which users access the
computer through terminals, typically devices with keyboards and screens. Dozens or even
hundreds of users share the computer at once. The computer actually does not run them all
simultaneously. Rather, it runs a small portion of one user’s job, then moves on to service the
next user, perhaps providing service to each user several times per second. Thus, the users’
programs appear to be running simultaneously. An advantage of time sharing is that user
requests receive almost immediate responses.
Typical Java Development Environment
a Java development environment illustrated in Figure Java programs normally go through five
phases—edit, compile, load, verify and execute.
Phase 1: Creating a Program
Phase 1 consists of editing a file with an edi.tor You type a Java program ( source code)
using the editor, make any necessary corrections and save the program on a secondary storage
device, such as your hard drive. A file name ending with the .java extension indicates that the
file contains Java source code.
Two editors widely used on Linux systems are vi and emacs. On Windows, simple
editing programs like Windows Notepad. Many freeware and shareware editors are also
available for download from the Internet.
For organizations that develop substantial information systems, integrated development
environments (IDEs) are available from many major software suppliers. IDEs provide tools that
support the software development process, including editors for writing and editing programs
and debuggers for locating logic errors.
Phase 2: Compiling a Java Program into Bytecodes
In Phase 2, the programmer uses the command javac (the Java compiler) to compile a
program. For example, to compile a program called Welcome.java, you would type
javac Welcome.java
in the command window of your system. If the program compiles, the compiler produces a
.class file called Welcome.class that contains the compiled version of the program.
The Java compiler translates Java source code into bytecodes that represent the tasks to
execute in the execution phase (Phase 5). Bytecodes are executed by the Java Virtual Machine
(JVM)—a part of the JDK and the foundation of the Java platform. A virtual machine (VM) is
a software application that simulates a computer, but hides the underlying operating system and
hardware from the programs that interact with the VM. If the same VM is implemented on many
computer platforms, applications that it executes can be used on all those platforms. The JVM is
one of the most widely used virtual machines.
Unlike machine language, which is dependent on specific computer hardware, bytecodes
are platform-independent instructions—they are not dependent on a particular hardware
platform. So Java’s bytecodes are portable—that is, the same bytecodes can execute on any
platform containing a JVM that understands the version of Java in which the bytecodes were
compiled. The JVM is invoked by the java command. For example, to execute a Java application
called Welcome, you would type the command
java Welcome
in a command window to invoke the JVM, which would then initiate the steps necessary to
execute the application. This begins Phase 3.

Phase 3: Loading a Program into Memory


In Phase 3, the program must be placed in memory before it can execute—known as loading.
The class loader takes the .class files containing the program’s bytecodes and transfers them to
primary memory. The class loader also loads any of the .class files provided by Java that your
program uses. The .class files can be loaded from a disk on your system or over a network (e.g.,
your local college or company network, or the Internet).

Phase 4: Bytecode Verification


In Phase 4, as the classes are loaded, the bytecode verifier examines their bytecodes to ensure
that they are valid and do not violate Java’s security restrictions. Java enforces strong security, to
make sure that Java programs arriving over the network do not damage your files or your system
(as computer viruses and worms might).
Phase 5: Execution
In Phase 5, the JVM executes the program’s bytecodes, thus performing the actions specified by
the program. In early Java versions, the JVM was simply an interpreter for Java bytecodes. This
caused most Java programs to execute slowly because the JVM would interpret and execute one
bytecode at a time. Today’s JVMs typically execute bytecodes using a combination of
interpretation and so-called just-in-time (JIT) compilation. In this process, The JVM analyzes
the bytecodes as they are interpreted, searching for hot spots parts of the bytecodes that execute
frequently. For these parts, a just-in-time (JIT) compiler known as the Java HotSpot
compiler—translates the bytecodes into the underlying computer’s machine language. When the
JVM encounters these compiled parts again, he faster machine-language code executes. Thus
Java programs actually go through two compilation phases—one in which source code is
translated into bytecodes (for portability across JVMs on different computer platforms) and a
second in which, during execution, the bytecodes are translated into machine language for the
actual computer on which the program executes.
Java Naming conventions

Java naming convention is a rule to follow as you decide what to name your identifiers such as
class, package, variable, constant, method, etc.

But, it is not forced to follow. So, it is known as convention not rule. These conventions are
suggested by several Java communities such as Sun Microsystems and Netscape.

All the classes, interfaces, packages, methods and fields of Java programming language are given
according to the Java naming convention. If you fail to follow these conventions, it may generate
confusion or erroneous code.

Advantage of naming conventions in java

By using standard Java naming conventions, you make your code easier to read for yourself and
other programmers. Readability of Java program is very important. It indicates that less time is
spent to figure out what the code does.

The following are the key rules that must be followed by every identifier:

 The name must not contain any white spaces.


 The name should not start with special characters like & (ampersand), $ (dollar), _
(underscore).

Class

 It should start with the uppercase letter.


 It should be a noun such as Color, Button, System, Thread, etc.
 Use appropriate words, instead of acronyms.

Example: -
Interface

 It should start with the uppercase letter.


 It should be an adjective such as Runnable, Remote, ActionListener.
 Use appropriate words, instead of acronyms.

Example: -

Method

 It should start with lowercase letter.


 It should be a verb such as main(), print(), println().
 If the name contains multiple words, start it with a lowercase letter followed by an
uppercase letter such as actionPerformed().

Example:-

Variable

 It should start with a lowercase letter such as id, name.


 It should not start with the special characters like & (ampersand), $ (dollar), _
(underscore).
 If the name contains multiple words, start it with the lowercase letter followed by an
uppercase letter such as firstName, lastName.
 Avoid using one-character variables such as x, y, z.

Example :-

Package

 It should be a lowercase letter such as java, lang.


 If the name contains multiple words, it should be separated by dots (.) such as java.util,
java.lang.

Example :-

Constant

 It should be in uppercase letters such as RED, YELLOW.


 If the name contains multiple words, it should be separated by an underscore(_) such as
MAX_PRIORITY.
 It may contain digits but not as the first letter.

Example :-

CamelCase in java naming conventions

Java follows camel-case syntax for naming the class, interface, method, and variable.

If the name is combined with two words, the second word will start with uppercase letter always
such as actionPerformed(), firstName, ActionEvent, ActionListener, etc.

You might also like