0% found this document useful (0 votes)
15 views

2018 Enterprise Architecture Scheme

Uploaded by

knadishasilva
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

2018 Enterprise Architecture Scheme

Uploaded by

knadishasilva
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Marking Scheme

Higher National Diploma in Information Technology


Second Year, Second Semester Examination – 2018

IT2411 - Enterprise Architecture


Instructions to Candidates: Time: Three Hours (03)
Answer five (05) questions only. No. of Pages :03
All Questions carry equal marks No of Question :06

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

II. Name four features of Enterprise Applications (04


Marks)
 Large-scale
 Scalable
 Reliable
 Secure
Any two, 1x 4 marks=4 marks

III. Compare and contrast Object oriented vs Service oriented in termsof


Methodology(04 Marks )

Object-oriented computing

Application development by identifying tightly coupled classes. Application


architecture is hierarchical based on the inheritance relationships.

Service-oriented computing

Application development by identifying loosely coupled services and


composing them into executable applications.
IV. Distributed Multitier Applications has several components. Each component
execute in different locations. Name the locations which execute following
components.

1
(04 Marks )

a. Client-tier components run on the ………….client machine.


b. Web-tier components run on the ……….J2EE server
c. Business-tier components run on the ……………J2EE server
d. Enterprise information system (EIS)-tier software runs on the ………EIS
server.

V. Fill the blanks with suitable terms (4 marks )

a) Service-Oriented Computing (SOC)…………….is an emerging cross-


disciplinary paradigm for distributed computing that is changing the way software
applications are designed, architected, delivered and consumed

b) Service Oriented Architecture……………….. is an architectural style of


building software applications that promotes loose coupling between components
so that you can reuse them and work within a distributed systems architecture

c) Enterprise Computing…………….. that is distributed across the network.


Support the need to build distributed, transactional, and portable applications that
leverage the speed, security, and reliability of server side technology.

d) Web Services …………. is a software application identified by a URI, whose


interfaces and bindings are capable of being defined, described and discovered as
XML artifacts. A Web service supports direct interactions with other software
agents using XML-based messages exchanged via the Internet based protocols

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 )

Public class PrintThread extends ……a…..Thread {


public static void main( String[] args ) {
…….b…PrintThread p = new PrintThread();
p. ..…c …..start();
while(true) { System.out.println( “Now running main thread”); }
}

2
public void run() {
while(true) { System.out.println( “Now running p thread” ); }
}
}

III. Consider the given scenario.

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.

Student( Id :String , FirstName:String, LastName : String, Address : String, Telephone:


int, GPA: float, ATI: String).
Write sample code segments to “Display ID,First Name,Telephone and GPA” of all
students for the following six steps.

1. Load the JDBC Driver // 1 mark


Class.forName("com.mysql.jdbc.Driver");

2. Establish the Database Connection


// 1 mark
final String DB_URL = "jdbc:mysql://localhost/exam";
final String USER = "root";
final String Pass = "";

Connection conn = DriverManager.getConnection(DB_URL,USER,Pass);

3. Create a Statement Object


Statement stmt = con.createStatement(); // 1 mark

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
}

6. Close the Connection


rs.close();
stmt.close();
con.close(); // 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.

b. Web Archives (wars)


To simplify deployment, web app files can be bundled in to a single archive file and
developed to another server merely by placing the archive file in to a specific directory.

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 )

public class fullname extends HttpServlet …..(h)…. {


protected void processRequest(HttpServletRequest ….(i)…. request,
HttpServletResponse
response)throwsServletException, IOException {
response.setContentType …(j)….("text/html;charset=UTF-8");
try (PrintWriter ..(k)….out = response.getWriter()) {
out.println("<!DOCTYPE html>");
out.println("<html>");
out.println("<body>");
out.println("<h1>Display Full Name</h1>");
String fname=request.getParameter ….(l)…("txtFname");
String mname =request.getParameter …(m)…("txtMname");
String lname =request.getParameter …(n)….("txtLname");
String fullName= fname + mname + lname ….(p)…;
out.println("Your Full Nameis: "+ fullName);
out.println("</body>");
out.println("</html>");
} }}

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)

String index =request.getParameter……….(a)……………..("txtindex ");


PreparedStatement ………..(b)……… preparedStatement = con.prepareStatement("Select
grade from result where St_Id=?");
preparedStatement.setString(1,…..(c )….index);
ResultSet rs = preparedStatement.…..(d)…executeQuery();

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

b. Name the interface used in session tracking API


(01 Mark)
javax.servlet.http.HttpSession

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.

I. Name two main categories of JSP elements? ( 2*2 = 04 marks )

Directive elements
Scripting elements

5
Action elements

II. Write output of following codes segments:


(04 Marks)
a) <%! int r=50; %>
<%= "Value of the variable is:"+r %>

b). <%! int areSquear(int n){


return n*n;
}%>
<%= "Are of a Squear with size 5 is: "+areSquear(5) %>

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 )

<%-- hello.jsp --%>


<html>
<head>
<title>Display Message</title>
</head>
<body>
<h1>Welcome Message </h1>
<%
if (request.getParameter ….(a)…("name" … (b)….)== null)

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

I. Name the main components of an XML document. (4 marks )


 Elements
 Content
 Attributes
 Comments

II. What do you mean by well formed XML document?


( 4 marks )
An XML document with correct syntax is called "Well Formed".

III. Briefly explain the term DTD ( 2 marks )


Defines the structure of the content of an XML document, and hence allows storing
data in a consistent format.When an XML document is processed , it is compared to its
associated DTD to ensure it is structured correctly and all tags are used correctly.

IV. Create the DTD for the following tree structure (10 marks )

Vesiting
Card

Person+

Name Designation Company Name Contact

Address
Telephone

Office

Mobil*

<!ELEMENT VisitinCard (Person+)>


<!ELEMENT Person (Name,Designation, CompanyName,Contact)> /
<!ELEMENT Name (#PCDATA)>
<!ELEMENT Designation (#PCDATA)>
<!ELEMENT CompanyName (#PCDATA)>
<!ELEMENT Contact (Address,Telephone)>
<!ELEMENT Address (#PCDATA)>
<!ELEMENT Telephone (Office, Mobil*)>
<!ELEMENT Office (#PCDATA)>
<!ELEMENT Mobil (#PCDATA)>

01 Mark for each line x10= 10 marks

7
Q6.

I. What is an Enterprise Bean? ( 3 marks )


An enterprise bean is a server-side component that encapsulates the business logic
of an application.

II. State two categories of Session Beans. (2 marks )

Stateful Session Beans


Stateless Session Beans

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)…. ;
}

@Local …(e) …….


public interface LoanBeanLocal {
public float calculateInterest(float rate, float time, float amount);
…(f)…..
}

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

V. Briefly explain MVC Architecture

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

You might also like