2018 Enterprise Architecture Scheme
2018 Enterprise Architecture Scheme
Q1.
I. Name two major computing paradigms
(04Marks)
a) Imperative computing
b) Proceduralcomputing
c) Object-Oriented Computing (OOC)
d) Service-Oriented Computing (SOC)
Any two, 2x 2 marks=4 marks
Object-oriented computing
Service-oriented computing
1
(04 Marks )
1x marks=4 marks
Q2.
I. Briefly explain the fallowing terms (2 *2 = 4 marks )
a. Process-based Multitasking
Allows your computer to run two or more programsconcurrently.
b. Thread-based Multitasking
Single program performs two or more tasks simultaneously.
II. In Java, there are the two varieties which threads can implements. Following code
can be used to implement a threat. Fill the blanks.
( 2*3 = 06 marks )
2
public void run() {
while(true) { System.out.println( “Now running p thread” ); }
}
}
Assume that you are using mysql database. Database name is SLIATE. Student is one of
the table in that database.
Student Table structure is given bellow.
4. Execute a Query
ResultSet rs = stmt.executeQuery("SELECT * FROM Student"); // 1 mark
5. Process the Results
while (rs.next()) {//1 mark
int id = rs.getInt(" Id ");
String name = rs.getString("FirstName "); // 1 mark
int Tele= rs.getInt("Telephone ");// 1 mark
float gpa= rs.getFloat(" GPA "); // 1 mark
System.out.print(id + " " + name + " " + Tele+ " " + gpa); //1
mark
}
3
Q3.
I. Briefly explain the fallowing terms (2* 2 =4 marks )
a. Development Descriptor
The web.xml file in the WEB –INF directory is known as a deployment descriptor.
This file contains configuration information about the web app in which it resides. It’s an
XML file with a standardized DTD.
II. Following image is a fragment of a web page named index.html. It is used for
colleting First name, Middle name and Last name. Fill the blanks in the codes in
index.html and “fullname” java Servlet which collect the request from
index.html and display the full name. ( 08 marks )
4
III. Following web page fragment show the findResult.html page. Once user enter the
index number the value pass to servlet page. Find result from “result table” in
“ATI database” and display it to user. Part of the servlet page is given bellow
with blanks. Fill the blanks. Assume you have connected to database.
(04 Marks)
IV. Session tracking is keeping track of what has gone before in this particular
conversation.
a. Briefly explain what is meaning by HTTP is stateless:
(01 Mark)
When it gets a page request, it has no memory of any previous requests from the
same client
c. Fill the blanks in the following code segments which is used in handling the
session tracking API
(02 Marks)
//Create a session:
HttpSession …….(a)….. session = request.getSession();
//Store information in the session
session.setAttribute ………..(b)………(name, value);
Q4.
Directive elements
Scripting elements
5
Action elements
III. Following a JSP code used to get request parameter "name" and display Hello
along with the name extract from the request. If no value sent with the
request display "Hello". Fill the blanks
(06marks )
out.println("Hello");
else
out.println("Hello ….(c)….."+
request.getParameter("name")…..(d)…);
%>
</body>
</html>
IV. A WSDL document describes a web service using major elements. Name two
elements.
Type,message, port Number, Binding, Service port
Any 2, 01 mark x 2= 02 marks
(02 Marks)
V. ASOAP message has two main parts. Name them.
header
body
6
(04 Marks)
Q5
IV. Create the DTD for the following tree structure (10 marks )
Vesiting
Card
Person+
Address
Telephone
Office
Mobil*
7
Q6.
III. Stateless session bean is created for calculate interest amount of a loan when user
enter rate, time(in year) and amount. Following code segments are for LoanBean
and LoanBeanLocal EJBs. Those are have banks. Fill them.(6 marks )
@Stateless
public class LoanBean implements LoanBeanLocal …..(a)… {
public float …(b)… calculateInterest(float rate, float time, float
amount) {
float interest = time * amount * (rate / 100) …..(c)….
;
return interest … (d)…. ;
}
IV. Name an open source framework which match with following descriptions.
a. An Object-Relational Mapping (ORM) solution for JAVA
Hibernate
b. Uses Java Servlet API to implement the web applications based on Model-
View-Controller (MVC) design pattern.
Struts
c. A framework which use a POJO-based programming model.
Spring Framework
03
marks
8
06
marks
Model
The data, the business logic, rules, strategies, and so on
View
Displays the model and often has components to allow users to change the state
of the model
Controller
Allows data to flow between the view and the model
The controller mediates between the view and model