Beruflich Dokumente
Kultur Dokumente
BY
October- 2010
BONAFIDE CERTIFICATE
Certified that this project work titled Weather Report is the bonafide work of
carried out the work under my supervision, and submitted in partial fulfillment of the
requirements to CS-451 Software Enginnering/Mini Project Lab during the year 2010-
2011.
ACKNOWLEDGEMENT
We regard our sincere thanks to our principal Dr. P. S. SANKAR RAO sir for
proving support and stimulating environment. We would like to express our gratitude to
the management of R. V. R. & J. C. COLLEGE OF ENGINEERING for providing us
with a pleasant Environment and Excellent Lab faculty.
J.Lakshman kumar(Y7CS859)
K.Madhu(Y7CS865)
K.Suryateja(Y7CS854)
4
CONTENTS
1. Problem statement 6
ANALYSIS
2. Requirements elicitation 7
4. Identification of Actors. 14
7 . Flow of Events. 26
9. Activity diagram. 31
Logical view
DESIGN
23. Testing
78
24. Implementation screen shots 80
25.Conclusion 87
References 88
6
1.PROBLEM STATEMENT
Problem Scenario:
Now a days we see in many cities and places there causes many disasters
due weather conditions. Even we can see so much loss of life, property and etc. The
purpose of this report is to push the boundaries of current research on climate change so
we may better understand the coming climatic conditions and can protect the life and
property.
Proposed Solution:
The idea is to generate a weather report that which is having the details about
the reports of the previous weather and present weather conditions. In this visitors visits
the weather report for finding weather conditions about the previous and present. The
administrator will maintain the complete weather database and he have a capability to
insert new report and update the previous values that were present in the weather
database.
The details, which are maintained in the database, are shown below:
ANALYSIS
2.REQUIREMENTS ELICITATION
This section of the document lists required requirements for weather report.
HARDWARE:
CDDRIVE : LG52X
MOUSE :3 BUTTONS
SOFTWARE:
The following general principles are observed when working with HTML
Html has its roots in sgml ,which has always been a language for the
specification of structural markup. As HTML matures more and more of its
9
ACCESSIBILITY:
As the Web community grows and its members diversify in their abilities and skills, it is
crucial that the underlying technologies be appropriate to their specific needs. HTML has
been designed to make Web pages more accessible to those with physical limitations.
HTML 4 developments inspired by concerns for accessibility include:
1)Better distinction between document structure and presentation, thus encouraging the
use of style sheets instead of HTML presentation elements and attributes.
2)Better forms, including the addition of access keys, the ability to group form controls
semantically, the ability to group SELECT options semantically, and active labels.
3)The ability to markup a text description of an included object (with the OBJECT
element).
4)A new client-side image map mechanism (the MAP element) that allows authors to
integrate image and text links.
5)The requirement that alternate text accompany images included with the IMG element
and image maps included with the AREA element.
8)A wider range of target media (tty, braille, etc.) for use with style sheets.Better tables,
including captions, column groups, and mechanisms to facilitate non-visual
rendering.Long descriptions of tables, images, frames, etc.
CREATION OF JAVA:
JAVA Performance:
Programs written in Java have a reputation for being slower and requiring more
memory than those written in C. However, Java programs' execution speed improved
significantly with the introduction of Just-in-time compilation in 1997/1998 for Java
1.1,the addition of language features supporting better code analysis (such as inner
classes, StringBuffer class, optional assertions, etc.), and optimizations in the Java Virtual
Machine itself, such as HotSpot becoming the default for Sun's JVM in 2000.
To boost even further the speed performances that can be achieved using the Java
language Systronix made JStik, a microcontroller based on the aJile Systems line of
embeddedJava processors. In addition, the widely used ARM family of CPUs has
hardware support for executing Java bytecode through its Jazelle option.
JAVA IS ROBUST:
Java is robust because it is highly supported language, meaning that unlike C you
cannot crash your computer with a bad program. Also, another factor in its robustness is
its portability across many Operating systems, with is supported by the Java Virtual
Machine.
11
JAVA IS PORTABLE:
Java is known as a portable language because Java code can currently
execute on all major platforms. What's more, once you've compiled your Java source files
to .class files, those files can be used on any Java-supported platform without
modification, unlike many other languages.Because application sorfware written by
JAVA can run on any platform just with a JAVA compiler.Java compiler will compile
you java codes to byte-code,but not machine-code.So you can run it on every platform.
JAVA IS MULTITHREADED:
Multithreading is simply the ability of a program to do more than one thing at a
time. For example and application could be faxing documentation at the same time is
printing another document. Multithreading is particularly important in multimedia
program might often be running a movie, running a audio track and displaying text at the
same time.
JAVA IS EXTENSIBLE:
A big plus for java is the fact it can be extended. It was purposely written to
be lean with the emphasis on doing what it does very well: instead of typing of tryong to
do everything from beginning ,it was written so that extending it is very easy.
JAVA IS SECURE:
Java is considered more secure than other languages for several reasons:
• The Java compiler catches more compile-time errors; other languages (like
C++) will compile programs that produce unpredictable results.
• Java does not allocate direct pointers to memory. This makes it impossible
to accidentally reference memory that belongs to other programs or the
kernel.
12
jConnect is a 100% pure Java implementation of the JDBC standards. It provides Java
developers native database access in multi-tier and heterogeneous environments. Unlike
other JDBC implementations, you can download jConnect quickly, without client
installation. This makes jConnect both easier and more cost-effective for a new class of
thin-client Java applications. jConnect provides high-performance, direct access to the
complete family of Sybase products, including SQL Server, SQL Anywhere, Sybase
IQ, and Replication Server. Through OmniConnect, it provides high performance,
transparent connectivity to more than 25 enterprise and legacy database servers. jConnect
can also access Oracle, AS/400, and other database servers directly, using DirectConnect
.
Installing jConnect for JDBC
This CD includes the jConnect for JDBC Installation Guide and Release Notes in HTML
and Adobe Acrobat (.pdf) formats. The documentation files are located in the inst_doc
directory on the CD. You can access these files from the CD, or you can copy them to a
local drive. The jConnect for JDBC Installation Guide and Release Notes provide system
requirements and complete instructions for installing and testing the product, describes
features new to this release, and reports known problems.
A servlet container uses a Java Virtual Machine* to run servlet code as requested by a
web server. The servlet container is also responsible for managing other aspects of the
servlet lifecycle: user sessions, class loading, servlet contexts (which we will discuss in
the next session), servlet configuration information, servlet persistence, and temporary
storage.
Servlet basics:
Servlet API consists of two packages, javax.servlet and javax.servlet.http. The javax is
there because servlets are a standard extension to Java, rather than a mandatory part of
the API. This means that while servlets are official Java, Java virtual machine developers
aren’t required to include the classes for them in their Java development and execution
environments. As mentioned already, however, the Servlet API is required for J2EE 1.3.
The HttpServlet class is an extension of GenericServlet that includes methods for
handling HTTP-specific data.* HttpServlet provides a number of methods, such as
doGet(), doPost(), and doPut(), to handle particular types of HTTP requests (GET, POST,
and so on). These methods are called by the default implementation of the service()
method, which figures out what kind of request is being made and then invokes the
appropriate method. Here’s a simpleHttpServlet:
13
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class HelloWorldServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
resp.setContentType("text/html");
PrintWriter out = resp.getWriter();
out.println("<HTML>");
out.println(
"<HEAD><TITLE>Have you seen this before?</TITLE></HEAD>");
out.println(
"<BODY><H1>Hello, World!</H1><H6>Again.</H6></BODY></HTML>");
}
}
HelloWorldServlet demonstrates many essential servlet concepts. First,
HelloWorldServlet extends HttpServlet. This is standard practice for an HTTP servlet.
HelloWorldServlet defines one method, doGet(), which is called whenever anyone
requests a URL that points to this servlet.† The doGet() method is actually called by the
default service() method of HttpServlet.
Servlet Features:
The java web server provides several important servlet features. These
includes:
1. Loading and invoking servlets: servlets can be loaded both locally and remotely.
2. Filters and servlets chaining: the java web server uses mime typesto call servlets
sequentially.
3. Server-side includes: servlets can be invoked from dynamic HTML documents
using tags.
4. Replacing CGI script: servlets are on effective substitute for CGI script and
provide a faster and cleaner way to generate dynamic document.
14
Use-case view
4. IDENTIFICATION OF ACTORS
Actors represent system users. They are NOT part of the system. They represent
anyone or anything that interacts with (input to or receive output from) the system.
An actor is someone or something that:
• Interacts with or uses the system
• Provides input to and receives information from the system
• Is external to the system and has no control over the use cases
Actors are discovered by examining:
Visitor
Naming
The name of the actor is displayed below the icon.
Questions to help to identify actors
1. Who is interested in a certain requirement
2. Where is the system used within the organization?
3. Who will benefit from the use of the system?
4. Who will supply the system with information, use this information, and remove
this information?
5. Who will support and maintain the system?
6. Does the system use an external resource?
7. Does one person play several different roles?
8. Do several people play the same role?
9. Does the system interact with a legacy system?
Actors identified are:
1) Administrator:
Administrator is a person who is responsible for inserting,deleting ,updatting
the values of weather inforamtion.
ADMINISTRATOR
2) Visitor:
The person who uses the weather information system to get inforamtion about
about present and past weathe informations.
Vistitor
16
Log-In
• A use case may have a name, although it is typically not a simple name. It is often
written as an informal text description of the actors and the sequences of events
between objects. Use case names often start with a verb. For example, names of
possible use cases for an ATM machine might include Dispense Cash or Transfer
Funds.
• The name of the use case is displayed below the icon.
The set of questions used to identify the use-cases are:
1. What are the tasks of each actor?
2. Will any actor create, store, change, remove or read information in the system?
3. What use cases will create, store, change, remove, or read this information?
18
4. Will any actor need to inform the system about sudden, external changes?
5. Does any actor need to be informed about certain occurrences in the system?
6. What use cases will support or maintain the system?
7. Can all functional requirements be performed by the use cases?
Log-In
Request Weather
This use case provides inforamtion about previous and present weather conditions
that is intiated by the visitor.
Logout
RELATIONS:
Association Relationship:
An association provides a pathway for communication. The
communication can be between use cases, actors, classes or interfaces. Associations are
the most general of all relationships and consequentially the most semantically weak. If
two objects are usually considered independently, the relationship is an association
By default, the association tool on the toolbox is uni-directional and drawn on a
diagram with a single arrow at one end of the association. The end with the arrow
indicates who or what is receiving the communication.
Bi-directional association:
If you prefer, you can also customize the toolbox to include the bi-
directional tool to the use-case toolbox.
In An ASSOCIATION Relationship, we can provide Stereotype COMMUNICATE also
as shown below
21
<<communicate>>
LOGIN
USER
Dependency Relationship:
Extended Relationship:
«extend» is used when you wish to show that a use case provides additional functionality
that may be required in another use case.
«include» applies when there is a sequence of behavior that is used frequently in a
number of use cases, and you want to avoid copying the same description of it into each
use case in which it is used.
23
ENTER
WEATHER
information
Administrator
24
VISITOR
Level 1:
25
<<include>>
<<include>> <<include>>
<<include>> states
previous
<<include>>
<<include>> countries
<<include>>
request weather detail
present
<<include>>
usename
login <<include>>
password administrator
visitor
logout
<<include>>
state
<<include>>
enter weather information
date
details
26
<<include>>
<<extend>>
<<include>> <<include>>
<<extend>>
<<include>> states
previous
<<include>>
<<include>> <<extend>>
countries display weather report
<<include>>
request weather detail
present
<<include>>
usename
login <<include>>
password administrator
visitor
logout
<<include>>
state
<<include>>
enter weather information
date
details
7. FLOW OF EVENTS
27
The flow of events for a use case is contained in a document called the Use Case
Specification. Each project should use a standard template for the creation of the Use
Case Specification. Includes the following
1. Use case name, Brief Description
2. Flow of Events -
1. Basic flow.
2. Alternative flow.
3. Special requirements.
4. Pre conditions.
5. Post conditions.
6. Extension points.
28
3. 4.
Pass:
ok cancel
1.
5. 6.
Previous Present
Enter the temp
Enter the temp
Report temp
7.
Report past:
Information
8.
Cname:
Report
about the past Mintemp:
and present
information of Maxtemp:
weather.
Rainfall:
done
ok cancel
32
9. ACTIVITY DIAGRAM
ACTIVITIES:
An activity represents the performance of task or duty in a workflow. It
may also represent the execution of a statement in a procedure. An activity is similar
to a state, but expresses the intent that there is no significant waiting (for events) in an
activity.
The activity icon appears as a rectangle with rounded ends with a name and
a compartment for actions.
NewActivity
TRANSITIONS:
Transitions connect activities with other model elements and object flows
connect activities with objects. Transitions are used to show the passing of the flow
of control from activity to activity. They are typically triggered by the completion of
the behavior in the originating activity.
A state transition indicates that an object in the source state will perform
certain specified actions and enter the destination state when a specified event occurs
or when certain conditions are satisfied. A state transition is a relationship between
two states, two activities, or between an activity and a state.
NAMING:
The name of a state should be unique to its enclosing class, or if nested,
within the state. All state icons with the same name in a given diagram represent the
same state.
Actions:
Actions on states can occur at one of four times:
• On entry
• On exit
• Do
• On event
34
DECISIONS:
When modeling the workflow of a system it is often necessary to
show where the flow of control branches based on a decision point. The transitions from
a decision point contain a guard condition, which is used to determine which path from
the decision point is taken. Decisions along with their guard conditions allow you to
show alternate paths through a work flow.
A decision represents a specific location on an activity diagram or state chart
diagram where the workflow may branch based upon guard conditions. There may be
more than two outgoing transitions with different guard conditions, but for the most part,
a decision will have only two outgoing transitions determined by a Boolean expression.
Decision Point
END STATE:
An end state represents a final or terminal state on an activity diagram or state
chart diagram. Place an end state when you want to explicitly show the end of a
workflow on an activity diagram or the end of a state chart diagram. Transitions can only
occur into an end state; however, there can be any number of end states per context.
End state
START STATE:
A start state, (also called an “initial state”) explicitly shows the beginning of a
workflow on an activity diagram or the beginning of the execution of a state machine on
a state chart diagram.
Start state
35
SWIM LANES:
Swim lanes may be used to partition an activity diagram. This typically is done to
show what person or organization is responsible for the activities contained in the swim
lane.
Swim lanes are helpful when modeling a business workflow because they can
represent organizational units or roles within a business model. Swim lanes are very
similar to an object because they provide a way to tell who is performing a certain role.
Swim lanes only appear on activity diagrams.
When a swim lane is dragged onto an activity diagram, it becomes a swim lane
view. Swim lanes appear as small icons in the browser while a swim lane views appear
between the thin, vertical lines with a header that can be renamed and relocated.
SYNCHRONIZATION BARS:
In a workflow there are typically some activities that may be done in parallel. A
synchronization bar allows you to specify what activities may be done concurrently.
Synchronization bars are also used to show joins in the workflow; that is, what
activities must complete before processing may continue.
Means, a synchronization bar may have many incoming transitions and one
outgoing transition, or one incoming transition and many outgoing transitions.
Modeling a workflow in an activity diagram can be done several ways; however, the
following steps present just one logical process:
1. Identify a workflow objective. Ask, "What needs to take place or happen by the end of
the workflow? What needs to be accomplished?" For example, if your activity diagram
models the workflow of ordering a book from an online bookstore, the goal of the entire
workflow could be getting the book to the customer.
2 Decide the pre and post-conditions of the workflow through a start state and an end
state. In most cases, activity diagrams have a flowchart structure so start and end states
are used to designate the beginning and ending of the workflow. State and end states
clarify the perimeter of the workflow.
3. Define and recognize all activities and states that must take place to meet your
objective. Place and name them on the activity diagram in a logical order.
4. Define and diagram any objects that are created or modified within your activity
diagram. Connect the objects and activities with object flows.
5. Decide who or what is responsible for performing the activities and states through
swim lanes. Name each swim lane and place the appropriate activities and states within
each swim lane.
6. Connect all elements on the diagram with transitions. Begin with the "main"
workflow.
7. Place decisions on the diagram where the workflow may split into an alternate flow.
For example, based on a Boolean expression, the workflow could branch to a different
workflow.
8. Evaluate your diagram and see if you have any concurrent workflows. If so, use
synchronizations to represent forking and joining.
9. Set all actions, triggers and guard conditions in the specifications of each model
element.
37
a d m in is tr a to r user
user
a d m in is tr a to r
lo g i n
u s e r a n d p a s s w rd
n o t v a li d p re s e n t p re v io u s cancel
v a li d
d e le te
d e t a i ls c o u n t r y s t a t e d a te s ta te c o u n tr y d e ta ils d a te
th a n k y o u
lo g o u t
38
Logical View
Using the noun phrase strategy, candidate classes can be divided into three
categories: Relevant classes, Fuzzy Area or Fuzzy classes (those classes that we are not
sure about), and irrelevant classes.
It is safe to scrap the irrelevant classes, which either have no purpose or will be
unnecessary. Candidate classes then are selected from the other two categories. Here
identifying classes and developing a UML class diagram just like other activities is an
iterative process. Depending on whether such object modeling is for the analysis or
design phase of development, some classes may need to be added or removed from the
model .Analyst must be able to formulate a statement of purpose for each candidate class;
if not, simply eliminate it.
1 Identifying Tentative Classes:
The following are guidelines for selecting classes in an application:
• Look for nouns and noun phrases in the use cases.
• Some classes are implicit or taken from general knowledge.
• All classes must make sense in the application domain; avoid computer
implementation classes refer them to the design stage.
• Carefully choose and define class names.
Identifying classes is an incremental and iterative process. This incremental and
iterative nature is evident in the development of such diverse software technologies as
graphical user interfaces, database standards, and even fourth-generation languages.
2 Selecting Classes from the Relevant and Fuzzy Categories :
The following guidelines help in selecting candidate classes from the
relevant and fuzzy categories of classes in the problem domain.
40
a) Redundant classes. Do not keep two classes that express the same
information. If more than one word is being used to describe the same idea, select the one
that is the most meaningful in the context of the system. This is part of building a
common vocabulary for the system as a whole. Choose your vocabulary carefully; use the
word that is being used by the user of the system.
b) Adjectives classes. "Be wary of the use of adjectives. Adjectives can be used
in many ways. An adjective can suggest a different kind of object, different use of the
same object, or it could be utterly irrelevant. Does the object represented by the noun
behave differently when the adjective is applied to it? If the use of the adjective signals
that the behavior of the object is different, then make a new class".
For example : Single account holders behave differently than Joint
account holders, so the two should be classified as different classes.
c) Attribute classes: Tentative objects that are used only as values should be
defined or restated as attributes and not as a class. For example, Client Status and Details
of Client are not classes but attributes of the Client class.
d) Irrelevant classes: Each class must have a purpose and every class should be
clearly defined and necessary. You must formulate a statement of purpose for each
candidate class. If you cannot come up with a statement of purpose, simply eliminate the
candidate class.
As this is an incremental process. Some classes will be missing; others will be
eliminated or refined later. Unless you are starting with a lot of domain knowledge, you
probably are missing more classes than you will eliminate. Although some classes
ultimately may become super classes, at this stage simply identify them as individual,
specific classes. Your design will go through many stages on its way to completion, and
you will have adequate opportunity to revise it.
This refining cycles through the development process until you are
satisfied with the results. Remember that this process (of eliminating redundant classes,
classes containing adjectives, possible attributes, and irrelevant classes) is not sequential.
You can move back and forth among these steps as often analysts likes.
41
classes, and frequently supports a number of different interactions that may represent
several different use cases.
2. A collaboration diagram usually contains only object instances, while a class diagram
usually contains only classes.
3. The connections between the object symbols on a collaboration diagram symbolize
links between objects, while on a class diagram the corresponding connections stand for
associations between classes.
4. A collaboration diagram shows the dynamic interaction of a group of objects and thus
every link needed for message passing is shown. The labeled arrows alongside the links
represent messages between objects. On a class diagram, the associations themselves are
usually labeled, but messages are not shown.
5. Finally, any of the three stereotype symbols can be used on either diagram; there are
also differences in this notation.
When the rectangular box variant of the notation is used in a collaboration
diagram it represents object instances rather than classes, is normally undivided and
contains only the class name .On a class diagram, the symbol is usually divided into three
compartments that contain in turn the class name, its attributes and its operations.
CRC cards are an aid to a group role-playing activity. Index cards are used in preference
to pieces of paper due to their robustness and to the limitations that their size (approx.
15cm x 8cm) imposes on the number of responsibilities and collaborations that can be
effectively allocated to each class.
A class name is entered at the top of each card and responsibilities and collaborations are
listed underneath as they become apparent. For the sake of clarity, each collaboration is
normally listed next to the corresponding responsibility.
From a UML perspective, use of CRC cards is in analyzing the object interaction
that is triggered by a particular use case scenario. The process of using CRC cards is
usually structured as follows.
45
1. Conduct a session to identify which objects are involved in the use case.
2. Allocate each object to a team member who will play the role of that object.
3. Act out the use case.
This involves a series of negotiations among the objects to explore how
responsibility can be allocated and to identify how the objects can collaborate with each
other.
4. Identify and record any missing or redundant objects.
Before beginning a CRC session it is important that all team members are briefed on the
organization of the session and a CRC session should be preceded by a separate exercise
that identifies all the classes for that part of the application to be analyzed.
The team members to whom these classes are allocated can then prepare for the
role playing exercise by considering in advance a first-cut allocation of responsibilities
and identification of collaborations. Here, it is important to ensure that the environment
in which the sessions take place is free from interruptions and free for the flow of ideas
among team members.
During a CRC card session, there must be an explicit strategy that helps to
achieve an appropriate distribution of responsibilities among the classes. One simple but
effective approach is to apply the rule that each object should be as lazy as possible,
refusing to take on any additional responsibility unless instructed to do so by its fellow
objects.
During a session conducted according to this rule, each role player identifies the object
that they feel is the most appropriate to take on each responsibility, and attempts to
persuade that object to accept the responsibility. For each responsibility that must be
allocated, one object is eventually persuaded by the weight of rational argument to accept
it. This process can help to highlight missing objects that are not explicitly referred to by
the use case description. When responsibilities can be allocated in several different ways
it is useful to role-play each allocation separately to determine which is the most
appropriate. The aim normally is to minimize the number of messages that must be
passed and their complexity, while also producing class definitions that are cohesive and
well focused.
46
The following are the responsibilities of each class in our application weather report
system
Login:
This use case is intiated by administrator to enter the weather information into the
weather report system.
1. Administrator:
This class controls the total maintenance of weather report system and controls
all the operations like updating ,inserting ,deleting in the system.
2. User:
This class is used to view the weather report in the weather report system.
4. Weather Reports:
This class maintains reports of weather conditons of state,country,details,date as
requested by user .
47
Weather Reports
Maintains reports of weather conditons
of state,country,details,date as requested
by user .
48
12.USE-CASE REALIZATIONS
Use case realization is nothing but an instance of a use case which involves the
identification of a possible set of classes, together with an understanding of how those
classes might interact to deliver the functionality of the use case. The set of classes is
known as collaboration.
In the UML, use case realizations are drawn as dashed ovals and relation ship symbols
are as shown below.
Realization relationship
The focus of control is a tall, think rectangle that shows the period of time during which
an object is performing an action, either directly or through a subordinate procedure.
An object lifeline is a vertical dashed line that represents the existence of an object over
a period of time. Most objects that appear in an interaction diagram will be in existence
of an object over a period of time. Most objects that appear in an interaction diagram will
be in existence for the duration of the interaction.
Message to self: A message to self is a tool that sends a message from one object back to
the same object. It does not involve other objects because the message returns to the same
object. The sender of a message is the same as the receiver.
53
1: start interface
2: insert info
3: insert
6: values updated
7: delete info
8: delete
In this expression integer represents the sequential order of the message. This may be
nested within a loop or a branch construct.
The name of a sequence-expression is used to differentiate two concurrent
messages since these are given the same sequence number.
Recurrence reflects either iterative or conditional execution and its syntax is as
follows:
Branching: ‘[‘condition-clause‘ ],
Iteration: ‘* ‘‘[‘iteration-clause ‘ ]’
A collaboration diagram emphasizes the organization of the objects that
participate in an interaction. Collaboration diagrams are a static construct to show objects
and messages involved in accomplishing a purpose or a set of purposes.
• Messages
• Path
• Sequence number
An object is a concrete manifestation of a class to which a set of operations can be
applied and which has a state that stores the effects of the operations. Objects are
instances of classes.
A path is used to indicate how one object is linked to another. A path stereotype is
attached to the far end of the link. The link of the path should be rendered explicitly.
A sequence number is used to indicate the time order of a message. The message is
prefixed with a number which increases monotonically for each new message in the flow
of control.
Two types of Numbering Sequences are:
1. Flat Sequence
2. Decimal Sequence
Difference between sequence and collaboration diagrams
Sequence diagrams are closely related to collaboration diagrams and both are
alternate representations of an interaction.
57
1: start interface
3: insert
4: enter info about country,state,details 8: delete
9: enter info to be deleted
2: insert info
7: delete info
6: values updated
11: info deleted
: :Database
Attributes
Attributes are part of the essential description of a class. They belong to the class, unlike
objects, which instantiate the class. Attributes are the common structure of what a
member of the class can 'know'. Each object will have its own, possibly unique, value for
each attribute.
Guidelines for identifying attributes of classes are as follows:
Attributes usually correspond to nouns followed by prepositional phrases.
Attributes also may correspond to adjectives or adverbs.
Keep the class simple; state only enough attributes to define the object state.
Attributes are less likely to be fully described in the problem statement.
Omit derived attributes.
Do not carry discovery attributes to excess.
Some questions are there which help in identifying the responsibilities of classes and
deciding what data elements to keep track of:
• What information about an object should we keep track of?
• What services must a class provide?
Answering the first question helps us to identify the attributes of a class. Answering the
second question helps us to identify class methods.
1. ASSOCIATION RELATIONSHIPS:
An association is a bidirectional semantic connection between classes. It is not a
data flow as defined in structured analysis and design data may flow in either direction
across the association. An association between classes means that there is a link between
objects in the associated classes.
2. AGGREGATION RELATIONSHIPS:
An aggregation relationship is a specialized form of association in which a whole
is related to its part(s). Aggregation is known as a "part-of" or containment relationship.
60
The UML notation for an aggregation relationship is an association with a diamond next
to the class denoting the aggregate (whole).
Class diagrams contain icons representing classes, packages, interfaces, and their
relationships. You can create one or more class diagrams to depict the classes at the top
level of the current model; such class diagrams are themselves contained by the top level
of the current model.
OBJECT:
• AN OBJECT IS a representation of an entity, either real-world or conceptual.
• An object is a concept, abstraction, or thing with well defined boundaries and
meaning for an application.
• Each object in a system has three characteristics: state, behavior, and identity.
STATE: The STATE Of an object is one of the possible conditions in which it may
exist. The state of an object typically changes over time, and is defined by a set of
properties (called attributes), with the values of the properties, plus the relationships the
object may have with other objects.
Behavior:
• Behavior determines how an object responds to requests from other objects .
• Behavior is implemented by the set of operations for the object.
Identity:
• Identity means that each object is unique even if its state is identical to that of
another object.
CLASS: A CLASS IS a description of a group of objects with common properties
(attributes) common behavior (operations), common relationships to other objects, and
common semantics.
Thus, a class is a template to create objects. Each object is an instance of
some class and objects cannot be instances of more than one class.
Classes should be named using the vocabulary of the domain.
In the UML, classes are represented as compartmentalized rectangles.
The top compartment contains the name of the class.
62
Entity Classes
• An entity class models information and associated behavior that is generally
long lived.
• This type of class may reflect a real-world entity or it may be needed to perform
tasks internal to the system.
• They are typically independent of their surroundings; that is, they are not
sensitive to how the surroundings communicate with the system.
IDENTIFICATION:
The first step is to examine the responsibilities documented in the flow of events
for the identified use cases. Entity classes typically are classes that are needed by the
system to complete some responsibility. The nouns and noun phrases used to describe the
responsibility may be considered for identification purpose. The initial list of nouns must
be filtered because it could contain nouns that are outside the problem domain, nouns that
are just language expressions, nouns that are redundant, and nouns that are descriptions
of class structures.
Boundary Classes:
63
DataBase
Weather Report
The following is the UML Class Diagram for our project Weather Report System:
Weather report
Administrator maintainence
username details
password +1 +1...* state
country
username() date
password()
login() addInfo()
start Interface() deleteinfo()
update()
+1
+1
weather reports
user +1...* +1...* Reports(details,state,country,date)
view reports()
65
Use cases and scenarios provide a way to describe system behavior; in the form of
interaction between objects in the system. Sometimes it is necessary to consider inside
behavior of an object.
A state chart diagram shows the states of a single object, the events or messages
that cause a transition from one state to another and the actions that result from a state
change. As in Activity diagram, state chart diagram also contains special symbols for
start state and stop state.
State chart diagram cannot be created for every class in the system, it is only for
those class objects with significant behavior.
STATE:
A state represents a condition or situation during the life of an object during
which it satisfies some condition, performs some action or waits for some event.
UML notation for STATE is
To identify the states for an object its better to concentrate on sequence diagram.
In our application the object for Account may have in the following states, initialization,
open and closed state. These states are obtained from the attribute and links defined for
the object. Each state also contains a compartment for actions.
ACTIONS:
Actions on states can occur at one of four times:
on entry
on exit
66
do
On event.
On entry: What type of action that object has to perform after entering into the state?
On exit: What type of action that object has to perform after exiting from the state?
Do: The task to be performed when object is in this state, and must to continue until it
leaves the state.
On event: An on event action is similar to a state transition label with the following
syntax:
event(args)[condition]: the Action
STATE TRANSITION:
A state transition indicates that an object in the source state will perform certain
specified actions and enter the destination state when a specified event occurs or when
certain conditions are satisfied. A state transition is a relationship between two states,
two activities, or between an activity and a state.
We can show one or more state transitions from a state as long as each transition
is unique. Transitions originating from a state cannot have the same event, unless there
are conditions on the event.
Provide a label for each state transition with the name of at least one event that
causes the state transition. You do not have to use unique labels for state transitions
because the same event can cause a transition to many different states or activities.
Transitions are labeled with the following syntax:
STATE DETAILS:
Actions that accompany all state transitions into a state may be placed as an entry
action within the state. Like wise that accompany all state transitions out of a state may
67
be placed as exit actions within the state. Behavior that occurs within the state is called an
activity.
An activity starts when the state is entered and either completes or is interrupted
by an outgoing state transition. The behavior may be a simple action or it may be an
event sent to another object.
UML notation for State Details
StateName
entry/ simple action
entry/ ^class name.eventname
do/ simple action
do/ ^class name.event name
exit/ ^class name.event name
1. State: It is a condition or situation during the life of an object during which it satisfies
some condition, performs some activity, or waits for some event.
2. Event: It is the specification of significant occurrence that has a location in time and
space.
3. Transition: It is a relation between two states indicating that an object in the first state
will perform certain actions and enter the second state when a specified event occurs and
conditions are satisfied.
4. Action state: An action state is shorthand for a state with an entry action and at least one
outgoing transition involving the implicit event of completing the entry action.
5. Sequential sub state: A submachine state represents the invocation of a state machine
defined elsewhere. The submachine state is depicted as a normal state with the
appropriate “include” declaration within its internal transitions compartment. As an
option, the submachine state may contain one or more sub states, which represent already
created states.
6. Concurrent sub state: A concurrent state is divided into two or more sub states. It is a
state that contains other state vertices. Naturally, any sub state of a concurrent state may
also be a composite state of either type. Any state enclosed within a composite state is
called a sub state of that concurrent state.
7. Initial state: A pseudo state to establish the start of the event into an actual state.
8. Final state: The final state symbol represents the completion of the activity.
9. History state: History state is a state machine describes the dynamic aspects of an object
whose current behavior depends on its past.
10. Vertical Synchronization: This merge branch bar symbol is also known as a
“Synchronization Bar”. It merges concurrent transitions to a single target. It splits a
single transition into parallel transitions.
69
11. Horizontal Synchronization: This merge branch bar symbol is also known as a
“Synchronization Bar”. It merges concurrent transitions to a single target. It splits a
single transition into parallel transitions.
12. Guard conditions: Activity and state diagrams express a decision when conditions are
used to indicate different possible transitions that depend on Boolean conditions of
container object. UML calls those conditions as guard conditions.
13. Forks and joins: A fork construct is used to model a single flow of control that divides
into two or more separate, but simultaneous flows. A join consists of two or more flows
of control that unite into a single flow of control.
administrator user
login
view weather
report
maintain weather
information
logout
DESIGN
70
During the design phase the classes identified in object-oriented analysis must be
Re visited with a shift in focus to their implementation. New classes or attributes and
methods must be added for implementation purpose and user interfaces.
Axiom: An axiom is a fundamental truth that always is observed to be valid and for
which is no counter example or exception.
Axiom 1: The independence axiom.
Maintain the independence of components.
Axiom 2: The information axiom.
Minimize the information content of the design.
Axiom 1 deals with relationship between system components and Axiom 2 deals
with the complexity of the design. Axiom 1 states that, during the design process, as we
go from requirement and use-case to a system component, each component must satisfy
that requirement without affecting other requirements. Axiom 2 is concerned with
simplicity.
Occam’s razor says that, “The best theory explains the known facts with a
minimum amount of complexity and maximum simplicity and straightforwardness.”
Theorem: A theorem is a proposition that may not be self-evident but can be proven
from accepted axioms.
Corollary: A corollary is a proposition that follows from an axiom or another
proposition that has been proven.
Corollary 1: Uncoupled design with less information content. Highly cohesive objects
can improve coupling because only a minimal amount of essential information need be
passed between objects.
Corollary 2: Single purpose. Each class must have a single, clearly defined purpose.
When we document, we should be able to easily describe the purpose of a class in a few
sentences.
71
Corollary 3: Large number of simple classes. Keeping the classes simple allows
reusability.
Corollary 4: Strong mapping. There must be a strong association between the physical
system (analysis’s object) and logical design (design’s object).
Corollary 5: Standardization. Promote standardization by designing interchangeable
components and reusing existing classes or components.
Corollary 6: Design with inheritance. Common behavior must be moved to super classes.
The superclass-subclass structure must make logical sense.
Attributes
During analysis Stage we need to consider in detail the data types of the attributes
also. Common primitive data types include Boolean (true or false), Character (any
alphanumeric or special character), Integer (whole numbers) and Floating-Point (decimal
numbers). In most object-oriented languages more complex data types, such as Money,
String, Date, or Name can be constructed from the primitive data types or may be
available in standard libraries. An attribute's data type is declared in UML using the
following syntax:
The name is the attribute name, the type-expression is its data type, the initial
value is the value the attribute is set to when the object is first created and the property-
string describes a property of the attribute, such as constant or fixed. The characters in
single quotes are literals.
Attribute declarations can also include arrays also. For example, an Employee
class might include an attribute to hold a list of qualifications that would be declared
using the syntax: Qualification [O ... 10]: String
Operations
72
Each operation also has to be specified in terms of the parameters that it passes
and returns. The syntax used for an operation is:
Operation name' ('parameter-list ') “: “return-type-expression
An operation's signature is determined by the operation's name, the number and
type of its parameters and the type of the return value if any.
Object visibility
The concept of encapsulation is one of the fundamental principles of object-
orientation. During analysis various assumptions have been made regarding the
encapsulation boundary for an object and the way that objects interact with each other.
For example, it is assumed that the attributes of an object cannot be accessed
directly by other objects but only via 'get' and 'set' operations (primary operations) that
are assumed to be available for each attribute. Moving to design involves making
decisions regarding which operations (and possibly attributes) are publicly accessible. In
other words we must define the encapsulation boundary.
The following are the different kinds of visibilities, their symbols and their
meaning.
Visibility Visibility Meaning
symbol
+ Public The feature (an operation or an attribute) is directly
accessible by an instance of any class.
- Private The feature may only be used by an instance of the class
that includes it.
# Protected The feature may be used either by instances of the class
that includes it or of a subclass or descendant of that
class.
~ Package The feature is directly accessible only by instances of a
class in the same package.
Interfaces
Generally a class may present more than one external interface to other classes or
the same interface may be required from more than one class. An interface in UML is a
group of externally visible (i.e. public) operations. The interface contains no internal
73
The alternative notation uses a stereotyped class icon. As an interface only specifies the
operations and has no internal structure, the attributes compartment is omitted. This
notation lists the operations on the diagram. The realize relationship, represented by the
dashed line with a triangular arrowhead, indicates that the class supports at least the
operations listed in the interface
<< interface >>
Refining Attributes:
In the analysis phase, the name of the attribute was sufficient. However, in the
design phase, detailed information must be added to the model. There are three basic
types of attributes. They are:
1) Single-value attributes.
2) Multiplicity or multi-value attributes.
3) Reference to another object, or instance connection.
Attributes represent the state of an object. The following is the attribute presentation:
Visibility name: type-expression=initial-value
Where visibility is one of the following:
+ public visibility
# protected visibility
- private visibility
During analysis, we identified the following attributes for classes:
74
deleteInfo()
updateInfo()
After refining
+addInfo (String name,String id)
+deleteInfo (String name, String id)
+updateInfo (String name,String id )
Refining relationships:
The relationships are already been drawn, there are no modifications to be done to
those relationships.
Weather report
Administrator maintainence
username details
password +1 +1...* state
country
username() date
password()
login() addInfo()
start Interface() deleteinfo()
update()
+1
+1
weather reports
user +1...* +1...* Reports(details,state,country,date
view reports()
<<Body>>
<<Header>>
<<includes>> Weather
Weather
Information.h Information.java
<<Object code>>
Weahter
Information.o
Server:pc
<<JDBC>>
Client:pc
Aaro/vark:de alpha
<<JDBC>>
Sun:jdbc
23. Testing
Test Test case Test case step expected act Test case
case id name description ual status
administr Verify .To verify Click submit, with An error F
ator admin that admin out entering admin message
and Username user name and “pls enter
passwrd and passwrd the user
passwrd is name and
greater than passwrd”
6 digit must be
number displayed.
Display the P
Enter the username further
and passwrd having movement
greater than 6 digit or an error
say (123456) type & message
click submit “invalied
username
and passwrd
” must be
displayed.
Test case Test case Test case step expected actual Test
id name description case
status
80
Click An error
submit message “enter
with out the location”
entering must be F
the displayed.
location
Enter the
location Display values
type & of temperature
click for given P
submit temperature,city,
date or “invalid
city ” must be
displayed.
WELCOME:
ENTRANCESCREEN:
82
USER SCREEN:
83
PRESENTTEMPSCREEN:
ADMINISTRATORSCREEN:
LOGOUT SCREEN:
89
25.CONCLUSION:
90
The project report entitled “WAETHER REPORT” has come to its final stage.
The system has been developed with much care that it is free of errors and at the same
time it is efficient and less time consuming. The important thing is that the system is
robust. Also provision is provided for future developments in the system. The entire
REFERENCES
91
1. http://download.oracle.com/javase/tutorial/
2. http://download.oracle.com/javase/tutorial/jdbc/index.html
3. http://www.developer.com/db/article.php/942641/An-Overview-of-Java-
Database-Connectivity.htm
4. http://www.wilsonmar.com/1jdbc.htm
5. http://www.jsptube.com/
6. http://www.roseindia.net/servlets/index.shtml