TOPIC: Servlets, JSP S.No. Question/Answers 1. What Is Difference Between Servlets and CGI Servlets CGI
TOPIC: Servlets, JSP S.No. Question/Answers 1. What Is Difference Between Servlets and CGI Servlets CGI
TOPIC: Servlets, JSP S.No. Question/Answers 1. What Is Difference Between Servlets and CGI Servlets CGI
I1w1w 31
TOPIC : Servlets,JSP
S.No. Question/Answers
1. What is difference between servlets and CGI
Servlets CGI
1. Java Server Side components Common Gateway Interface
2. Init, Service, Destroy Life Cycle Passes request to corresponding script
3. Each request is processed by
creating separate thread to run
service method, i.e.., for each
request only service method is
executed, not initialized every time
For each request the server creates a separate process
to execute, which is overhead on server. And process
will terminate after processing request. Consumes
time and memory
4. Servlet runs in Server environment
(i.e.., server JVM), so it is possible
for communication between process
and server
No such option. Once the process is started executing
the server cannot communicate only will get output
from process.
5. Its powerful as it has implicit
support of Java Language itself
Should be done explicitly
6. portable and scalable Dependent
7. built-in session handling feature Should be done explicitely
2. Life cycle of Servlets
Life cycle of servlets include Init, Service, destroy
1. init() :- When server gets request for a servlet for first time, servlet container loads the servlet
and run its Init method. Used to perform servlet initialization--creating or loading objects that
are used by the servlet in the handling of its requests. Called only once.(To allocate resources
which are shared by all requests like database connections)
2. Service() :- Servlet container spawns a separate thread for each request to process request by
execute service method. Called for each request
3. destrory() :- when servlet is not been request for a certain amount of time, the servlet
container decides to remove the servlet instance from the memory, before removing it calls
servlets destroy method. It is generally used to free the resources which are hold by the servlet.
(called only once)
3. How many types of servlets are there?
Two types of servlets 1. GenericServlet 2. HttpServlet
GenericServlets HttpServlets
1. Can process request with any kind
of protocol
Can process request with http protocol
2. Separate thread is spawned Separate thread is spawned executing either doGet(),
Page 2 of 16
executing service() method for each
client request
doPost() via service() method (or some other
doXXX() methods.
4. What is difference between doGet() and doPost() methods?
GET and POST are two different methods through which a client can submit html form data to a
web-server.
1. GET :
a) Using Get method form data is submitted by appending to the request URL string
(called as QueryString), which will be visible and shown in the address-bar of
Browser (Client).
b) And using get method we can send only small amount of data (limited to length
of URL that browser supports, usually 256 bytes).
c) When server receives request, doGet() method is called via service().
2. POST :
a) Using Post method form data is submitted through socket streams,
b) And using post method we can send large amount of data.
c) When server receives request, doPost() method is called via service().
5. What is a QueryString?
Using GET method of submitting form data to server, the form data is attached to requested
URL separated by ? symbol. The string after ? symbol is called as QueryString which is
tokenized and presented individual items as variable name and value pairs.
6. What is the difference between JSPs and Servlets, which is preferable?
JSPs and Servlets both are server side programs written in java.
Servlets JSPs
1. Servlets are Java classes that are
capable of generating dynamic web-
content.
JSP specification are build on Servlets API only.
2. Servlets are written as Java Class
and need to compiled explicitely to be
executed or provide service.
3. JSPs are written just as HTML content using JSP
tags and doesnt need to be compiled explicitely,
this is done automatically by servlet container.
3. In servlets HTML code is embedded
in Java code
In JSPs java code is embedded in HTML code
4. Presentation and Business logic is
mixed
Presentation logic is separated from business logic
7. What is difference between RequestDisptacher and sendRedirect?
When a JSP or Servlet wants to redirect the client or send a request to another page
sendRedirect()( deprecated in 2.1 specs) method or RequestDispacte object is used.
SendRedirect():
1. When this method is used the request object does not reach the second resource (another
page) directly since the underlying implementation is an HTTP redirect, i.e., the server
sends the HTTP 302 message back to the client telling it that the resource has moved to
another URL and the client should access there.
2. And initial request object that was accessed in the first JSP or servlet page terminates
Page 3 of 16
with the end of the service method or with the reply of the server.
3. This is a method of request object
RequestDispacter:
1. Is another architecture introduced in servlet api 2.1 version to solve the client redirection
problem. It is interface which contains two methods one include(--, --) and anther
forward(--, -- ).
2. Using forward and include doesnt need a client to send again request to other page. Both
take request and response object as parameters which makes easy of developers to
assume that the original request is forwarded as they received.
3. include method is similar to server-side includes (ssi).
8. How do you maintain a session?
Session handling is mechanism that is used to identify a user(client) over several requests and
responses. Session can be defined as a series of related interactions between a single client and
the server which take place over a period of time.
Session handling can be done by 4 ways.
1. Hidden fields : This is implemented using HTML hidden tag to embed information in
each page.
Eg : <input type=hidden name=key value=keyvalue>
2. Cookies : Cookies are small pieces of information deposited on the client by the server.
This can be implemented by setting Set-Cookie HTTP header as
part of HTTP response OR
Using Servlet API class javax.servlet.http.Cookie we can set a cookie.
Eg : Cookie cookie = new Cookie(user,abcd);
response.addCookie( cookie );
3. URL rewriting : This is implemented by appending identification string to each URL in
the page.
Eg : <a href=/testpage.jsp?user=username> LINK </a>
NOTE : Above 3 methods use normal text format to handle sessions.
4. HttpSession objects : This is object oriented mechanism to handle Client sessions.
Servlet API provides javax.servlet.http.HttpSession interface which is used tohandle
session which can be obtained and used as shown below.
Eg : HttpSession sessionObject = request.getSession();
User userObject = new User(abcd);
sessionObject.setAttribute(user, userObject);
User userObject = sessionObject.getAttribute(user);
9 What is servlet context
A context provides invisible information about the container resources and is an interface for
communication between servlet and server. Context can be used to know everything about the
server.
10 What is servlet chaining?
Servlet chaining is process by which a request is processed by more than one servlet. i.e., the
server routes a request through an administrator-defined chain of servlets. When the server
Page 4 of 16
receives a request for a servlet
11 What is config and servletconfig
ServletConfig object is used to pass parameters to a servlet during its initializations and also
contains method that gives information about the web-server to the servlet or jsp.
12 In which package is the ThreadSafeModel?
Javax.servlet package
13 What is single threaded servlet?
1. A servlet implementing SingleThreadModel interface in javax.servlet package, it is said
as single threaded servlet.
2. Single threaded servlet is not-thread-safe servlet, which mean no two client can
concurrently access a single instance of servlet.
3. If the servlet implements this interface, the servlet programmer is guaranteed that no
two threads will execute concurrently the service method of that servlet. This guarantee
is ensured by maintaining a pool of servlet instances for each such servlet, and
dispatching each service call to a free servlet
TOPIC : JDBC
S.No. Question/Answers
1 Types of Drivers and Comparisions
JDBC is a API which is used to connect to database and support database operations. They are
four types of drivers
Type 1 - Bridge Drivers (JDBC-ODBC Bridge)
JDBC Application talk(Connects) to database through JDBC-ODBC Bridge. Client using
JDBC API request to ODBC, ODBC intern sends request to database through Native API
(Vendor specific).
Bridge drivers are provided by First Party vendor (i.e., Sun Microsystems here). As
dependent on ODBC drivers, its functionality is limited by functionality of ODBC. Client
binary-code should be loaded (ODBC).
Type 2 - Native API, part-Java driver
JDBC Application using JDBC API talk(Connects) to database through Native JDBC Driver
Native API (Vendor specific).
Page 5 of 16
Native drivers are provided by Database vendors. These drivers are used to convert JDBC
calls into native calls of the major database vendor APIs. These drivers suffer from the same
performance issues as Type 1 drivers, namely binary-code client loading, and they are
platform-specific.
Type 3 - Java Net driver
JDBC Application connects to database through a middle ware server, which converts clients
request to corresponding dbms request and then translates to Network request Protocol
(through socket connection) and sends to database
A Net-Protocol All-Java driver which translates JDBC calls into a DBMS-independent net
protocol which is then translated to a DBMS protocol by a middleware server.
Does not require client binary code.
Type 4 - Java Native protocol driver
These drivers convert JDBC Application request directly to DBMS protocol. i.e., pure java
socket connection
2 DriverManager Class
This is singleton class which maintains a list of JDBC drivers available on system and will load
and unload drivers as necessary.
3 Differences between Statement, PreparedStatement, CallableStatement
Statement : 1. Is a Object used for executing a static SQL statement and return the result it
produces.
2 Connection.createStatement() method is used to create statement object.
Page 6 of 16
3. execute(), executeUpdate() or executeQuery() method is called for which SQL string is
passed and a request is send to database server, where in SQL string is compiled and
converted into database specific binary code and executed.
4. Used when we require to execute a SQL statement only once.
PreparedStatement : 1. same --
2. Connection.prepareStatement( query ) method is used to create PreparedStatement
object.
3. same
4. Used when we require to execute a SQL statement for a certain number of times (more
than once).
5. Is a pre-compiled statement prepared once by the client and sent to the server, and
expected to be executed many no. of times.
6. Filling of blank parameters is done using setXXX() methods which would give more
portability and decouple from the underlying database. For eg. MySQL database takes date
format as yyyy-mm-dd where DB2 takes mm-dd-yyyy. By using preparedStatement and
using setDate() function, the underlying API provides the format conversions.
CallableStatement : 1. --- same --- . but used to execute stored procedures which are stored
along with the database.
1. Connection.prepareCall({---}) method is used to create CallableStatement object
2. Can return one or more ResultSets.
3. Parameters are passed by using three Utility-types IN, OUT, INOUT. Default is IN
IN This type is used to send information to the stored procedure. Can be used only
on RHS of expressions not on LHS.
OUT This type is used to retrieve information from database using a stored procedure.
Cannot be specified on RHS.
INOUT This type can be used to send as well as retrieve information. Can be specified
on both sides of the expression.
4. Eg CallableStatement cst = Connection.prepareCall({Call <procedure-
name>(?,?,?,.)});
? represents an argument to the procedure. For OUT parameter, we have to register
OUT values using registerOutParameter(int column, int value);
cst.executeQuery() or executeUpdate() or execute() methods are used to execute
callable statement.
4 What is the return type of execute, executeUpdate, executeQuery methods.
execute() return boolean (indicates whether the SQL statement is executed without errors or
not).
executeUpdate() returns int value ( No. of rows effected by the query)
executeQuery() return ResultSet object (if SQL is executed successfully)
5 Getting table data, database information
Connection object can by used to get tables information and database information.
getMetaData() method returns DatabaseMetaData object which contains information about the
database.
ResultSet object can be used to get information about the tables for whose data is included in
the resultset object. getMetadata() method of ResultSet object return ResultSetMetadata object
Page 7 of 16
which contains information about the table.
6 BatchUpdate statement
1. A batchupdate statement is a set of multiple SQL statements that are submitted to the
database to be executed as a single Statement.
2. addBatch(sql) method is used to add SQL statements to a single Statement Object.
3. clearBatch() method clears all the batch statements.
4. executeBatch() methos is used to execute a batch statement. This method return a int[]
object each int value in the array indicates effected rows for each SQL in the batch.
7 What are the exceptions in connection statement
SQLException is thrown if getConnection() method fails.
8 Life cycle to retrieve values from database
Steps to retrieve values from database.
1. create an instance of a JDBC Driver class
2. create a connection to the database using DriverManager.getConnection(--,--,--) method
3. create one or more statements using connection object
4. execute the statement, optionally obtaining one ore more resultsets
5. if obtained resultset is not empty, iterate through rows of resultset and extract the
required data.
6. release resultset and statement
7. close the connection
9 What are the different parameter for calleable statement
Refer JDBC- 3 question
10 Executing Stored procedure
Refer JDBC- 3 question
11 Connection pooling
Pooling is a mechanism to less the overhead burden where we require to create objects very
frequently and creating objects is too operation expensive.
Consider a database connection. For every client request we need to connect to database. For
this we can create a connection object every time the client request, but this process reduces the
performance of application as such connecting to database is overhead operation for application.
So instead of connection to database on each client request, it would be more optimistic to
create a set of connection objects and maintain them in a pool and when ever we get a client
request, we get pul-out a connection object from a pool and use it to process client request and
after processing send it back to pool. This reduces overhead of creating database connection
objects for each client request.
Topic : EJB
Page 8 of 16
1 What is EJB?
EJB is a server-side component architecture that simplifies the process of developing
enterprise-class distributed component architecture in java. Using EJB we can develop
applications which are scalable, reliable, portable, robust, secure without you writing
underlying distributed framework.
2 How many types of EJBs are there?
There are 3 types of Beans
1. Session Beans
2. Entity Beans
3. Message Driven Beans (added in J2EE 2.0 specs)
Session Beans are still classified into Sateful and Stateless Beans
Entity Beans are classified into Bean-Managed-persistent (BMP) beans and
Container-Managed-peristent (CMP) beans.
3 What is Stateless Session Bean?
Stateless beans are EJB components that model business process that can be performed in a
single method call. i.e., SLSB model components which doesnt require maintaining client
state.
Characteristics of SLSB:
1. No converstation state : SLSB doesnt hold conversational state on behalf of client.
2. Only one way to initialize SLSB: Bean developer cannot override ejbCreate()
method, because SLSB doesnt maintain state of client, overloading ejbCreate()
method with parameters doesnt make any sense as these constructors are not called
by the container (by life cycle methods from HomeImpl container class).
3. Resource-Management is done using Instance Pooling mechanism
4 what is Stateful Session Beans?
Stateful session beans are EJB components that model business process which require to
maintain conversational state or client request goes through a series of request.
Characteristics of SFSB:
1. Maintains client state : until client doesnt call remove() or server terminates the
client state is maintained.
2. Uses .ser file to persist client state. Uses the concept of activation and passivation to
maintain state. The container will store the client state, i.e., the whole bean into a .ser
file which is called as passivation. And when ever the client (same client) makes
request to another method, the container checks for client identity and sets the client
state to bean which is called activation.
3. SFSB state is short
4. SFSB state is unique and cannot be share by more than one client.
5. supports both Declarative Tx Management (DTM) and Programatic Tx Management
(PTM).
5 What is Entity Bean?
Entity Beans are EJB components which model a real world object or simply any data that is
Page 9 of 16
permanently persistable, like Bank Accounts, Customer Orders, Stock portfolios etc. Entity
Beans generally represent Model layer in MVC architecture, unlike session beans can
represent controller layer.
Characteristics of EB:
1. Maintains client state : until client doesnt call remove() the client state is maintained.
2. Client state is durable as the data it represents is persitent data (data in database).
Uses the concept of activation and passivation to maintain state. ejbLoad(),
ejbActivate(), ejbStore(), ejbPassivate() life cycle call back methods are used to
activate and passivate the client state.
3. EB state lasts for long period as it models persistent data.
4. Supports both Declarative Tx Management (DTM) and Programatic Tx Management
(PTM).
6 Life cycle of 3 types of Beans?
Session Beans:
7 What is BMP?
BMP means Bean-Managed-Persistence. Which means that the persistence issues are
handled by bean it self (i.e., the bean developer). That means that the developer has to write
the persistence logic (generally using JDBC api) to save the client state and also handle the
activation and passivation mechanism.
8 What is CMP?
CMP means Container-Managed-Persistence. This means that the persistence issues are
totally handled by container (J2EE specs implemented servers). That means that the
developer has to just write code related to business method processing and dont have to
worry about persistence service issues.
9 What is ready state?
To enhance the performance of any beans, we use different mechanism for different services
provided for ejbs. Like Resource management is done using pooling mechanism. This
reduces the overhead burden of creating ejb instances for each and every request.
Consider a scenario, where in a SLSB is maintained in a pool ( say 5 initial instances in
pool). When server receives a request for this bean, it refers one instance which is free (not
processing any request) and assigns the client request to process. The bean is said to be in
ready state before processing the client request.
10 What is pooled state?
Considering the same scenario as in question-9 , when the bean is in the pool, i.e., free
without processing any request, is said to be pooled state.
11 What are the different transaction types?
Transaction is set of operation that appears to execute as one large, atomic operation.
Transactions guarantee that an all-or-nothing proposition i.e., either all of your operations
Page 10 of 16
will succeed or none of them will. Transactions account for network and machine failure in
reliable way. Transactions allow multiple users to share the same data and they guarantee the
consistency in data. In brief using Transactions properly operations will always execute with
a suite of four guarantees i.e., ACID properties.
Any Transaction includes four types of participants
1. Transaction Object Application component
2. TransactionManager is responsible for handling transaction operations
3. ResourceManager Manages resources, eg Driver class for any RDBMS
4. Resource is a persistent storage from which we read or write the data.
Transaction are of two types:
1. Flat Transactions: A flat transaction is a series of operations that are performed
automatically as a single unit of work. After the transaction has begin, you can
perform as many operation as required and some may be persistent operations and
some may also be logical operations. And the result is in a binary, i.e., succeeded or
failed. On success the transaction is committed and on failure transaction is rollback.
These transaction operations are taken care by TransactionManager and
ResourceManager of database.
2. Nested Transactions: A nested transaction allows embedding atomic units of work
within other units of work. The unit of work that is nested within other unit of work
can be rollback without forcing entire transaction to rollback.
Transaction Attributes: There are 5 Transaction attributes that can be set to a Bean
1. TX_BEAN_MANAGED : When you use this attribute as your bean transaction
property then your bean should programmatically control its own transactions. To
handle transaction programmatically, you should use Java Transaction API (JTA).
Using this attribute you cant mix different transaction attributes to business methods.
2. TX_NOT_SUPPORTED : Using this attribute means, Bean cannot be involved in a
transaction at all. This should be used only if you are 100% sure that your bean
doesnt need any of ACID properties.
3. TX_REQUIRED : when you use this attribute, means that your bean always
requires transaction. i.e., if theres a transaction running already, the bean joins in
that transaction, else if no transaction is running, the EJB container starts one for it.
4. TX_REQUIRES_NEW: Setting this attribute to bean means that the bean always
want a new transaction to begin when it is called. If there is a transaction already
running when this bean is called, that transaction is suspended during the bean
invocation and a new transaction is started. This new transaction is aborted or
committed after the completion of business method and the old transaction which is
suspended will resume.
5. TX_SUPPORTS: Setting this attribute means that the beans when invoked will join
a transaction if any one is already running or the bean runs without any transaction at
all.
6. TX_MANDATORY : Using this attribute means that the bean will run only if any
transaction is already running, if no transaction is running, the beans throws
Page 11 of 16
TrnasactionRequired exception.
12 Isolation levels
Isolation is one of Transaction property and which is part of ACID properties.
Isolation means controlling concurrent users transaction to be isolated from one another.
Isolation is a guarantee that concurrent users are isolated from one another, ever if they are
touching the same database data.
They are four isolation transaction levels:
1. TRANSACTION_READ_UNCOMMITTED : does not guarantee any isolation.
Leads to a DIRTY READ problem. Because it reads thought the current transaction
is not commited or rollback.
2. TRANSACTION_READ_COMMITED : solves the dirty read problem. But if any
other transaction as updated the data you read ( though after the previous transaction
is commited or rollback) the data which you have will not be consistent, as such the
data is modified. This leads to UNREPEATABLE READ problem.
3. TRANSACTION_REPEATEABLE_READ : solves the unrepeatable read
problem. If any new set of data is inserted into database between two read operations,
so the data which you are holding is not equal. This leads to PHATOM problem.
PHANTOM AND UNREPEATABLE READ are similar, but it is PHATOM if the
data changed contains any new data and UNREPETABLE READ occurs when
existing data has changed.
4. TRANSACTION_SERIALISABLE : this solves all the above problems, but using
this isolation level will predominantly reduces the application performance, because
the database operations will be halted due to this level.
13 ACID properties
ACID stands for Atomicity, Consistency, Isolation and Durability.
Atomicity:
14 What are Coarse-grained and fine-grained Entity Beans
Coarse-grained beans model a complex data that spanning multiple tables.
Fine-grained beans model a single record (single row) in the table
Topic : JSP
1 Why JSPs
JSP is a servlet which is easy to write, maintain and portable across web-servers. Provides
web-developers with a framework to create dynamic content on the server using HTML and
XML templates and java code which is secure, fast, and independent of server platforms.
1. JSPs separates Business and presentation logic
2. Portable across web-servers vendors, as it is based on specifications and portable
across platforms as it is based on java.
3. It is a servlet which is autogenerated by the servlet-container and executed on client
request.
4. JSP specifications provide Custom tag to define our own tags.
Page 12 of 16
5. As it is part of J2EE framework, it can extended using EJBs, JDBC etc.
2 JSP Objects and their functionality
By default a JSP page gets 9 implicit objects to server or process a client request
1. request object : the request object has request scope and is an instance of
javax.servlet.ServletRequest. It encapsulates the request coming from the client and
being processed by the JSP. It is passed to JSP by the container as a parameter to the
_jspService() method.
2. response object : the response object has page scope and is an instance of
javax.servlet.ServletResponse. It encapsulates the response generated by the JSP, to be
sent back to the client. It is passed to JSP by the container as a parameter to the
_jspService() method.
3. pageContext object : the pageContext object has page scope and is an instance of
javax.servlet.jsp.PageContext. It encapsulates the pagecontext for particular JSP page.
This is new class introduced to encapsulate server specific features (usage of high
performace classes like JspWriters). Using features through standard classes makes JSP
portable across different vendor servers.
4. session object : the session object has session scope and is an instance of
javax.servlet.http.HttpSession. It represents the session object of the requesting client
and is only valid for HTTP requests.
5. application Object : the application object has application scope and is an instance of
javax.servlet.ServletContext. This represents the context within which the JSP
executes. It gives information about the server.
6. out object : the out object has page scope and is an instance of
javax.servlet.jsp.JspWriter. This represents the out stream opened for the client
connection.
7. config object : the config object has page scope and is an instance of
javax.servlet.ServletConfig. This represents the configuration of the servlet
8. page object : the page object has page scope and is an instance of java.lang.Object.
This refers to the JSP implementation class, in other words JSP itself, and can be
accessed using this reference.
9. exception object : the exception object has page scope and is an instance of
java.lang.Throwable. It refers to the runtime exception that occurred during the
processing of the request, and is available only error page that resulted out of this
exception.
3 Custom tags
A custom tag is java class which is similar to Java Bean, but subclasses
javax.servlet.jsp.tagextension.TagSupport.
4 What is default value for session object
Session object is created defaultly for each JSP page, though it does not get any session
reference from client. i.e., the session object default value is true.
Page 13 of 16
Topic : Java
1 What is persistent object?
A object whose state can be store in any persistent store ( life files, database) is called
persistent object. In Java any object which implements Serializable interface can be persisted.
2 What is serialization?
Is a process of writing the state of an object to a byte stream. This is useful when the state of a
program to be saved to a persitent storage area, such as a file.
3 How many ways you can create a thread?
Two ways to create a thread
1. by implementing Runnable interface which requires to implement run() mehod.
2. by extending Thread class and can override run() method.
4 How can u declare a method that is not overloaded?
When you declare a method as a final, that cannot be overloaded.
5
Topic : UML
1 What is UML?
1. UML stands for Unified Modeling language.
2. UML is a language for specifying, visualizing and constructing the artifacts of software
system
3. UML represents a collection of Best engineering practices that have been proven as
successful in modeling a large and complex systems.
4. UML is developed by Booch, Jacobson, Rumbaugh. It Unifies their individual work
of building models.
5. A model is an abstraction of a system, where abstraction means throwing away
irrelevant things.
6. UML does not guarantee success.
7. UML is a collection of diagrams for visualization of a system.
Software Structure
Behaviour
Physical organization
2 What is various model diagrams in UML?
UML contains 9 model diagrams. But they come under two categories
1. Structural Diagrams :
Class Diagrams (Classes, interfaces and relationships between them)
Object Diagrams
Component Diagrams
Deployment Diagrams
Page 14 of 16
2. Behavioral Diagrams :
Use-Case Diagrams
Sequence Diagrams
Collaboration Diagrams
Statechart Diagrams
Activity Diagrams
3 Describe each diagram and advantages
1. Use-Case Diagram:
Use case diagrams describe what a system does from the standpoint of an
external observer. The emphasis is on what a system does then how.
Use cases are used during the analysis phase of a project to identify and
partition system functionality. They separate the system into actors and use
cases.
Actors represent roles that can are played by users of the system. Those users
can be humans, other computers, pieces of hardware, or even other software
systems. The only criterion is that they must be external to the part of the
system being partitioned into use cases.
Use cases can also be used during the Test phase of a project life cycle to test
whether the developed system meets the system requirements.
Use cases contains three parts, one Actors, two Use-cases and three
relationships between Actors and Use-Cases
represents Actors
represents Use-Case
represents communication between actors and use-cases.
Advantages:
Determining features ( requirements). Can be used to identify the client
requirements as the system is analyzed and the design takes shape.
Communication with Clients: Their Notation simplicity makes use case
diagrams a good way for developers to communicate with clients
Generating Test Cases : also can be used to suggest a suite of test cases for
those scenarios.
2. Class diagrams :
A class diagram gives an overview of a system by showing its classes and the
relationships among them. Class diagrams are static they display what interacts
but not what happens when they do interact.
Classes are represented with a rectangular box divided into 3 section ClassName,
attributes and operations.
Page 15 of 16
The relationships between two classes can be of the following types:
i. Association : An Association is a bi-directional connection between classes. It is
represented by a solid line.
ii. Aggregation : An Aggregation is the relationship between the whole and its parts.
An aggregation is represented as a line connecting the related classes with a
diamond next to the class representing the whole.
iii. Dependency : A Dependency is a relationship where the client does not have
semantic knowledge of the supplier. A dependency is shown as a dashed line
pointing from the client to the supplier.
iv. Inheritance : Finally there is Inheritance. Inheritance is represented by a line
ending on a triangle on the parent class.
3. Package and Object Diagrams :
4. Sequence Diagrams:
5. Collaboration Diagrams
6. State-chart Diagrams:
7. Activity Diagrams:
8. Component Diagrams:
9. Deployment Diagrams:
Topic : XML
1 What is XML
1. XML stands for eXtensible Markup Language.
2. HTML tags describe how the data should be rendered on a page, where as XML tags
define the data itself.
3. XML tags are not predefined as HTML tags
4. XML uses a Document Type Definition (DTD) or an XML Schema to describe the
data
5. XML with a DTD or XML Schema is designed to be self-descriptive
2 How can XML be Used?
1. XML can Separate Data from HTML
2. XML is used to Exchange Data
3. XML can make your Data more Useful and meaningful
4. XML can be used to Store Data
<ClassName>
<Attributes>
<Operations>
(methods)
Page 16 of 16
3 What is XSL
1. XSL stands for eXtensible Stylesheet Language
2. XSL - The Style Sheet of XML
3. XSL - More than a Style Sheet
XSL consists of three parts:
XSLT (a language for transforming XML documents)
XPath (a language for defining parts of an XML document)
XSL Formatting Objects (a vocabulary for formatting XML documents)
4 What is XSLT?
XSLT is a language for transforming XML documents into other XML or other format
documents.
It can rearrange and sort elements, and test and make decisions about which elements to
display, and a lot more.
5 What is difference between DOM and SAX?
DOM SAX
1. DOM is a tree-based API. SAX is an event-based API.
2. DOM compiles an XML document into an
internal tree structure, then allows an
application to navigate that tree.
SAX, on the other hand, reports parsing
events (such as the start and end of elements)
directly to the application through callbacks,
and does not build an internal tree.
6 What are Web-Services?
WEB services, in the general meaning of the term, are services offered via the Web. In a
typical Web services scenario, a business application sends a request to a service at a given
URL using the SOAP protocol over HTTP. The service receives the request, processes it, and
returns a response.
A Typical Web-Services consists of 3 components :
1. Service Providers
2. Service Brokers
3. Service Requesters
7 What is Cocoon?
Apache Cocoon is an XML publishing framework that raises the usage of XML and XSLT
technologies for server applications to a new level. Designed for performance and scalability
around pipelined SAX processing, Cocoon offers a flexible environment based on a separation
of concerns between content, logic, and style.