You are on page 1of 132

SCEA PRACTICE QUESTIONS

1. A B ! % " (

Which of the following are true about Active Replication? It is a fault-tolerance mechanism It is achieved by ta ing cold bac ups "ach replica attempts to process each re#uest but e$tra calls may be intercepted via an interceptor &tate changes are logged and periodically flushed to the replicas &tate is synchroni'ed only when the primary service fails "ach replica is identical to the main service.

!hoices A) ! and ( are correct. Active Replication is a fault tolerance mechanism where each replica is identical to the main service and attempts to service each re#uest. An interceptor is used to bloc e$tra responses. Active replication is similar in concept to *ot Bac ups. *ence choices A) ! and ( are correct. Active Replication is not achieved through cold bac ups. In cold bac ups) the replicas are not constantly updated. +heir state is synchroni'ed with the primary service in regular intervals. In the event that the primary service fails) one of the replicas has to be synchroni'ed ,perhaps with data from a storage device- before it can service re#uests. *ence choice B is incorrect. !hoice % refers to the concept of Warm Bac us. In warm bac ups) only the primary service responds to re#uests. *owever all activity is constantly logged. .eriodically these logs may also get flushed to the replicas. When the primary service fails) a replica ta es over after its state is synchroni'ed with the logs. *ence choice % is incorrect. With active replication) as mentioned before) the state of all replicas is constantly synchroni'ed. *ence choice " is incorrect. / A B ! % " Which of the following are benefits of &erver !lustering? Replication *igh &ecurity "asy 0anageability 1oad Balancing (ault +olerance

!hoices A) % and " are correct. +hrough the use of replicas) server clusters increase the reliability and availability of a system. +hey provide a fault tolerance mechanism with load distribution and load balancing capabilities. *ence choices A) % and " are correct. 2/"" applications offer security features through Identification) Authentication and Authori'ation mechanisms. In addition they also provide A.Is that allow secure communication) encryption of messages and so on. +his is not a feature of server clusters though. *ence choice B is incorrect. 0anaging multiple servers is always a harder than managing 3ust one server. *ence easy manageability may not always be true with distributed platforms. With 2/"") due to clear roles and responsibilities of tiers and layers) applications

may be relatively easier to manage than other distributed systems. *owever manageability is not the best asset of distributed systems. *ence choice ! is incorrect. Refer to the following diagram4

In the above diagram4 A B ! % " !lass % implements !lass ! !lass ! implements !lass % Interface ! implements !lass % Interface % implements !lass ! !lass % implements interface !

!hoice " is correct. In the diagram) A and B are classes) ! is an interface and % is a class that implements !. *ence !hoice " is correct. !hoice A is incorrect because 55Interface66 ! is not a class and you can only e$tend classes) not implement them. !hoice B is the reverse of choice A but again incorrect because ! is an interface) not a class. !hoice ! is incorrect because it claims that the interface ! implements class %) whereas in reality class % implements interface !. !hoice % is incorrect because it claims that % is an interface. And ! is a class) while it is the other way round. 7 A B ! % " ( Which of the following are true about .assive Replication? .rimary &ervice and all replicas respond to all re#uests .rimary &ervice randomly delegates re#uests to one of the secondary replicas .rimary service handles all re#uests &tate is periodically synchroni'ed between the .rimary service and all replicas It is similar to hot bac up It is similar to Warm Bac up

!hoices !) % and ( are correct. In .assive Replication) the primary service handles all re#uests. +he state of the replicas is periodically synchroni'ed. In the event that the primary service fails) one of the replicas ta es over after its state is synchroni'ed ,with log files) for e$ample.- In concept) passive replication is similar to that of Warm Bac ups. *ence choices !) % and ( are correct.

8nly in Active Replication) the primary service and all replicas respond to all re#uests. *ence choice A is incorrect. !hoice B seems to indicate that .assive replication uses some ind of load distribution mechanism. *ence choice B is incorrect. .assive replication is similar to warm bac ups as opposed to active replication) which is similar to hot bac ups. *ence choice " is incorrect. 9 A B ! % " !8RBA is a standard for 0essaging using virtual channels called :ueues &tandardi'ed development practices 0essaging using virtual channels called topics Accessing distributed ob3ect systems in many platforms and languages Accessing %istributed ob3ect systems based only on 2ava +echnologies

!hoice % is correct. !ommon 8b3ect Re#uest Bro er Architecture ,!8RBA- is a standard for distributed communication involving applications written using different languages. *ence choice % is accurate. :ueues are the mechanism by which two parties communicate in a .oint-to-.oint asynchronous messaging paradigm. *ence choice A is incorrect. !hoice B indicates that !8RBA is a methodology) as opposed to a standard and is incorrect. +opics are the mechanism through with .ublish &ubscribe messaging is accomplished. !hoice ! is incorrect. Although choice " tal s about distributed ob3ect systems) it is referring to pure 2ava ob3ects. !8RBA is used ob3ect distribution involving different languages. *ence choice " is incorrect. ; A B ! % R0I-II8. does not provide which of the following capabilities? Remote 0ethod Invocation &tub %ownloads 8b3ects pass by value ,state only%istributed <arbage !ollection

!hoices B and % are correct. R0I-II8. does not support &tub downloads and distributed garbage collection. *ence choices B and % are correct. Both Remote 0ethod Invocation and 8b3ects pass by value are supported by R0I-II8.. *ence choices A and ! are incorrect. = A B ! % Which of the following are not true about &creen &crapers? &creen scrapers function as +erminal "mulators on one end and as 8b3ect Interfaces on the other. &creen &craping may be a useful tool when used in con3unction with the off-board servers. !hanges to legacy >I has little or no impact on the new <>I &creen &craping is best used when the legacy clients have loose coupling with other tiers.

!hoices ! and % are correct. When using screen scrapers) any changes to the legacy user interface will also affect the new <>I. Also screen scraping is the best alternative only if the e$isting >I is very tightly coupled with the business tier of the legacy application. *ence choices ! and % are false and therefore the correct choices. !hoices A and B are true about screen scrapers and hence incorrect.

? A B ! % "

Which of the following methods may be present in the *ome Interface of an "ntity Bean? create,findBy.rimary@ey,remove,locateBy.rimary@ey,retrieveBean,-

!hoices A) B and ! are correct. +he *ome Interface provides methods for creation) location and removal of beans. *ence you could find create,-) findBy.rimary@ey,- and remove,- methods in the beanAs *ome Interface. !hoices A) B and ! are therefore correct. +here are no methods li e locateBy.rimary@ey,- and retrieveBean,- in the *ome Interface. *ence choices % and " are incorrect. B A B ! % >ndefined .rimary @eys refers to? Refers to "ntity Beans that do not use .rimary @eys .rimary @eys that are defined during development .rimary @eys that remain undefined until the bean is deployed "ntity Beans cannot have undefined .rimary @eys

!hoice ! is correct. 8ne problem with container-managed persistence in "2B 1.C was that the bean developer had to define the primary ey during development. +his forced the developer to ma e assumptions thus limiting the beanAs portability across databases. "2B 1.1 allows the primary ey to remain undefined until deployment. *ence choice ! is correct. !hoice A is incorrect because all entity beans must have a seriali'able primary ey that can be used to uni#uely identify an entity bean in the database. >ndefined .rimary @eys are not defined during development. *ence choice B is incorrect. !hoice % is incorrect because it indicates that "ntity Beans are not allowed to have undefined .rimary @eys. +his was true in "2B1.C but not in "2B1.1. D A B ! % Which of the following are valid life cycle states for a &tateless &ession Bean? %oes not "$ist .ooled &tate 0ethod Ready .ool .assive

!hoices A and ! are correct. +he two valid states in a &tateless &ession BeanAs life cycle are A%oes Eot "$istA and A0ethod Ready .ool.A When Beans are not instantiated they are said to be in the A%oes Eot "$istA state. Beans transition from A%oes Eot "$istA to A0ethod Ready .oolA when instantiated. +he container does this automatically) as needed. *ence choices A and ! are correct. .ooled and .assive are not valid states in the lifecycle of a &tateless &ession Bean. *ence choices B and % are incorrect. 1C A Both !0+ and B0+ may be used with "ntity and &ession Beans. +rue or (alse? +rue

(alse

!hoice B is correct With "2B1.1 only &ession Beans with 5transaction-type6 e#ual to ABeanA can have bean-managed transactions. "ntity Beans are not allowed to be B0+ beans. *ence choice B is correct.

11 A session bean called &omeBean has a method called some0ethod,-) which calls some8ther0ethod ,same bean- followed by some8therBean0ethod,- of &ome8therBean. &ome8therBean is an "ntity Bean with !0+. Which of the following is true? A &ome8therBean has no control on the transaction since it is a !0+ bean. B &ome8therBean has full access to the >ser+ransaction ob3ect through which it can control the transaction. ! &ome8therBean has access only to the transaction methods in "2B!onte$t) which gives it the power to veto transactions. % &ome8therBean has access on the transaction only if the method had Re#uiresEew set as its transaction attribute. !hoice ! is correct. 8nly B0+ beans have access to the >ser-+ransaction from the "2B!onte$t. +he "2B!onte$t provides the methods setRollbac 8nly,- and getRollbac 8nly,-) to provide !0+ beans access to the transaction. +he setRollbac 8nly,method gives a bean the power to veto a transaction. *ence choice ! is correct. !hoice A is incorrect because the entity bean has the capability to veto the transaction. !hoice B is incorrect because !0+ beans only have the power to veto user transactions. !hoice % ma es an incorrect argument and is thus wrong.

1/ A B ! %

Which of the following is not a resource management techni#ue? 0aintaining a smaller pool of &tateless Beans to serve a large number of clients. .roviding %atabase !onnection .ooling .ersistence of "ntity Beans .assivation of &tateful Beans

!hoice ! is correct. .ersistence of "ntity beans is the ability to save data represented by the bean into a database. It is not a resource management techni#ue. !hoice ! is false and therefore correct. 0aintaining a smaller number of beans to serve a larger number of clients is a very clever resource management techni#ue. It is also an e$ample of the (lyweight %esign .attern. !hoice A is thus a resource management techni#ue and therefore incorrect. %atabase connection pooling) a similar concept as bean pools) is also a good resource management techni#ue. !hoice B is therefore incorrect. With &tateful &ession Beans) the container uses passivation to manage memory. In passivation the state of the bean is seriali'ed and its memory freed up for reuse by other services. *ence bean passivation is a memory management techni#ue ma ing choice % incorrect.

17 A B ! % " ( <

Which of the following are invalid states in the life of a &tateful &ession Bean? %oes Eot "$ist 0ethod Ready .ool 0ethod Ready in +ransaction 0ethod Ready Ready .ooled .assive

!hoices B) " and ( are correct. +he valid life cycle states of a &tateful &ession Bean are A%oes Eot "$istA) A0ethod ReadyA) A0ethod Ready in +ransactionA and A.assiveA. A0ethod Ready .oolA is a life cycle state of &tateless &ession Beans. A.ooledA and AReadyA are life cycle states of "ntity Beans. *ence choices B) " and ( are correct. 19 A B ! % What is the se#uence of steps in the life cycle of a &tateless &ession Bean? class.newInstance,-) set&ession!onte$t ,ct$-) e3b!reate,e3b!reate,-) set&ession!onte$t ,ct$-) class.newInstance,class.newInstance,-) e3b!reate,-) set&ession!onte$t ,ct$set&ession!onte$t ,ct$-) e3b!reate,-) class.newInstance,-

!hoice A is correct. When &tateless &ession Beans transition from A%oes Eot "$istA to A0ethod Ready .oolA) the container invo es newInstance,-) set&ession!onte$t,- and e3b!reate,- methods. *ence choice A is correct. Although choices B) ! and % have the same methods) the order in which they appear to be called is wrong. +herefore choices B) ! and % are incorrect. 1; A B ! % *++.& is defined as *++. with &ecurity *++. on secure line *++. over &&1 *++. with &&1

!hoice ! is correct *++.& stands for *++. over &&1. With *++.&) &&1 sits above the +!.-I. layer and below the application protocol layer. *ence choice ! is correct. 1= A B ! % " *++. is !onnection 1ess !onnection Base &tateful &tateless &ecure

!hoice B and % are correct.

*++. ,*yper+e$t +ransfer .rotocol- is a transport mechanism for 0I0" ,0ultipurpose Internet 0ail "$tensionsdocuments. 0I0" documents often contain *+01 ,*yper+e$t 0ar up 1anguage- code for display in browser windows. *++. consists of a re#uest sent by the client to the server) followed by a response sent from the server bac to the client. *++. uses +!.FI. as the underlying transport and networ protocols. +he following is ta en from4 http4FFwww.w7.orgF.rotocolsFActivity.html GWhenever a client accesses a document) an image) a sound bite etc. *++.F1.C creates a new +!. connection and as soon as it is done) it is immediately dismissed and never reused.G G*++.F1.1 fi$es this in two ways. (irst) it allows the client to reuse the same +!. connection ,persistent connectionsagain and again when tal ing to the same server. &econd) it ma es sure that the courier carries as much information as possible ,pipelining- so that it doesnAt have to run bac and forth as much. +hat is) not only does *++.F1.1 use less +!. connections) it also ma es sure that they are better used. +he result is less traffic 3am and faster delivery.G +he following is ta en from4 http4FFwww.w7.orgF.rotocolsF*++.F*++./.html G*++. is a protocol with the lightness and speed necessary for a distributed collaborative hypermedia information system. It is a generic stateless ob3ect-oriented protocol) which may be used for many similar tas s such as name servers) and distributed ob3ect-oriented systems) by e$tending the commands) or AmethodsA) used.G *ence choices B and % are correct. &ince choices A and ! are the opposite) they are incorrect. *++. can be made secure by using A*++. over &&1A or *++.&. But by itself) *++. is not secure. *ence choice " is incorrect.

1? A B ! %

Asynchronous communication is achieved by using4 Remote .rocedure !alls R0IFII8. 0essage 8riented 0iddleware !8RBA

!hoice ! is correct. 0essage 8riented 0iddleware or 080 is used for asynchronous messaging between applications. 0ost popular implementations support .oint to .oint ,one to one- and .ublish &ubscribe ,one to many- messaging. *ence choice ! is correct. Remote .rocedure !alls are used for synchronous communication between applications. !8RBA and R0IFII8. are two protocols that support R.! based communication. *ence choices A) B and % are incorrect.

1B A B ! %

Which of the following is not part of the 0essaging architecture4 %ecentrali'ed messaging using I. 0ulticasting %ecentrali'ed messaging using &ecure &oc ets 1ayer ,&&1>se of virtual channels called :ueues >se of virtual channels called +opics

!hoice B is correct. 8nly choice B is not a standard paradigm in messaging architecture. *ence choice B is correct. I. 0ulticasting can be used as a techni#ue for decentrali'ed messaging. :ueues and +opics are used with .oint to .oint and .ublish &ubscribe messaging. *ence choices A) ! and % are incorrect.

1D A B ! %

In ./.) clients send messages to4 A designated #ueue 0ultiple :ueues A specific node for redistribution to subscribers !8RBA compliant 8RB

!hoice A is correct. ./. or .oint to .oint messaging is used for one to one communication between two components or applications. In the ./. model) message producers send messages to a designated #ueue. *ence choice A is correct. Although it is possible to mimic .ublish &ubscribe architecture by sending ./. messages to multiple #ueues) it is not a standard practice. *ence choice B is incorrect. In .ublish &ubscribe architecture) messages are sent to a specific node for redistribution to subscribers. *ence choice ! is incorrect. !8RBA is an R.! protocol and is not used for asynchronous messaging. *ence choice % is incorrect.

/C *appy 2oe Ban ing !orporation is building a Ban ing application to provide online access to their account holders. +hey have chosen / &>E 9;Cs for their web server cluster and 1 &>E "1CCCC for their application server. +he business re#uirements indicate that to become a customer) a person must have at least a primary chec ing account with the ban . (urther since the customer will be using the Internet to view confidential information) security is considered paramount. What do you understand about the re#uirements of the system? A +he need for &ecurity is a classic e$ample of a functional service level re#uirement and the chec ing account rule) an e$ample of non-functional :o& re#uirement. B +he discussion about &ecurity and the mandatory chec ing account both illustrate functional service level re#uirements. ! Eeither &ecurity nor the mandatory !hec ing Account is an e$ample of any ind of re#uirements) theoretically spea ing. % &ecurity is an Architectural non-functional re#uirement and the 0andatory !hec ing Account a functional design re#uirement. " +hey are both e$amples of Business >se !ases. !hoice % is correct. &uccessful software architecture deals with addressing the non-functional service level re#uirements of a system. +he %esign process ta es all the functional business re#uirements into account. &ecurity is considered a non-functional re#uirement and specific business rules) such as the one described with the chec ing account are considered functional re#uirements. % is the only choice that accurately describes this. A is incorrect because the functional and non-functional re#uirements are flipped over. B is incorrect because only one of them is a functional re#uirement. ! is incorrect because as described above) one of them is a functional re#uirement and the other) a non-functional re#uirement. (inally " is incorrect because business analysis may start with use cases ,where the chec ing account rules may be captured-) but this discussion is specifically #uestioning functional vs. non-functional re#uirements.

/1 In an interview between the senior management of *appy 2oe Ban ing !orporation and the 2/"" application architect &cott @hosla) the following points were discussed4 I. +he system needed to respond within ; seconds II. +he system is needed to have a DD.DH uptime III. *2B! was in the process of ac#uiring another ban which would add two hundred thousand customers to their already e$isting half million. II. "ach phase of the &%1! was to have a clear sign off process. I. +he development team was e$pected to provide a detailed unit test plan and user documentation. II. In order to ensure privacy) *++.& was to be used. // A B ! % " What non-functional re#uirements were discussed? &calability) Availability) "$tensibility) 0anageability and &ecurity .erformance) Reliability) "laboration) +ransition) %ocumentation and &ecurity &pecification) "laboration) !onstruction) +ransition) >se !ases and &ecurity .erformance) Availability) &calability and &ecurity Reliability) Availability) &calability) 0anageability and &ecurity

!hoice % is correct. +he non-functional service level re#uirements discussed are .erformance ,system needs to respond within ; seconds-) Availability ,system is needed to have a DD.DH uptime-) &calability ,additional two hundred thousand subscribers-) and &ecurity ,*++.& is to be used.- *ence choice % is correct. +here is no mention of e$tensibility ,ability to easily add or e$tend functionality- and 0anageability ,ability to monitor the health of the system.- *ence choice A is incorrect. &pecification) "laboration) !onstruction) +ransition) %ocumentation and use cases are not non-functional service level re#uirements. *ence choices B and ! are incorrect. While scalability and reliability may be related ,will the system perform as reliably when more users operate on it-) there is no mention of reliability in the #uestion. *ence choice " is incorrect.

/7 E-tier applications show better performance than /-tier applications because they are modular in nature) which means that they can be scaled easily) by tuning components and containers individually. +rueF(alse ? A B +rue (alse

!hoice A is correct. E-+ier applications ,especially those based on 2/""- are designed to be very modular in nature. +he tiers and layers separate roles and responsibilities of each component and container. *ence components and containers can be individually targeted and scaled as needed. +his results in better performance. *ence choice A is correct.

/9 0oon 0icrosystems has a web-based solution that was originally built using &ervlets. *owever) in recent months) the I& manager has as ed developers to use 2&. technology with 2ava &criptlets embedded in *+01 code. &cott @hosla) the architect) however is insisting that the code be modulari'ed and that "2Bs be used instead of &ervlets and 2&. for business logic processing. In as ing developers to modulari'e e$isting code) what software development techni#ue is &cott as ing the developers to follow? A B ! % !ode Brea up !ode engineering !ode +iering !ode (actoring

!hoice % is correct. &oftware applications have a tendency to grow in comple$ity over time. When that happens) they become difficult to e$tend) maintain and modify. +hey also become hard to understand. !ode factoring is a modulari'ation techni#ue that deals with the separation of responsibilities in code. (actored code has loose coupling and minimal dependencies) ma ing components and code more reusable. *ence choice % is correct. +here are no concepts li e code brea up) code engineering or code tiering. *ence choices A) B and ! are incorrect.

/; Refer to the following e$hibit In >01)

A B ! %

,i- represents an ob3ect and ,ii- a class ,ii- represents a pac age and ,i- a class ,i- represents a class and ,ii- an ob3ect ,i- and ,ii- both represent components

!hoice ! is correct. In the above diagram Aclass represents a class and4 Aclass represents an ob3ect. *ence choice ! is correct.

/=

AAA has a dependency with ABA is best e$pressed by4

8ption a

B ! % " ( <

8ption b 8ption c 8ption d 8ption e 8ptions b and d 8ptions d and e

!hoice % is correct. 8ption % shows a diagram with two pac ages A and B. .ac age A has a dependency with .ac age B. *ence choice % is correct. In option A) class A e$tends class B. *ence choice A is incorrect. In option B) class A implements interface B. *ence choice B is incorrect. In option !) class A has an association relationship with interface B. *ence choice ! is incorrect. In option ") .ac age B has a dependency with .ac age A. *ence choice " is incorrect. &ince options B and " are incorrect) choices ( and < are incorrect. /? Refer to the following e$hibit

(rom the following diagram it can be deduced that4

A B ! %

!hanges to classes in the !ustomer pac age may only impact the 8rder pac age !hanges to classes in the !ustomer pac age will impact 8rder and 8rder1ine pac ages. !hanges to the 8rder1ine pac age will impact the !ustomer pac age !hanges to the !ustomer pac age will have no impact on the other two pac ages

!hoice A is correct. +he pac age 8rder has a dependency with the pac age !ustomer. *ence any changes in the !ustomer .ac age could impact the 8rder .ac age. *ence choice A is correct. ,(owler 1CD-GA dependency between two pac ages e$ists if any dependency e$ists between any two classes in the pac ages.G &ince !ustomer and 8rder1ine have no dependencies) choices B and ! are incorrect. !hanges to the !ustomer pac age may impact the 8rder pac age. *ence choice % is incorrect.

/B

Refer to the following e$hibit

(rom the e$hibit) it can be inferred that

A B ! % "

1 A can have / Bs associated with it 1 A can have 9 Bs associated with it 1 A can have / to 9 Bs associated with it 1 A can have e$actly / or 9 Bs associated with it +he multiplicity indicated is only legal in the Booch method) not in >01

!hoices A) B and % are correct. +he multiplicity between A and B shown by ,/)9- indicates that an A may have e$actly / or 9 Bs associated with it. *ence choices A) B and % are correct. !hoice ! is incorrect because a / to 9 multiplicity would be indicated as ,/..9+he multiplicity shown is perfectly legal in >01. !hoice " is therefore incorrect.

/D (ragile 8ars) a manufacturer of boating supplies has a mainframe based legacy application for customer and order management. Recently) (ragile 8ars embar ed on a pro3ect to add Internet presence to its products and services and hence created a company website. &ince then) its management has reali'ed the importance of having an e(ront and wants to start conducting business over the Internet. (ragile 8ars wants to use Applets as the front-end. What is the best method to connect to this legacy system? A B ! % >sing the same applets >sing different applets >sing 2ava &erver .ages >sing 2ava &ervlets

!hoice % is correct. +he best approach in this case is to have the applets tal to &ervlets that can act as mediators between the applets and the 1egacy system. *ence choice % is correct. Applets and 2&. are used to construct the view of an 0I! application. +hey should not be used as controllers for dispatching re#uests. *ence choices B and ! are incorrect.

7C Baby Bell is a new local +elephony provider in !hicago) I1. It has a legacy application for the B/B transactions with Ieri'on) the Incumbent 1ocal "$change !arrier ,I1"!.- Baby Bell fre#uently purchases bloc s of +elephone numbers from the I1"! using a !8RBA R.! call. +here numbers are then assigned to the customers in se#uence. &ometimes customers re#uest vanity numbers) in which case) a custom synchronous #uery is made on the I1"!As operational support system) to chec for numberAs availability. If Baby Bell were to rewrite its e$isting legacy code using newer 2/"" technology) what technology would you choose so that both the bloc purchase and the individual #uery might be accommodated? A B ! % " ( 2ava Applet technology for the !8RBA call and custom soc et programming for vanity number re#uests. 2ava &ervlet A.I for the !8RBA call and 2&. for the custom soc et programming "ntity "2Bs for both &ession "2Bs for both 2E%I for both 0: &eries with a 20& based solution for both

!hoice % is correct. &ession beans can be used for ma ing both the !8RBA call for bloc purchase of telephone numbers and the custom synchronous call to re#uest a special vanity number. *ence choice % is correct. Both operations represent business processes involving partner 8&&. integration. Applets are not used for modeling the business wor flow of a system. *ence choice A is incorrect. 2&. represent the view construction process in an 0I! application. +hey should not be used for processing business logic. *ence choice B is incorrect. "ntity beans represent the business model of an application and provide a representation of enterprise data. +hey are not to be used for wor flow processing which is better accomplished by using &ession Beans. *ence choice ! is incorrect. 2E%I provides Eaming and %irectory interfaces not wor flow processing. *ence choice " is incorrect. +he #uestion specifically says that a synchronous mechanism is to be used for the vanity number re#uest. +he !8RBA R.! call for +E reservation is also synchronous. 0: &eries is a 080 used for messaging. 0essaging is an inherently asynchronous communication mechanism. *ence choice ( is incorrect.

71 2ulia (ractals Inc. is building a 2/"" based application for 8rder "ntry and management of their fractal software. 8nce the order is ta en) it is submitted to a relational database. A provisioning system then #ueries data and ma es appropriate calls to various subsystems using 20& on 0: &eries. What design pattern is 20& an e$ample of here? A B ! % " 8bserver 0ediator Adapter Bridge Iisitor

!hoice % is correct. Bridge ,<8( 1;1-G%ecouple an abstraction from its implementation so that the two can vary independently.G In this case 20& is the abstraction. +he implementation could be 0: &eries) +IB!8 Rende'vous and Iitria Businessware. *ence choice % is correct. 8bserver ,<8( /D7-G%efine a one-to-many dependency between ob3ects so that when one ob3ect changes state) all its dependents are notified and updated automatically.G *ence choice A is incorrect. 0ediator ,<8( /?7-G%efine an ob3ect that encapsulates how a set of ob3ects interact. 0ediator promotes loose coupling by eeping ob3ects from referring to each other e$plicitly) and lets you vary their interaction independently.G *ence choice B is incorrect. Adapter ,<8( 17D-G!onvert the interface of a class into another interface clients e$pect. Adapter lets classes wor together that couldnAt otherwise because of incompatible interfaces.G *ence choice ! is incorrect.

Iisitor ,<8( 771-GRepresent an operation to be performed on the elements of an ob3ect structure. Iisitor lets you define a new operation without changing the classes of the elements on which it operates.G *ence choice " is incorrect.

7/ A B ! % "

What design pattern best e$plains the use of the stub and the s eleton in !8RBA based R.! applications? (actory 0ethod &ingleton &trategy .ro$y %ecorator

!hoice % is correct. .ro$y ,<8( /C?-G.rovide a surrogate or placeholder for another ob3ect to control access to it.G *ence choice " is incorrect. +he applicability section ,<8( /CB- defines Aremote pro$yA asGA remote pro$y provides a local representative for an ob3ect in a different address space.G >sing the stub and the s eleton) !8RBA based applications provide local representatives for distributed ob3ects. *ence choice % is correct. (actory 0ethod ,<8( 1C?-G%efine an interface for creating an ob3ect) but let subclasses decide which class to instantiate. (actory method lets a class defer instantiation to subclasses.G *ence choice A is incorrect. &ingleton ,<8( 1/?-G"nsure a class only has one instance) and provide a global point of access to it.G *ence choice B is incorrect. &trategy ,<8( 71;-G%efine a family of algorithms) encapsulate each one and ma e them interchangeable. &trategy lets the algorithm vary independently from clients that use it.G *ence choice ! is incorrect. %ecorator ,<8( 1?;-GAttach additional responsibilities to an ob3ect dynamically. %ecorators provide a fle$ible alternative to subclassing for e$tending functionality.G *ence choice " is incorrect.

77 An application has three &tateless &ession Beans - &B1) &B/ and &B7. +he stubs that implement the respective *ome Interfaces are &*1) &*/ and &*7. A client application performs a 2E%I loo up to obtain a reference to one of these *ome 8b3ects. +his is then narrowed and used to create the remote reference to the corresponding remote ob3ect. What design pattern best e$plains the creation of the Remote 8b3ect) in this case? A B ! % " .rototype Builder (actory 0ethod Business delegate &ervice 1ocator

!hoice ! is correct. (actory 0ethod ,<8( 1C?-G%efine an interface for creating an ob3ect) but let subclasses decide which class to instantiate. (actory method lets a class defer instantiation to subclasses.G *ence the closest pattern this concept is similar to is the (actory 0ethod pattern. +herefore choice ! is correct. .rototype ,<8( 11?-G &pecify the inds of ob3ects to create using a prototypical instance) and create new ob3ects by copying this prototype.G *ence choice A is incorrect. Builder ,<8( D?-G&eparate the construction of a comple$ ob3ect from its representation so that the same construction process can create different representations.G *ence choice B is incorrect. +he following is ta en from4 http4FF3ava.sun.comFblueprintsFpatternsFBusiness%elegate.html

GIn distributed applications) loo up and e$ception handling for remote business components can be comple$. When applications use business components directly) application code must change to reflect changes in business component A.Is. +hese problems can be solved by introducing an intermediate class called a business delegate) which decouples business components from the code that uses them. +he Business %elegate pattern manages the comple$ity of distributed component loo up and e$ception handling) and may adapt the business component interface to a simpler interface for use by views.G *ence choice % is incorrect. +he following is ta en from4 http4FF3ava.sun.comFblueprintsFpatternsF&ervice1ocator.html G"nterprise applications re#uire a way to loo up the service ob3ects that provide access to distributed components. 2avaJ / .latform) "nterprise "dition ,2/""- applications use 2ava Eaming and %irectory Interface ,2E%I- to loo up enterprise bean home interfaces) 2ava 0essage &ervice ,20&- components) data sources) connections) and connection factories. Repetitious loo up code ma es code difficult to read and maintain. (urthermore) unnecessary 2E%I initial conte$t creation and service ob3ect loo ups can cause performance problems. +he &ervice 1ocator pattern centrali'es distributed service ob3ect loo ups) provides a centrali'ed point of control) and may act as a cache that eliminates redundant loo ups. It also encapsulates any vendor-specific features of the loo up process.G *ence choice " is incorrect.

79 When remote calls are made on the container provided implementations of the "2B*ome and "2B8b3ect) various transactional and security chec s are applied before the call is actually passed on to the bean instance. +he !ontainer provided implementations of "2B*ome and "2B8b3ect are performing what %esign .atternAs tas ? A B ! % " !ommand Adapter Bridge %ecorator (acade

!hoice % is correct. +he intent of the %ecorator pattern as described by <8( ,1?;- -GAttach additional responsibilities to an ob3ect dynamically. %ecorators provide a fle$ible alternative to subclassing for e$tending functionality.G A re#uest intended for a component is routed to the decorator instead. +he decorator forwards the re#uest to the component. It may perform pre or post processing tas s before or after forwarding the re#uest. 2/"" is filled with e$amples of the use of design patterns. +he container provided implementations of "2B*ome and "2B8b3ect decorate bean classes by providing transactional and security functionalities. !hoice A is incorrect because !ommand is used to encapsulate a re#uest as an ob3ect ,<8( /77.- !hoice B is incorrect because Adapter ,<8( 17D- converts the interface of a class into another interface clients e$pect. !hoice ! is incorrect because Bridge ,<8( 1;1- decouples an abstraction from its implementation so that the two can vary independently and choice " is incorrect because (aKade ,<8( 1B;- provides a unified interface to a set of interfaces in a subsystem.

7; !ompact !omputers is a small computer assembly company. +heir online application allows customers to pic and choose accessories to build their own .!s. +he accessories are4 i. .rocessor - BCC0h') 1<h') 1./<h'

ii. *%% - 9C <B) =C <B) BC <B iii. 0emory - 1/B 0B) /;= 0B) ;1/ 0B If a computer can have e$actly 1 processor) 1 *%% and 1 memory stic ) what pattern would be best used here? A B ! % " (actory 0ethod Builder .rototype Abstract (actory &ingleton

!hoice B is correct. Builder ,<8( D?- separates the construction of a comple$ ob3ect from its representation so that the same construction process can create different representations. *ere the comple$ ob3ect is a computer. A computer is always made up of e$actly one processor) one *%% and one 0emory stic ,problem description.- *owever there is no predetermined formula for combining the parts. *ence Builder is the best pattern here and B is therefore the right answer. Answer A is incorrect because (actory 0ethod ,<8( 1C?- defines an interface for creating an ob3ect but lets subclasses decide which class to instantiate. Lou may use factories of factories to construct a comple$ ob3ect) but by itself) the (actory method is good for creating one out of many. "$ample4 create one processor out of a set of three processors. Answer ! is incorrect because .rototype ,<8( 11?- specifies the inds of ob3ects to create using a prototypical instance. "$ample4 <iven a processor) if you were as ed to create a computer that used multi processors) this would be a good option. Answer % is incorrect because Abstract (actory ,<8( B?- provides an interface for creating a family of related or dependent ob3ects. If the #uestion had defined a relation such as AA computer of BCC 0*' processor can only be coupled with a 9C <B *%% and 1/B 0B RA0 stic A) this would have been an ideal solution. Answer " is incorrect because &ingleton ,<8( 1/?- ensures that a class has only one instance ,or a well-defined number of variable instances- and appropriate global pointers are available to the instance,s-.

7= Ibid is an e-auction house that auctions refurbished products. "ach product has a minimum bid price. Buyers can #uery the system for a list of products and then select a product to bid on. +hey can then place a higher bid on the selected product. +ransactional Integrity is very important as dirty reads) non-repeatable reads and phantom reads can lead to data inconsistency. What technology combination might be most suitable for addressing IbidAs needs? A Applets for presentation and 2+AF2+& for transactional integrity B *+01 and 2&. for presentation) and &ervlets for data retrieval and transaction management. ! &ervlets and 2&. for presentation) a stateful session bean with %A8 for list retrieval and a stateless session bean for transaction management. % &ervlets and 2&. for presentation) a stateless session bean with %A8 for list retrieval and !0+ "ntity bean for +ransaction management. " &ervlets and 2&. for presentation) and a 2ava class to encapsulate database access and transaction management. !hoice % is correct. +he 0odel / architecture ,based on the 0odel Iiew !ontroller pattern- suggests that &ervlets and 2&. be used in the presentation tier. 2&. combine template data with dynamic data to display dynamic content to the user. &ervlets act as front controllers) and forward re#uests to appropriate events in the business logic tier. >nless concurrent use of shared data is involved) it may be an over ill to use "ntity beans ,as in the e$ample of a simple list retrieval.- +he list retrieval

is therefore best accomplished by using a session bean with a %ata Access 8b3ect ,%A8.- &ince the bidding represents concurrent use of shared data) this is best accomplished by using an "ntity bean. !hoice A is incorrect because this would not be an ideal application for applets. !hoice B is incorrect because it suggests the use of &ervlets for all retrieval and updates. Although possible) this is not recommended in the 2/"" best practices as an ideal way when dealing with comple$ applications. !hoice ! is incorrect because it is suggesting that a stateless session bean be used for managing concurrent access to shared data) something best done by entity beans. !hoice " is incorrect because though it may be suited for smaller applications that are not very transactional in nature) the discussion specifically tal s about the need for transactional integrity. +herefore this is not the recommended solution.

7? *eartbrea *ospital has two applications - .atient Registration &ystem and .atient Billing &ystem. .atient Billing) an older application has !8RBA interfaces for updating Billing Information. +he newer .atient Registration system was built as a 2ava based Application. *eartbrea now wants to automatically update Billing Information from the .atient Registration Application. What 2ava technology may be most suited for this? A B ! % " ( R0I-2R0. R0I-2EI R0I-II8. "2B 2ava I%1 2ava-!8RBA Bridge

!hoice " is correct. +he following is ta en from4 http4FF3ava.sun.comF3/seF1.7FdocsFguideFidlF G2ava I%1 adds !8RBA ,!ommon 8b3ect Re#uest Bro er Architecture- capability to the 2ava platform) providing standards-based interoperability and connectivity. 2ava I%1 enables distributed Web-enabled 2ava applications to transparently invo e operations on remote networ services using the industry standard I%1 ,8b3ect 0anagement <roup Interface %efinition 1anguage- and II8. ,Internet Inter-8RB .rotocol- defined by the 8b3ect 0anagement <roup.G *ence choice " is correct. R0I-2R0. is used for distributed processing in a pure 2ava environment. *ence choice A is incorrect. +here is no indication whether the .atient Billing system supports 2EI. *ence choice B is incorrect. R0I-II8. is useful when dealing with "2B applications. *ence choices ! and % are incorrect. +here is no such thing as a 2ava-!8RBA bridge. +he 2ava I%1 A.I performs that function. *ence choice ( is incorrect.

7B In which of the following cases would an application not necessarily benefit from the use of "nterprise 2ava Beans? A B ! % &mall &cale deployment 1arge scale deployment +ransactional in nature Eo +ransactional re#uirements

!hoices A and % are correct. "nterprise 2ava Beans are best used with large and comple$ enterprise applications with high deployment and transactional re#uirements. *ence choices A And % are correct.

7D A B ! %

+he container applies what memory management techni#ues in the case of &ession Beans? Bean .ooling Bean .assivation Bean .ersistence Bean .urge

!hoices A and B are correct. While "2Bs offer business services) "2B !ontainers offer many peripheral services such as memory management) persistence) transactions and so on. Bean .ooling ,in the case of &tateless &ession Beans- and Bean .assivation ,in the case of &tateful &ession Beans and "ntity Beans- are two techni#ues the container uses for managing memory. *ence choices A and B are correct. Bean persistence refers to persisting the data represented by "ntity Beans to physical storages such as Relational) 8b3ect or other databases. It has nothing to do with memory management. +herefore choice ! is incorrect. +here is nothing called Bean .urge. Beans are removed when the client calls the remove,- method on the *ome Interface ,&tateful &ession Beans- and when the container decides ,in the case of &tateless &ession Beans and "ntity Beans which reside in Bean .ools when not in use.- In the case of "ntity Beans) the remove,- method also deletes the data the bean instance represents. *ence choice % is incorrect.

9C 8utstanding .erf is a perfume manufacturing company. +he management is currently in the process of architecting a new 2/"" based solution for their online catalog. If performance is paramount and session state needs to be managed as well) it would be preferable to use *++. and *++.&ession ob3ect as opposed to using *++.&. +rueF(alse? A B +rue (alse

!hoice A is correct. +he #uestion specifies that performance is important. +here is no mention of the security re#uirements. Apart from providing &ession &tate) *++.& includes additional functionality for allowing secure communication between the client and the server. Because of all the e$tra processing with encryption and decryption) *++.& is slower than *++.. *ence in this case) it may be preferable to use *++. ,which is stateless- with *++.&ession 8b3ect ,to store state on the server.- *ence choice A is correct.

91 &talede$ho) A renowned catering company has 3ust contracted your services to trac their orders. An online menu is available) for each country serviced. !ustomers choose what they want) the #uantity and provide relevant billing information. (ed "$ ships the food in a special container. What classes and A.Is are you most li ely to use to support Internationali'ation? A B ! % 1ocale !ollection Interface 1istIterator ResourceBundle

" (

@ey&tore 8utput&treamWriter

!hoices A) % and ( are correct. +he following is ta en from4 http4FFdeveloper.3ava.sun.comFdeveloperFtechnicalArticlesFIntlFIntlIntroF G1ocales are used throughout the 2ava class libraries to customi'e how data is presented and formatted. +hey affect language choice) collation) calendar usage) date and time formats) number and currency formats) and many other culturally sensitive data representations. If you intend to create international 2ava applications) youAll definitely use the 3ava.util.1ocale class. +hereAs no getting around itM youAll use 1ocales to create well-behaved) internationali'ed) multilingual 2ava applications. &o) if you havenAt had time to e$plore all the 2%@ 1.1 international features yet) youAll get a clearer understanding of the core of the internationali'ation model) the 1ocale) as you read and understand the descriptions and e$amples in this article. A 1ocale is a relatively simple ob3ect. It identifies a specific language and a geographic region. In fact) the only significant contents of a 1ocale ob3ect are language and country. Although superficially these attributes are not particularly impressive) they represent a very rich and interesting set of information. A 1ocale ob3ect represents the language and cultural preferences of a geographic area. 1anguage is a fairly easy idea to graspM cultural preferences may not be immediately clear. %ates) time) numbers) and currency are all e$amples of data that is formatted according to cultural e$pectations. !ultural preferences are tightly coupled to a geographic areaM thatAs why country is an important element of locale. +ogether these two elements ,language and country- provide a precise conte$t in which information can be presented. >sing 1ocale) you can present information in the language and form that is best understood and appreciated by the user. Resource Bundles - +his internationali'ation feature of the 2%@ provides a mechanism for separating user interface ,>I- elements and other locale-sensitive data from the application logic in a program. &eparating locale-sensitive elements from other code allows easy translation. It allows you to create a single code base for an application even though you may provide 7C different language versions. Although you might be predisposed to thin of te$t only) remember that any locali'able element is a resource) including buttons) icons) and menus. +he 2%@ uses resource bundles to isolate locali'able elements from the rest of the application. +he resource bundle contains either the resource itself or a reference to it. With all resources separated into a bundle) the 2ava application simply loads the appropriate bundle for the active locale. If the user switches locales) the application 3ust loads a different bundle. Resource bundle names have two parts4 a base name and a locale suffi$. (or e$ample) suppose you create a resource bundle named 0yBundle. Imagine that you have translated 0yBundle for two different locales) 3aN2. and frN(R. +he original 0yBundle will be your default bundleM the one used when others cannot be found) or when no other localespecific bundles e$ist. *owever) in addition to the default bundle) youAll create two more bundles. In the e$ample these bundles would be named 0yBundleN3aN2. and 0yBundleNfrN(R. +he ResourceBundle.getBundle method relies on this naming convention to search for the bundle used for the active locale. +he 3ava.util.ResourceBundle class is abstract) which means you must use a subclass of ResourceBundle. +he 2%@ provides two subclasses4 .ropertyResourceBundle and 1istResourceBundle. If these donAt meet your needs) you can create your own subclass of ResourceBundle.G +he following is ta en from4 http4FF3ava.sun.comFdocsFboo sFtutorialFi1BnFte$tFstream.html G+he 3ava.io pac age provides classes that allow you to convert between >nicode character streams and byte streams of non->nicode te$t. With the Input&treamReader class) you can convert byte streams to character streams. Lou use the 8utput&treamWriterclass to translate character streams into byte streams.G +hus we can see that 1ocale) ResourceBundle and 8utput&treamWriter play a vital role in 2ava Internationali'ation. *ence choices A) % and ( are correct. +he !ollection interface) 1istIterator and @ey&tore are not relevant to I1BE. *ence choices B) ! and " are incorrect.

9/ A B ! %

+he conversion between 1=-bit >nicode and B-bit local encoding formats is done by4 0essage(ormat and Eumber(ormat 1ocale and ResourceBundle .roperties files Input&treamReader and 8utput&treamWriter

!hoice % is correct. +he following is ta en from4 http4FF3ava.sun.comFdocsFboo sFtutorialFi1BnFte$tFstream.html G+he 3ava.io pac age provides classes that allow you to convert between >nicode character streams and byte streams of non->nicode te$t. With the Input&treamReader class) you can convert byte streams to character streams. Lou use the 8utput&treamWriter class to translate character streams into byte streams.G *ence choice % is correct. 0essage(ormat) Eumber(ormat) 1ocale) ResourceBundle and properties files are all used in I1BE. +hese are not however used for conversion between >nicode character format and local B-bit byte streams. *ence choices A) B and ! are incorrect.

97 (ire *all) manufacturers of fire e$tinguishers) is building a corporate Intranet and wants its employees to access payroll information via the Internet. +hey are planning to use Applets) because of its richer <>I capabilities. +he Iiew9C1@ applet re#uires a 2ava 1.9 plug in on the host where it is being e$ecuted. +his applet will read data cached on a temporary directory in the host to calculate 9C1@ distributions. What are your observations on the use of Applets for this purpose? A +he Applet technology is not a viable solution for this application because applets are sub3ected to the sandbo$ model) which prevents them from reading from or writing to the host where they are being e$ecuted. B +he Applet technology is a viable solution for this application because the &ecurity policy of the 2ava / .latform is totally fle$ible. !hoice B is correct. +he following is ta en from4 http4FF3ava.sun.comFdocsFboo sFtutorialFsecurity1./FoverviewFinde$.html G2%@ 1.1 introduced the concept of a Gsigned applet)G as illustrated in the ne$t figure. A digitally signed applet is treated li e local code) with full access to resources) if the public ey used to verify the signature is trusted. >nsigned applets are still run in the sandbo$. &igned applets are delivered) with their respective signatures) in signed 2AR ,2ava Archive- files. 2%@ 1./ introduces a number of improvements over 2%@ 1.1. (irst) all code) regardless of whether it is local or remote) can now be sub3ect to a security policy. +he security policy defines the set of permissions available for code from various signers or locations and can be configured by a user or a system administrator. "ach permission specifies a permitted access to a particular resource) such as read and write access to a specified file or directory or connect access to a given host and port. +he runtime system organi'es code into individual domains) each of which encloses a set of classes whose instances are granted the same set of permissions. A domain can be configured to be e#uivalent to the sandbo$) so applets can still be run in a restricted environment if the user or the administrator so chooses. Applications run unrestricted) as before) by default but can optionally be sub3ect to a security policy.G As we can see) the 2ava / &ecurity model is totally fle$ible. *ence choice B is correct.

99 A B ! %

Which of the following statements is true about &&1? &&1 runs above high-level application protocols such as *++. and 1%A. &&1 runs below +!.-I. &&1 runs above +!.-I. and below application protocols &&1 does not have anything to do with either the application or the networ layer in the 8&I model

!hoice ! is correct. +he following is ta en from4 http4FFdeveloper.netscape.comFdocsFmanualsFsecurityFsslinFcontents.htm G+he +ransmission !ontrol .rotocolFInternet .rotocol ,+!.FI.- governs the transport and routing of data over the Internet. 8ther protocols) such as the *yper+e$t +ransport .rotocol ,*++.-) 1ightweight %irectory Access .rotocol ,1%A.-) or Internet 0essaging Access .rotocol ,I0A.-) run Gon top ofG +!.FI. in the sense that they all use +!.FI. to support typical application tas s such as displaying web pages or running email servers. +he &&1 protocol runs above +!.FI. and below higher-level protocols such as *++. or I0A.. It uses +!.FI. on behalf of the higher-level protocols) and in the process allows an &&1-enabled server to authenticate itself to an &&1enabled client) allows the client to authenticate itself to the server) and allows both machines to establish an encrypted connection.G +herefore choice ! is correct. !hoice A is incorrect because it suggests that &&1 runs above application protocols. !hoice B is incorrect because it suggests that &&1 runs below +!.FI.. &&1 runs between +!.FI. and *++.. *ence choice % is incorrect.

9; A B ! % "

What happens when the remove,- method is called on the *ome Interface of an "ntity Bean? +he remote reference is invalidated +he bean instance is destroyed +he bean instance is .assivated +he data represented by the bean instance is deleted from the database +he Bean Instance moves from pooled state to ready state

!hoices A and % are correct. +he remove,- method) in the case of "ntity Beans) invalidates the client stub) and deletes the data represented by the bean) from the database. *ence choices A and % are correct. +he bean instance is returned to the pool. It is not destroyed when the remove,- method is called on an "ntity Bean. +herefore choice B is incorrect. +he container passivates the bean instance whenever re#uired ,for memory management.- It is not a conse#uence of the remove,- method though. *ence choice ! is incorrect. +he Bean instance moves from the Ready &tate to the .ooled &tate upon removal) not the other way round as the point suggests. *ence choice " is incorrect.

9=

What types of transactions are supported by "nterprise 2ava Beans?

A B ! %

Implicit %eclarative +ransactions "$plicit 2+A based transactions "ither A or B ,based on vendor implementationBoth A and B

!hoice % is correct. "nterprise 2ava Beans specification supports both Implicit %eclarative transactions and e$plicit 2ava +ransaction A.I ,2+A- based transactions. *ence choice % is correct.

9? With "ntity Beans) the container automatically generates implementations of all find methods at deployment time.+rueF(alse? A B +rue (alse

+he above statement is (alse. +he container only generates implementations of the find methods at deployment time) in the case of !ontainer 0anaged .ersistence.

9B A B ! %

What does the e3b!reate,- method return in the case of "ntity Beans in "2B 1.1? A remote reference to the "2B8b3ect for both B0. and !0. beans +he BeanAs .rimary @ey for both B0. and !0. beans A reference to itself in B0. and E>11 in !0. E>11 value of type Bean.@ in !0. and .rimary @ey in B0.

!hoice % is correct. In "2B1.C) the e3b!reate,- method returned void. In "2B1.1) a null value of the beanAs primary ey type is returned by the e3b!reate,- method ,in !0..- In B0.) the e3b!reate,- method returns the primary ey of the newly created entity. *ence choice % is correct. +he !ontainer intercepts the return value from the Bean and returns a remote reference to the remote ob3ect) to the calling client. *ence choice A is incorrect. !hoice B suggests that the .rimary @ey of the newly created instance is returned in both !0. and B0.. *ence it is incorrect. +he Bean instance never returns a reference to itself upon creation. *ence choice ! is incorrect.

9D Lou have 3ust started a new 3ob wor ing for a top finance company and you have been as ed to provide a user-friendly interface to an e$isting mainframe application. Lou donAt have any access to the mainframes source code. What is the best techni#ue for this?

A It canAt be done. B >se a screen scraper. ! Re-write the main frame using 2ava and high-end >ni$ servers. Although it may ta e some time to do this in the long run this will benefit the company. % Write a 2ava front end then use !8RBA to communicate with the mainframe. " >se the 2ava Eative Interface ,2EI- to communicate with the mainframe. ( >se ob3ect 0apping ( >se 20& B is correct choice. +he ey to this #uestion is that you donAt have access to the mainframes source code. A screen scraper emulates a mainframe terminal. Basically the screen scraper logs on to the mainframe li e a normal user and sends re#uests to the mainframe and then reads the response. +he problem with a screen scraper is that if you change any of the mainframes code there is always the possibility that the screen scraper will stop wor ing.!hoice A is incorrect because it can be done. !hoice ! would ta e far too long) would cost too much and is not what the customer wants. !hoice %) " and ( are not appropriate are would re#uire access to the mainframes source code. !hoice < is incorrect because there is no mention that the mainframe supports a messaging system. &ome of them do and even provide interfaces for 20& however as itAs not stated in the #uestion then this is not the right answer.

;C +he company you have been wor ing for has released the ne$t generation of its sales system. Lou have several very powerful servers and a few basic servers at your disposal. A networ e$pert has suggested that in order to get the best possible performance out of these machine you use reverse pro$y load balancing? What is reverse pro$y load balancing? A &plitting re#uests evenly amongst all bac end servers B +he pro$y sits behind the bac end servers monitoring the performance of each one. When it notices one is being used too much it will automatically forward re#uests to a different server. ! &plitting re#uests amongst all bac end servers depending on the amount of spare !.> time each server has available. % A techni#ue used to target certain re#uests to certain bac end servers) e.g. All &ervlet re#uests from one server. All static *+01 from another. " A way of filtering out certain re#uests. It is used to protect against denial of service attac s !hoice % is correct. Reverse pro$y load balancing is generally used when you have servers with different amounts of !.>s and 0emory. Lou might have some really powerful servers 3ust to be used for &&1 sessions and others to handle static html. >sing this will ma$imi'e the performance of your application !hoice A is a description of round-robin load distribution. !hoice B doesnAt describe any particular method of load balancing. !hoice ! is an inaccurate description of reversepro$y load balancing and you would need access to the mainframes source code to do this. !hoice " is a cross between a firewall and a standard pro$y server this does not do any load balancing.

;1 Lou are wor ing for a web design company and one of your clients would li e to convert their website that currently uses .erl and !<I scripts over to a language that is easier to maintain and reuse. +heir website is a sports betting website where the customer is able to logon and place bets on a variety of different sporting events. What would you replace this with?

A B ! %

2&.F&ervlets 2&.F&ervletsF"2Bs 20& A&.

!hoice B is correct. +he ey to this #uestion is that the site offers the facility to place bets online. +herefore transactions are involved and this means that "nterprise 2ava Beans need to be used. It is very hard to implement transactions with 3ust &ervlets and 2&.s. *ence choice B is correct.!hoice A is incorrect because transactions are involved. 20& is the messaging pac age of the 2/"" and therefore ! is incorrect. And choice % well) enough saidO ;/ Lou are in charge on converting an e$isting web based solution over to the appropriate 2/"" technology. What should you use? +he website offers the customers price comparisons on a variety of different products. Revenue is generated by clic through sales when the customer has found the best price. A B ! % 2&.) &ervlets 2&.) &ervlets) "2Bs Applets) "2Bs Eo need to change it ."R1F!<I scripts is the best solution.

!hoice A is correct. +he ey to this #uestion is that the revenue is generated by clic through salesM this implies that there are no transactions involved. If transactions were involved then you would use "2Bs as well.!hoices B and ! are incorrect because there are no transactions involved in this application. ."R1F!<I scripts are harder to maintain than 2ava code so choice % is not the best option.

;7 Lour 7-tier application has been deployed in a production environment and has been running smoothly for over 7 months. *owever recently due to a +elevision campaign youAre getting 7 times the normal volume of traffic. +o cope with this you decided to introduce Round-Robin load balancing. *ow is round robin load balancing going to help with the e$tra traffic? A &plitting re#uests evenly amongst all bac end servers B +he pro$y sits behind the bac end servers monitoring the performance of each one. When it notices one is being used too much it will automatically forward re#uests to a different server. ! &plitting re#uests amongst all bac end servers depending on the amount of spare !.> time each server has available. % A techni#ue used to target certain re#uests to certain bac end servers) e.g. All &ervlet re#uests from one server. All static *+01 from another. !hoice A is correct. Round-Robin load balancing is the process of splitting re#uests evenly irrespective of the re#uest type ,i.e. &&1) 2&.) *+01-. If you have 7 servers as the first re#uest comes in it goes to the first sever) second re#uest to the second server and the third re#uest to the third server. As the fourth re#uest comes in the process starts again and so this re#uest is forwarded to the first server.!hoices B and ! are not descriptions of any nown load-balancing techni#ue. !hoice % is a description of reverse pro$y load balancing. +his is generally used when you have servers with different amounts of !.>s and 0emory. Lou might have some really powerful servers 3ust to be used for &&1 sessions and others to handle static html. >sing this will ma$imise the performance of your application.

;9 A (ortune ;CC company wishes to add new functionality to its e$isting sales system and has contracted you as the lead architect for the pro3ect. +he legacy system has been written in !PP and they wish to eep this system running although they may switch over to full 2ava solution later) depending on the performance of the new e$tra functionality. *ow will connect to this legacy system? A Wrap the application using 2EI and ma e it accessible using R0I. B Rewrite the !PP code in 2ava. +his shouldnAt be too hard because itAs converting from one ob3ect-orientated language to another. ! >se a screen scraper. % >se !8RBA to tal to the ! program then get the !8RBA to tal to the R0I server. !hoice A is correct. 2EI stands for 2ava Eative Interface and is used to allow 2ava to communicate with programs written in languages li e !. In effect you are wrapping the ! code to ma e it available to 2ava. (or e$ample you will wrap a ! method called debitAccount,int amount- with a similar 2ava method) the 2ava method will 3ust call the ! method. +his means you can now ma e the method accessible via R0I!hoice B is incorrect because this is not what customer wants) you must stic to the re#uirements. It would be inappropriate to use a screen scraper here so choice ! is incorrect. Although choice % might be possible) to get this to wor would ta e far more wor than is actually re#uired. Lou would need to get the ! and !8RBA programs wor ing first then try and interface !8RBA and R0I) which is not necessary) in this case.

;; +he I+ company you are wor ing currently doesnAt offer the facility for customers to buy .!s bundled with printers. 1uc ily they have 3ust struc a deal with another printer company. +he list of printers they offer is maintained in a database that runs on one of the printer companies servers. Lou need to connect to this database however you donAt have a 2%B! driver that you can install on the server. +he database server does have an 8%B! driver installed on it. *ow do you connect to the database? A Lou canAt) change the data store. B <et the printer company to write a web page that you can pass &:1 re#uests to. ,Lou would simply send &:1 #ueries as .8&+ re#uests and the output would be the Result&et- +his should be implemented securely using &&1 with client and server authentication ! Wrap some 2EI access code around the 8B%! driver then connect using 2%B!. % ,%onAt implement the solution using 2ava. " &end the database re#uests as 20& method calls ( >se the 2%B!-8B%! bridge driver. !hoice ( is correct. +he ey to this #uestion is that with the 2%B!-8%B! you are not connecting to the database directly you are connecting to the 8%B! driver instead. &o it doesnAt matter what the database is as along as there is an 8%B! driver available.!hoice A is incorrect because it can be done. Although choice B may wor it is not the best solution) the 2%B!-8%B! Bridge is the best solution. Lou donAt need to wrap 2EI code around the 8%B! driver to connect to it. *ence choice ! is incorrect. !hoice % is incorrect because it is possible to connect to the data source using 2ava. !hoice " is incorrect because there is no mention of any 0essage server in the #uestion and this is not suitable technology for the 3ob.

;= A wor colleague has been describing a mainframe application that your company uses to maintain their sales data. *e says that the ne$t application you will need to design will involve screen scraping) as he canAt see how else the connection to the mainframe will be possible. What is screen scraping? A A plastic tool to get ice off a car windscreen. B A program that interacts with a mainframe passing re#uests from the users directly to custom written code that you have added in the mainframe. ! A program that emulates a mainframe terminal and passes user input to the mainframe. % A program thatAs supplied by the mainframe for 2ava programs to interact with. " Lour colleague is wrong. It will be #uite easy to connect directly to the mainframe using 2ava. ( A program that uses 2EI to access the mainframe. < A program that use 20& to send messages to the mainframe. Eote this only wor s if the mainframe has a message server built into it. !hoice ! is correct. A screen scraper emulates a mainframe terminal. Basically the screen scraper logs on to the mainframe li e a normal user and sends re#uests to the mainframe and then reads the response. +he problem with a screen scraper is that if you change any of the mainframes code there is always the possibility that the screen scraper will stop wor ing.!hoice A maybe true but itAs not the right ind of screen scraperO !hoices B and ( re#uire that you have access to the mainframes source code. &creen scrapers are written as and when they are needed) the mainframe vendor does not supply them so choice % is incorrect. Lour colleague is right. +herefore choice " is incorrect. !hoice < is incorrect because although you can communicate with mainframes via 20& the process is different from screen scraping.

;? Lou are wor ing for a company with a worldwide presenceM their offices are spread across many countries and over many computer networ s. Iirtual private networ s have been set up to increase security. What are Iirtual .rivate Eetwor s are where are they created? ,I.EsA A networ created between two other networ s ,these are not located in the same place) geographically-. "ncryption and Authentication are used in the I.E. Eormally the I.E is a networ on top of an untrusted networ ,li e the Internet-. B +he area between two firewalls. Lou let traffic from the Internet into this area ,through the first firewall- but not through the second firewall ,to your secure networ -. ! +he secure ,inner- networ as described in answer B. % A networ created between two other networ s ,these are not located in the same place) geographically-. "ncryption and Authentication are E8+ used in the I.E. Eormally the I.E is a networ on top of a trusted networ ,li e the Internet-. !hoice A is correct. +he answer given in choice A e$plains what a Iirtual .rivate Eetwor is ,I.E-. !hoice B describes a %0QM choice ! the local area networ in the %0Q and choice % is incorrect because encryption and authentication are used in the I.E.

;B

What is ob3ect mapping?

A +he process of converting a class diagram to 2ava code. B A program that emulates a mainframe terminal and passes user input to the mainframe. ! +he process of building ob3ect wrappers around 2ava interfaces. +his allows the legacy system to interact with your 2ava application.

% +he process of building ob3ect wrappers around legacy interfaces. +his ma es the legacy system available in an 88 fashion. !hoice % is correct. 8b3ect mapping is used when accessing legacy systems. Lou need access to the legacy systemAs source code in order to do this.!hoice A sounds plausible but is incorrect. !hoice B is a description of a screen scraper. +here is no need to build ob3ect wrappers around 2ava interfaces. !hoice ! describes the opposite. *ence choice ! is incorrect.

;D Lou are the lead architect for a pro3ect that will re#uire you interfacing with e$isting !8RBA systems. Lou are planning to use 2ava I%1 to integrate with these other systems. Which of the following statements about 2ava I%1 are true? A Allows 2ava to use !8RBA B &hould be used when most of your new 2ava applications will be entirely 2ava based. ! &hould be used if you have already been using !8RBA for a while and wish to carry on with some !8RBA systems % 2ava I%1 has nothing to do with !8RBA. +o communicate with !8RBA you will need to use 2EI ,2ava native interface- and 2/! ,2ava / !8RBA-t/?P&ame as " e$pect you wonAt need to use 2EI. " 2ava I%1 should be used when servicing messaging re#uests from !8RBA clients. !hoices A and ! are correct. +he following is ta en from4http4FF3ava.sun.comF3/seF1.7FdocsFguideFidlFinde$.html2ava I%1 adds !8RBA ,!ommon 8b3ect Re#uest Bro er Architecture- capability to the 2ava platform) providing standards-based interoperability and connectivity. 2ava I%1 enables distributed Web-enabled 2ava applications to transparently invo e operations on remote networ services using the industry standard I%1 ,8b3ect 0anagement <roup Interface %efinition 1anguage- and II8. ,Internet Inter-8RB .rotocol- defined by the 8b3ect 0anagement <roup. Runtime components include 2ava 8RB for distributed computing using II8. communication.!hoice B is incorrect because you should use R0I-II8. instead of 2ava I%1. !hoices % and " are not true as 2ava I%1 adds !8RBA capability to the 2ava platform. !hoice ( is incorrect because 2ava I%1 shouldnAt be used when servicing re#uests from !8RBA clients and the reference to messaging is a red herring.

=C Lou are designing an "nterprise Application to provide a way for customers to buy products from many companies through one standard site. +he application servers you have use the "2B specification 1.1. Lou have a customer bean and are not sure whether to use !0. or B0.. When should you use !0.? A B ! % When performance is essential and you are storing standard data types. When performance is not essential and you are storing standard data types. When performance is essential and you are storing comple$ data types. When performance is not essential and you are storing comple$ data types.

!hoice B is correct. .lease note that this is referencing "2B1.1+his is a time dependent #uestion as technologies have changed. When &un wrote the "2B specification 1.1 Application &ervers werenAt very efficient at generating &:1 used for persistence and it used to be recommended that you use B0. instead. *owever App &ervers have improved and some would argue that !0. is now more efficient than B0.. In the &!"A guideboo by !ade it says B0. will out perform !0.. When the e$am is updated to "2B /.C) the answer to this #uestion would probably change.!hoice A is incorrect because B0. can be more efficient than !0.. !0. cannot cope with mapping comple$ data types to a database very efficiently. *ence

choice ! is incorrect. "ven if performance is not an issue) it is still recommended that you use B0. when storing comple$ data types. +herefore choice % is incorrect.

=1 LouAve written all the >01 diagrams you need for your companies online store. 8ther developers and architects have approved them. Eow you are deciding which "nterprise Beans will use !ontainer 0anaged .ersistence ,!0.- and which will use Bean 0anaged .ersistence ,B0.-. When should you use B0.? A B ! % When performance is essential and you are storing standard data types. When performance is not essential and you are storing standard data types. When performance is essential and you are storing comple$ data types. When performance is not essential and you are storing comple$ data types.

!hoices A) ! and % are correct. .lease note that this is referencing "2B1.1+his is a time dependent #uestion as technologies have changed. When &un wrote the "2B specification 1.1 Application &ervers werenAt very efficient at generating &:1 used for persistence and it used to be recommended that you use B0. instead. *owever App &ervers have improved and some would argue that !0. is now more efficient than B0.. In the &!"A guideboo by !ade it says B0. will out perform !0.. When the e$am is updated to "2B /.C) the answer to this #uestion would probably change.!hoice ! is incorrect because using !ontainer 0anaged .ersistence will increase the portability of the "nterprise Bean and should be used wherever possible.

=/ Lour company has won a contract with a ma3or supermar et company to allow customers to do their grocery shopping online. As this will involve a huge number of shoppers you have decided to opt for a 2/"" solution. When creating the "nterprise Beans to be used in this application what components do you need? A A *ome interface) A Remote Interface and a class that implements either the &essionBean or "ntityBean interfaces. B A *ome interface and a class that implements either the &essionBean or "ntityBean interfaces. ! A Remote interface and a class that implements either the &essionBean or "ntityBean interfaces. % A Remote interface and a class that implements the "nterpriseBean interface. " An "2B8b3ect interface) a Remote interface and a class that implements either the &essionBean or "ntityBean interfaces. ( An "2B8b3ect interface) a *ome interface and a class that implements either the &essionBean or "ntityBean interfaces. !hoice A is correct. Lou need a *ome interface that has create,- and find,- methods) a Remote interface to define your business methods) and a class that implements either the &essionBean or "ntityBean interfaces.!hoice B is incorrect because you also need a Remote interface. !hoice ! is incorrect because you also need a *ome interface. !hoice % is incorrect because you need the *ome interface and a class that implements either the &essionBean or "ntityBean interfaces. !hoices " and ( are incorrect because you donAt need an "2B8b3ect interface.

=7 A B ! canAt. %

What is the difference between &tateful session beans and stateless session beans? &tateful session beans are pooled and &tateless session beans arenAt. A &tateful session bean can persist its state through a server crash but a &tateless session bean canAt. A &tateful session bean can remember its state with a client) li e a conversation but a &tateless session bean A &tateful session bean uses a .rimary @ey interface to maintain persistence.

!hoice ! is correct. An e$ample use for a stateful session bean would be a shopping bas et because it maintains its state. *owever a stateless session bean canAt and instead should be used as a service e.g. credit card validation. A stateful session bean cannot survive a server crash) as none of its data is permanently stored li e "ntity beans.!hoice A is incorrect because &tateless session beans are pooled. !hoice B is incorrect because a stateful session bean cannot survive a server crash. !hoice % is incorrect because the data in a stateful session bean is not stored on a database and therefore there is no .rimary @ey interface for stateful session beans.

=9 A B ! %

What is the difference between stateful &ession beans and "ntity beans? &tateful session beans can survive a server crash but "ntity beans canAt. "ntity beans can survive a server crash but &tateful session beans canAt. &ession beans are typically used to ma e calls on "ntity beans. "ntity beans are typically used to ma e calls on &ession beans.

!hoices B and ! are correct. "ntity beans represent data on a database whereas session beans represent wor flow. It is very e$pensive to create "ntity beans and the code can become #uite complicated. *ence you should use the &ession-(aKade pattern) where the customer tal s to a &ession bean which in turn tal s to the "ntity bean.!hoice B is incorrect because session beans cannot survive a server crash and in choice % the description is the other way around.

=; Lou have an application that will be used for customers to buy service engineers time and e$tend warranties online. Lou have several different "nterprise Beans in this application for e$ample) !ustomer) Warranties) !redit!ardIalidation etc. ItAs a long time since youAve coded "2Bs ,normally your time is spent designing applications at a higher level- and youAve forgotten which methods should go in which interface. What methods do you put in the Remote interface? A %efines create,-) find,-) remove,8b3ect- methods. B %efines signatures of "2BAs business methods. ! %efines the persistence of the bean) e.g. how to persist etc. % %efines all methods that the client can call on the "2B. " Lou donAt need a Remote interface for an "2B. An "2B consists of a *ome interface and an "2B8b3ect interface. !hoices B and % are correct. +he Remote interface is used to define all of the methods that can be called by the client on the "nterprise Bean. If you try and call a method that e$ists in the "nterprise bean class but hasnAt been defined here you will get a

Remote"$ception.+he methods in choice A are defined the *ome interface. !hoice ! describes information that would be found in the deployment descriptor and application server. !hoice " is incorrect because a remote interface ,that implements 3ava$.e3b."2B8b3ect- is re#uired.

== Lou are designing an "nterprise Bean to represent a customer in your new application. Lou have many methods for this "2B for e$ample4createAccount,-deductAmount,-create,-find,-Which of these methods needs to go in the *ome Interface and what is it used for? A %efines create,-) find,-) remove ,8b3ect- methods. B %efines signatures of "2BAs business methods. ! %efines the persistence of the bean) e.g. how to persist etc. % %efines all methods that the client can call on the "2B. " +he createAccount,-) deductAmount,- methods need to go in the *ome interface as it defines the business methods. !hoice A is correct. +he *ome interface defines the create,-) find,-) and remove,- methods.+he Remote interface is used to define all of the methods that can be called by the client on the "nterprise Bean. If you try and call a method that e$ists in the "nterprise bean class but hasnAt been defined in the remote interface) you will get a Remote"$ception.!hoice B is incorrect because these are methods defined in the Remote interface. !hoice ! describes information that would be found in the deployment descriptor and the application server. !hoices % and " describe the Remote interface. =? A B ! % &elect the most appropriate use for an "ntity Bean? &tore state for a particular client. +o store data permanently such as financial data. &tore state for any client) not any in particular. .rovide a service to the client.

!hoice B is correct. +he ey to this #uestion isGselect the most appropriateG there are a two possible right answers. ,B- Is the most correct because it has the word permanently in the answer. "ntity beans represent data on a database. It might be possible to argue that ,A- is also right because maybe that is a customer "ntity Bean storing their address and personal details. But there is no reference to permanent data storage. *ence ,B- is the better answer.!hoice ! would re#uire either a stateless or stateful session bean. +he reason it could be either is because it saysGnot any particular clientG. !hoice % would typically re#uire a stateless session bean.

=B LouAve managed to wor out what the ne$t big online shop will be way ahead of everyone else) and are currently designing it. Although the design is still in a rough stage and you have yet to secure sponsors to ta e it into production you have already decided on some of the "nterprise Beans that you will need. Lou now you will need a customer "2B) &hopping bas et "2B) another "2B to be used when accessing data on a legacy system. Lou now you will need many more but what would be an appropriate use for a &tateless &ession Bean? A B ! +o represent a shopping bas et. .rovide a service to the client. &tore state for a particular client.

+o access data on a legacy system.

!hoice B is correct. &tateless session beans canAt remember which client they were last tal ing to and any data they might hold is not saved in a database. &tateless session beans are used to provide a service. ".g. credit card validation.!hoice A is incorrect because a shopping bas et would re#uire state ,a &tateful &ession Bean-. !hoice ! would re#uire a &tateful &ession Bean or "ntity Bean depending on whether the data needed to be permanently stored for that client. Although choice % is possible this isnAt the most appropriate use for a stateless session bean.

=D In a !atalog "nterprise Bean) ,used in an online sports shopping site- you have code that will be e$ecuted when e3b.assivate,- and e3bActivate,- are called. +he code is used to perform basic house eeping tas s. Lou need to now when the code will e$ecute so which of the following statements are true? A B ! % e3b.assivate,- is called prior to passivation. e3b.assivate,- is called immediately after passivation. e3bActivate,- is called prior to activation. e3bActivate,- is called immediately after activation.

!hoices A and % are correct. +he descriptions in choices B and ! are the wrong way round.

?C Lou have never wor ed with 2/"" application servers before and are about to release your first 7-+ier application. Lour company already has a strong customer base so you e$pect a huge volume of traffic over the first few days of the launch. LouAre not to sure how your application server will cope with all the customers but a colleague reassures you that the "nterprise beans are pooled and the performance of the system will be fine. What are the benefits of bean pooling? A Improves response time between client and bean B 0eans you need fewer instances of the beans and therefore increases scalability. ! 0eans you need fewer instances of the beans but this does nothing for increasing scalability. % 0eans you eep more instances of the beans in memory but this improves performance of the Application server ten fold. !hoice B is correct. Bean pooling is 3ust li e database connection pooling. +here is no point having a few thousand instances in memory when you could get by with ;C. When a bean is in a pooled state it is not associated with any particular client.+he following are wrong because4Lou could argue that by bean pooling it reduces the load on the application server and this indirectly improves the response time. *owever this choice ,A- is not the most appropriate. !hoice ! is incorrect because bean pooling does increase scalability. !hoice % is incorrect because you eep fewer instances of the beans in memory.

?1

Which of the following statements are true with regards to bean pooling?

A B ! %

+he "2B specifies how many instances to pool at deployment time. Although bean pooling improves performance it doesnAt offer any advantages in &calability terms. If your server has enough memory you should avoid bean pooling. +he application server depending on the beans usage decides the number of instances to pool.

!hoice A is correct. Lou can say how many instances should be pooled at deployment time.!hoice B is incorrect because bean pooling does increase scalability. +here is no need to avoid bean pooling and if you didnAt do it the amount of memory you would need would be far too e$pensive. *ence choice ! is incorrect. +he number of beans to pool is set at deployment time. *ence choice % is also incorrect.

?/ A B

Its not 3ust &tateless &ession beans that are pooled) "ntity beans are as well. +rueF(alse? +R>" (A1&"

+he above statement is true. Les they are both pooled to reduce the load on the Application server.

?7 A B ! %

When should R0I over II8. be used? R0I over II8. is used all the time with standard R0I. When performance doesnAt matter. When you are dealing with a pure 2ava system) no legacy systems etc. When R0I is used with "nterprise 2avabeans.

!hoice % is correct. +he following is ta en from4http4FF3ava.sun.comF3/seF1.7FdocsFguideFidlF3idl(A:.htmlR0I-II8. - If you are writing most of your new applications using the 2ava programming language) but need to maintain legacy applications written in other programming languages as well) you will probably want to use 2ava R0I with its II8. compiler option. !hoice A is incorrect because 2R0. is the standard for R0I. Whether you use II8. or 2R0. is irrelevant in terms of performance. *ence choice B is incorrect. Lou should use standard 2R0. in the case choice ! describes.

?9 As part of your online shopping site you need customers to be able to pay for their goods securely. Lou have decided that you will use &&1 with 1/Bbit encryption to transmit the credit card details. What port number does *++.& run on and can it be configured to run elsewhere? A B ! % " B997 and yes it can run elsewhere B997 and no it can not run elsewhere it must run on this port 997 and yes it can run elsewhere =// and yes it can run elsewhere 997 and no it can not run elsewhere it must run on this port

!hoice ! is correct.

As a standard *++.& runs on port 997 but it can be configured to run elsewhere. With web servers such as +omcat the &&1 port is B997.

?; Lou are designing an application that will use 2R0. over II8.. +he Eetwor engineers at your company would li e to now what port you intend to use to access the internet and other networ s so that they can ma e it available on the companies firewall. What port do you as for? A B ! % " 997 ;7; 1CDD B997 BC

!hoice ! is correct. 2R0. runs on port 1CDD as standard although it is possible to run it on a different port.!hoice A is the standard &&1 port number. II8. uses port ;7;. Web servers such as +omcat use the port B997 for &&1. And choice " is the standard *++. port. Although you wish to access the internet you are not ma ing http re#uests.(or more information please refer to the following >R14http4FFwww.iana.orgFassignmentsFport-numbers

?= A B ! %

Lou need to replace A&. scripts. What 2/"" technology do you use? 20&) 2&. and &ervlets 2&. and &ervlets 2+A) 2&. and &ervlets Applets

!hoice B is correct. A&. and 2&. have a very similar synta$ so it ma es sense to replace A&. with 2&.. Lou should also try and e$tract parts from the A&. script that perform controller operations or other processing and implement them as &ervlets.!hoice A is incorrect because the 2ava 0essage &ervice and has nothing to do with web pages. +here is no mention of transactions in the #uestions and if there was it would probably be better to use "2Bs as well so choice ! is incorrect. Although choice % is possible this is not the best answer as there would be too much wor involved in creating the Applets.

?? As part of your new application you need to connect to a database. Lou donAt have any access to the database server so you canAt change the 8%B! driver thatAs currently installed. *ow do you connect? A B ! % !8RBA 20&-2EI 2%B!-8%B! bridge 2%B!

!hoice % is correct. +he ey to this #uestion is that you donAt need to install a new 8%B! driver or anything li e that) you can connect to the database directly via 2%B!!8RBA is used for distributed systems not database connectivity so choice A is

incorrect. !hoice B wouldnAt wor and choice ! isnAt necessary) as the #uestion doesnAt say that you canAt use a normal 2%B! driver.

?B A B ! %

When would you choose R0I-2R0. over !8RBA? When you are designing a pure 2ava solution. When you are designing a solution that will not be pure 2ava but will mainly be in 2ava. When you will interact with applications written in other languages such as !F!PP When performance is essential.

!hoice A is correct. +he following is ta en from4http4FF3ava.sun.comF3/seF1.7FdocsFguideFidlFinde$.html+his is a fundamental #uestion and itAs important to understand the distinction between these two ways of integrating the 2ava programming language with !8RBA. 2ava I%1 is for !8RBA programmers who want to program in the 2ava programming language based on interfaces defined in !8RBA Interface %efinition 1anguage ,I%1-. +his is Gbusiness as usualG !8RBA programming) supporting 2ava in e$actly the same way as other languages li e !PP or !8B81. R0I-II8. ,Remote 0ethod Invocation over Internet Inter-8RB .rotocol- is for 2ava programmers who want to program to the R0I interfaces) but use II8. as the underlying transport. R0I-II8. provides interoperability with other !8RBA ob3ects implemented in various languages - but only if all the remote interfaces are originally defined as 2ava R0I interfaces. It is of particular interest to programmers using "nterprise 2avaBeans ,"2B-) since the remote ob3ect model for "2Bs is R0I-based.Lou would use R0I-II8. in choice B. In choice ! you would use !8RBA. !8RBA actually slightly outperforms R0I. *ence choice % is also incorrect.

?D Lou have a distributed system that is not made up entirely of 2ava ob3ects ,some of them are !8RBA- what technology should you use? A B ! % R0I-2R0. !8RBA Rewrite the ob3ects so the system in entirely 2ava based R0I-II8.

!hoice B is correct. +he following is ta en from4http4FF3ava.sun.comF3/seF1.7FdocsFguideFidlF3idl(A:.htm+here are several scenarios that will define how you will want to create distributed !8RBA applications. *ere are some of them4 2ava I%1 - If you have been developing !8RBA applications using I%1 for some time) you will probably want to stay in this environment. !reate the interfaces using I%1) and define the client and server applications using the 2ava programming language to ta e advantage of its GWrite 8nce) Run Anywhere+0G portability) its highly productive implementation environment) and its very robust platform. R0I-2R0. - If all of your applications are written in the 2ava programming language) you will probably want to use 2ava R0I to enable communication between 2ava ob3ects on different virtual machines and different physical machines. >sing 2ava R0I without its II8. option leverages its strengths of code portability) security) and garbage collection. R0I-II8. - If you are writing most of your new applications using the 2ava programming language) but need to maintain legacy applications written in other programming languages as well) you will probably want to use 2ava R0I with its II8. compiler option.R0I-2R0. would be used in an all 2ava solution so choice A is incorrect. +here is no need to rewrite the ob3ects so the system in entirely 2ava based so choice ! is incorrect. +here already are !8RBA ob3ects so although choice % is possible it is not the most appropriate answer.

BC A B ! %

When would you use a 2%B!-8%B! Bridge? +his is the standard) and is used all the time. When you have to use a database that has an 8%B! driver but the 2%B! driver doesnAt e$ist. When you are connecting to a database running on a Windows server ,E+) /CCC etc-. When you need faster response times.

!hoice B is correct. Lou are basically connecting to the 8%B! driver as opposed to directly to the database.!hoice A is incorrectM normally you would 3ust connect directly via 2%B!. Whether you are connecting to a database running on a Windows server ,E+) /CCC etc- ma es no difference at all. *ence choice ! is incorrect. +he 2%B!-8%B! bridge will not increase performance as described in choice %.

B1 Lou have had enough with all the >01 tools on the mar et as none do e$actly what you want them to. &o youAve decided to design your own. *owever when designing it you realise that certain parts will be really complicated for e$ample you have a %iagram ob3ect that is made up of lots of other ob3ects. +his diagram ob3ect can be used for a variety of different diagrams including class and se#uence diagrams. When you create it you only want to specify its type and content. What pattern should you use? A B ! % Abstract (actory (actory 0ethod Builder %ecorator

!hoice ! is correct. +he builder pattern separates the construction and representation of an ob3ect. +he client is shielded from the ob3ects construction only needing to specify itAs content and type. +he Abstract (actory pattern is used for creating many ob3ects that are dependent on each other. *ence choice A is incorrect. +he (actory 0ethod pattern provides an interface for creating an ob3ect that allows either sub classes or helper classes to create that ob3ect. *ence choice B is also incorrect. +he %ecorator pattern isnAt used to build ob3ects. It adds e$tra functionality to e$isting ob3ects. *ence choice % is incorrect.

B/ Lou need to interface with an e$isting application. Lou have full access to the source code and >01 diagrams from the e$isting application. .art of the re#uirements implies that you will need to connect unrelated ob3ects together. Lou want to now whether the Bridge pattern or the Adapter pattern will be suitable. Which of the following are true about the Bridge and Adapter patterns? A +he Adapter pattern implements an interface nown to its clients and provides an instance of a class not nown to its clients. B +he Bridge pattern implements an interface nown to its clients and provides an instance of a class not nown to its clients. ! +he Adapter pattern creates a separation between abstractions and classes that implement those abstractions. % +he Bridge pattern creates a separation between abstractions and classes that implement those abstractions. !hoices A and % are correct.

As the answers state the Adapter pattern implements an interface nown to its clients and provides an instance of a class not nown to its clients. And the Bridge pattern creates a separation between abstractions and classes that implement those abstractions. !hoices B and ! are incorrect because the descriptions are the other way around.

B7 As part of your new application you need to create a custom class loader so that you can implement with custom security. &o you need to create ob3ects without nowing the class of the ob3ects or how to create them. What pattern should you use for this? A B ! % " Abstract factory (actory 0ethod Builder .rototype &ingleton

!hoice % is correct. +his pattern is used to create new ob3ects by copying its prototype. +he Abstract factory pattern is used for creating many ob3ects that are dependent on each other. +herefore choice A is incorrect. +he (actory 0ethod pattern provides an interface for creating an ob3ect defers creation to either sub classes or helper classes. *ence choice B is incorrect. +he Builder pattern separates the construction and representation of an ob3ect. +he client is shielded from the ob3ects construction only needing to specify itAs content and type. !hoice ! is therefore incorrect. +he &ingleton pattern creates either one or a variable number of instances of a class ma ing choice " incorrect.

B9 Lou are creating a web application for an online product ordering system. Lou will be using data from several different databases and to reduce the load on the databases you have decided to use connection pooling. Lou have a !onnection.ool class and you want one pool for each database however you will have to connect to a variable number of databases. What pattern should you use? A B ! % " Abstract factory (actory 0ethod Builder .rototype &ingleton

!hoice " is correct. +he &ingleton doesnAt 3ust create a single instance it can also be used to create a variable number of instances of a class.+he Abstract factory pattern is used for creating many ob3ects that are dependent on each other so choice A is incorrect. +he (actory 0ethod pattern provides an interface for creating an ob3ect defers creation to either sub classes or helper classes. *ence choice B is incorrect. +he Builder pattern separates the construction and representation of an ob3ect. +he client is shielded from the ob3ects construction only needing to specify itAs content and type. !hoice ! is hence incorrect. +he .rototype pattern is used to create new ob3ects by copying its prototype. !hoice % is therefore incorrect.

B; Lou are interfacing with a server that is running as a 20& server and email server. Basically your company has an online shopping store and when a customer buys something you need to send an email confirmation. "mail re#uests will be sent as 20& messages so as to reduce the load on the email server. %oes 20& provide the implementations to allow you to send these messages to the email server? +rueF(alse? A +R>"

(A1&"

+he above statement is (alse. +he 20& only defines interfaces there are no implementation classes in the pac age. &o you will need to write all of the implementations yourself.

B= A B

Is .oint-to-.oint ,.+.- is based on message #ueues? +R>" (A1&"

!hoice A is correct. .oint-to-.oint messaging is typically used where a client application sends a message to another application. +his is the one-to-one messaging paradigm. In contrast) .ublish &ubscribe) allows broadcast communication ,one-to-many.-

B? Lour have decided to let people shopping at your site receive confirmation emails when they buy online. +he emails will not contain their credit card numbers but will contain the amount they have been charged. A 20& re#uest to an email server will be used to do this. *owever you are worried about how secure this will be but a college re-assures you that 20& has security built into it. Is this true? +rueF(alse? A B +R>" (A1&"

+he above is false. +he 20& only defines interfaces so you will need to design your own security around this.

BB LouAve designed an application that allows customers to buy chapters of e-boo s. %ue to the success of the pro3ect this will be launched as a worldwide application. In the process of converting this application to be suitable for worldwide use) which of the following will you use? A 2ava runs with already as standard 1=bit characters as standard so you donAt need to use any particular classes to change the te$t. All primitive ob3ects can be used. B 3ava.te$t pac age ! 3ava.lang.Integer !lass % 3ava.lang.Eumber !lass " 3ava.international pac age ( 3ava.>nicode pac age !hoice B is correct. +he 3ava.te$t pac age contains classes such as 0essage(ormat and Eumber(ormat) these classes are used to layout te$t in the appropriate way.!hoice A is incorrectM primitive ob3ects cannot be used. !hoices ! and % are incorrect because the way numbers are displayed is different in most countries. +he pac ages named in choices " and ( donAt e$ist.

BD A B ! % "

Which of the following are used in Internationali'ation? 3ava.lang.1ong !lass 3ava.lang.(loat !lass 3ava.lang.Eumber !lass 3ava.lang.&tring class char primitive class

!hoices % and " are correct. +he &tring and char primitive classes are used in the process of Internationali'ation.!hoices A) B and ! are all incorrect because its the way numbers are displayed that is different in most countries.

DC A B ! %

What is the ResourceBundle class used for? +o store information about the program) li e an e$ternal configuration file. +o store parts of the program that is 1ocale sensitive) e.g. the te$t on a message window. +o get access to local system resources such as files etc. +o access properties of the users environment) language and a region.

!hoice B is correct. A ResourceBundle is used to store all parts of a program that you will need to change as part of Internationali'ation. (or e$ample you could put the te$t for dialog messages there and when it came to displaying the dialog) the program will loo up and retrieve the appropriate te$t based on the country of the user.!hoice A is incorrect because the ResourceBundle doesnAt store any information about the program li e an e$ternal configuration file. +he ResourceBundle doesnAt give you any access to local resources. *ence choice ! is incorrect. +he properties of the userAs environment) language and a region are found in the users system properties) not the ResourceBundle. *ence choice % is also incorrect.

D1 Lou have been brought in from another pro3ect to help some colleagues with the documentation of an application they have been wor ing on. Lou need to show groups of classes as subsystems. What type of >01 diagram will you use? A B ! % !ollaboration %iagram !lass %iagram .ac age %iagram >se case %iagram

!hoice ! is correct. A pac age diagram is used to show groups of classes that belong together. !hoice A is incorrect because a !ollaboration %iagram is a type of interaction diagram. A !lass %iagram shows individual classes. *ence choice B is incorrect. A >se case %iagram depicts a scenario that the system would be involved in. +hus choice % is also incorrect.(or more information about >014http4FFwww.uml.orgF

D/

What is true about the following diagram?

A B ! %

!lass A inherits from !lass B !lass B inherits from !lass A !lass B will send messages to !lass A !lass A will send message to !lass B

!hoice B is correct. +his diagram shows generali'ation ,or inheritance-. Eote4 Eormally the sub class is be shown below the ancestor) though that is not a >01 constraint.!hoice A is incorrect because it is the other way around. !hoices ! and % are both incorrect because the empty triangle wouldnAt be there in the diagram if messages were being sent.(or more information about >014http4FFwww.uml.orgF

D7

What is the G&omethingG shown in the following diagram?

A B ! %

A component A pac age A component collaboration A super class

!hoice B is correct. +his is a pac age and it represents a group of classes.+he symbol is incorrect for it to be a component. *ence choice A is incorrect. (or this to be part of a collaboration diagram it would need to interact with another ob3ect. *ence choice ! is incorrect. If it were a super class) another class would need to e$tend from it. &o choice % is also incorrect.(or more information about >014http4FFwww.uml.orgF

D9

What is true about the following diagram?

A B !

It is a class called AEame It is a static class called AEame It is an ob3ect called AEame

It is an interface

!hoice ! is correct. Lou can tell this is an ob3ect because its name is underlined. +he following is ta en from ,!ade 9/-4GIf the element name is underlined) then it is an instance of an element. Lou can precede an element name with a 4 and have an anonymous instance. Lou can place a name in front of the 4 and have a named instance of an element.G!hoices A and B are incorrect because the name is underlined. !hoice % is incorrect because the symbol would have the word interface above it li e this4 55interface66 if it were an interface.(or more information about >014http4FFwww.uml.orgF

D;

When should you use 2ava I%1 and when should you use R0I-II8.?

A Lou should use 2ava I%1 when using "nterprise 2avabeans. B Lou should use R0I-II8. when using "nterprise 2avabeans. ! Lou *AI" to use R0I-II8. when using "nterprise 2avabeans. % 2ava I%1 can be used even if the remote interfaces were originally defined as R0I interfaces. " R0I-II8. can be used with !8RBA only if the remote interfaces were originally defined as R0I interfaces. ( R0I-II8. can be used with !8RBA even if not all of the remote interfaces were originally defined as R0I interfaces. < It comes down to programmer preference as both can be used in all situations. !hoices B and " are correct. +he following is ta en from4http4FF3ava.sun.comF3/seF1.7FdocsFguideFidlFinde$.html+his is a fundamental #uestion and itAs important to understand the distinction between these two ways of integrating the 2ava programming language with !8RBA. 2ava I%1 is for !8RBA programmers who want to program in the 2ava programming language based on interfaces defined in !8RBA Interface %efinition 1anguage ,I%1-. +his is Gbusiness as usualG !8RBA programming) supporting 2ava in e$actly the same way as other languages li e !PP or !8B81. R0I-II8. ,Remote 0ethod Invocation over Internet Inter-8RB .rotocol- is for 2ava programmers who want to program to the R0I interfaces) but use II8. as the underlying transport. R0I-II8. provides interoperability with other !8RBA ob3ects implemented in various languages - but only if all the remote interfaces are originally defined as 2ava R0I interfaces. It is of particular interest to programmers using "nterprise 2avaBeans ,"2B-) since the remote ob3ect model for "2Bs is R0I-based. !hoice A is incorrectM 2ava I%1 has nothing to do with "nterprise 2avabeans. In choice ! you can use 2R0. instead of II8. if you want. &o this choice is incorrect. !hoice % is incorrect because 2ava I%1 re#uires !8RBA interfaces not R0I interfaces. !hoice ( is incorrect as all the interfaces must be defined as R0I interfaces. !hoice < is incorrect because although sometimes 2ava-I%1 and R0I-II8. could be used for the same thing) generally a situation will suit one more than the other.

D= Lou have an online shopping application that has been deployed for some time. .reviously all sales had been diverted to another company. Because of the popularity of your site now) you have decided that your application will

handle credit card sales) going forward. Lou will use 20& to send re#uests to charge credit cards to a separate server. Lou need an instant response as to whether the credit card transaction was approved. What type of messaging do you use? A B ! % " .ublishF&ubscribe .oint-to-.oint +opic 0essaging Instant 0essaging Lou wouldnAt use messaging

!hoice " is correct. If you need an instant response you probably wouldnAt use messaging. +he idea of messaging is that you can send messages to other applications and let them process the messages in their own time. (or this solution it will be better to use an "2B and directly #uery the credit card validation server.!hoice A suggests that messages will be broadcast ,oneto-many.- (or credit card validations) there is no need to broadcast the re#uest. Besides the #uestion says that anGinstant response is re#uired.G 0essaging is inherently asynchronous. *ence choice A is incorrect..oint-to-.oint or ./. is a one-to-one messaging architecture. 20& does provide A.Is that allow send-and-forget and send-and-respond messages. +hough a synchronous re#uest is mimic ed here) messaging architecture) unli e R.! models) is not truly synchronous. Eote4 In some ./. implementations ,where a synchronous response is re#uired using messaging-) the sender puts the message in a #ueue. +he receiver polls its #ueue and reads the message. +he receiver then sends a response to another #ueue) which the sender is polling for responses and so on. &o though the credit card validation can be achieved through ./. messaging) if a synchronous R.! call is available) that would be the preferred option.+opic 0essaging is the same as .ublish &ubscribe. *ence choice ! is incorrect. Instant 0essaging refers to a method of chatting on the Internet. *ence choice % is incorrect.

D? Lou are wor ing for a company that aims to provide its customers with the facility to buy and sell shares online. Lou have been loo ing through the re#uirements document and notice that the process of sellingFtransferring shares is very complicated due to the constant price change. *ence you are re#uired to control transactions at a very fine level of granularity. &hould you use !0+ or B0+?!0+ R !ontainer 0anaged +ransactionB0+ R Bean 0anaged +ransaction A B !0+ B0+

!hoice B is correct. B0+ gives you the developer much greater control over the transaction. As the developer) you can start the transaction where you want and end it where you want.!0+ does however give you the advantage of not having to worry about code related to the transaction you can 3ust focus on the business logic instead.+he following is ta en from4 http4FF3ava.sun.comF3/eeFtutorialF1N7-fcsFdocF+ransaction9.html In a bean-managed transaction) the code in the session or message-driven bean e$plicitly mar s the boundaries of the transaction. An entity bean cannot have bean-managed transactionsM it must use container-managed transactions instead. Although beans with container-managed transactions re#uire less coding) they have one limitation4 When a method is e$ecuting) it can be associated with either a single transaction or no transaction at all. If this limitation will ma e coding your bean difficult) you should consider using bean-managed transactions.

DB Lou have contracted by a company to assess an application currently deployed in production. +he application meets all of the companyAs original re#uirements and is coping well with the current number of users. +he company is #uite happy with it. It has been written using ."R1 and !<I scripts and there are no transactions in this system. What do you recommend they do? A B ! % 0igrate the solution to A&. based solution. 0igrate the solution to 2&. and &ervlets. In the future this will be more maintainable solution. @eep it the way it is. 0igrate to 2&.F&ervlets and an Application server. In the future this will be more maintainable solution.

!hoice ! is correct. +he ey to this #uestion is4+he application meets all of the companyAs original re#uirements and is coping with current number of users. +he company is #uite happy with it.+here is no need to change an application that does everything it is supposed to do. !hoice B is technically correct) 2&. and &ervlets will be more maintainable than ."R1F!<I scripts but it is not the most appropriate answer. !hoice % isnAt correct for the same reasons as choice B) in addition to the fact that there appears to be no clear need for using an Application &erver ,there are no transactions and there is no mention of persistence re#uirements.- !hoice A is also incorrect for the same reasons as choice B.

DD Lou have been contracted by a company to e$amine an e$isting system. It consists of .1F&:1 stored procedures a 2&.F+omcat cluster of web servers and an 8racle database. +he owners are saying that maintenance is their biggest problem) every time they try and change code they run into problems. What do you recommend they do? A 0ove the .1F&:1 business logic into &ervlets B +here shouldnAt be any problems with maintenance as the business logic has already been separated from the presentation and data store ,.1F&:1 stored procedures-. ! &eparate the business logic by using an Application &erver. % 1oo through the code ma ing sure it is structured well and commented) separating any duplicated code into a common class. !hoice ! is correct. +he ey to this #uestion is that the business logic has been implemented as .1F&:1 stored procedures. +his means there is a tight coupling between the data store and the business logic. +his will have a direct affect on the maintenance of the application. +o improve this the best thing to do would be move the business logic from the .1F&:1 scripts to an Application &erver and use "nterprise Beans. Another reason why this is the best choice is because they are already using 2&. and +omcat web servers. &o the Application &erver will integrate well into this solution. Lou could move the business logic into &ervlets as suggested in choice A but this would create tight coupling between the business logic and presentation code. +he application would still be hard to maintain) with problem areas at a different place. !hoice B is incorrect as there is tight coupling between the data store and business logic. "ven if the code is properly structured and commented there will still be tight coupling between the data stoe and business logic so choice % is incorrect.

1CC Lou have a method that can e$ecute in a transaction as part of that transaction but it doesnAt matter if it doesnAt. What is the correct attribute in the deployment descriptor? A B ! % " &upports Eot &upported 0andatory Re#uired 1eave is empty as this is the default setting

!hoice A is correct. A method must support e$ecution within a transactional scope) if it is to be e$ecuted as part of a transaction. +he word AsupportsA also implies that although it can be part of a transaction) it doesnAt have to. AEot &upportedA implies the method cannot be e$ecuted as part of a transaction. A0andatoryA and ARe#uiredA imply that the method must be e$ecuted as part of a transaction. 1eaving the deployment descriptor empty is not the default setting for Asupports.A

1C1 A B ! % " ( < *

What do Isolatable and %urable mean with reference to A!I%? Isolatable means only 1 transaction can e$ecute at a time. Isolatable means the transaction is the same as other transactions in structure. Isolatable means a transaction must e$ecute without the interference from other processes or transactions. Isolatable means the transaction was started and finished in the same I0. %urable means the transaction is the same as other transactions in structure. %urable means the integrity of the underlying data source is maintained. %urable means data must be written to the data source before the transaction is complete. %urable means the transaction was started and finished in the same I0.

!hoices ! and < are correct.A!I% stands for Atomic) !onsistent) Isolatable and %urable. All transactions must adhere to this. Isolatable means a transaction must e$ecute without the interference from other processes or transactions. And %urable means data must be written to the data source before the transaction is complete.

1C/ Lou are writing an application that will allow people to communicate directly with each other. +he application will consist of a frame with two panels) they will type their messages in the top panel and read messages in the bottom panel. What is the best way to implement this application) as an Applet or a standard 2ava application? A B As an Applet. As a standard 2ava application.

!hoice B is correct. +he reason for choosing the standard 2ava application over an Applet is all due to security restrictions. In the #uestion is says that the users will need to communicate directly with each other) not bac to the server from which the applet was downloaded. +his wouldnAt be allowed under standard Applet security permissions and although the security settings can be fully customi'ed to allow applets to connect to different machine that is not what applets were designed for. Another ey point to the #uestion is that there is no re#uirement that this communication tool be made available over the web. &o creating this as a standard 2ava application is the most appropriate choice.

1C7

What is true about !0+ ,!ontainer 0anaged +ransactions-?

A B ! %

Wor s for both "ntity and &ession beans. It is more fle$ible than B0+. !an handle transactions at a much finer granularities than B0+. It is less fle$ible than B0+. !annot handle transactions at a finer granularity than B0+. %oes not wor for both "ntity and &ession beans.

!hoices A and ! are correct. "ntity Beans can only use !ontainer 0anaged +ransactions ,!0+- but &ession Beans can use either !0+ or Bean 0anaged +ransactions ,B0+-. &o choice % is the other way around. !0+ is less fle$ible than B0+ and cannot handle transactions at the same level of granularity as B0+) so choice B is incorrect as well.+he following is ta en from4http4FF3ava.sun.comF3/eeFtutorialF1N7-fcsFdocF+ransaction7.htmlIn an enterprise bean with container-managed transactions) the "2B container sets the boundaries of the transactions. Lou can use container-managed transactions with any type of enterprise bean4 session) entity) or message-driven. !ontainer-managed transactions simplify development because the enterprise bean code does not e$plicitly mar the transactionAs boundaries. +he code does not include statements that begin and end the transaction.http4FF3ava.sun.comF3/eeFtutorialF1N7-fcsFdocF+ransaction9.htmlIn a bean-managed transaction) the code in the session or message-driven bean e$plicitly mar s the boundaries of the transaction. An entity bean cannot have bean-managed transactionsM it must use container-managed transactions instead. Although beans with container-managed transactions re#uire less coding) they have one limitation4 When a method is e$ecuting) it can be associated with either a single transaction or no transaction at all. If this limitation will ma e coding your bean difficult) you should consider using bean-managed transactions.

1C9 Lou are developing an online shopping store for an art gallery. +he company aims to bring fine art to the masses and e$pects a huge volume of traffic through the site. +he site allows customers to pay for goods and arrange delivery methods using credit cards. Lou have read through the re#uirements and have a rough design in your head. Which of the following is the most appropriate rough design for this site? A *ave an "ntity Bean to represent the customer. >se a &ervlet to manage the users session and use B0+ to manage the transactions. B *ave an "ntity Bean to represent the customer. >se a &tateful &ession Bean to manage the users session and use B0+ to manage the transactions. ! *ave an "ntity Bean to represent the customer. >se a &ervlet to manage the users session and use !0+ to manage the transactions. % *ave an "ntity Bean to represent the customer. >se a &tateful &ession Bean to manage the users session and use !0+ to manage the transactions. !hoice ! is correct. +he ey to this #uestion is the choice of +ransactions Bean 0anaged +ransactions or !ontainer 0anaged +ransactions. +here is no need to control transactions at a fine level of granularity and "ntity Beans cannot ta e part in B0+. *ence !0+ may be a better choice. +he &ervlet is a more appropriate choice for handling the users session however you would still need another &tateful &ession Bean for the business logic of the application.+he following is ta en from4http4FF3ava.sun.comF3/eeFtutorialF1N7-fcsFdocF+ransaction7.htmlIn an enterprise bean with container-managed transactions) the "2B container sets the boundaries of the transactions. Lou can use container-managed transactions with any type of enterprise bean4 session) entity) or message-driven. !ontainer-managed transactions simplify development because the enterprise bean code does not e$plicitly mar the transactionAs boundaries. +he code does not include statements that begin and end the transaction.http4FF3ava.sun.comF3/eeFtutorialF1N7-fcsFdocF+ransaction9.htmlIn a bean-managed transaction) the code in the session or message-driven bean e$plicitly mar s the boundaries of the transaction. An entity bean cannot have bean-managed transactionsM it must use container-managed transactions instead. Although beans with container-managed transactions re#uire less coding) they have one limitation4 When a method is e$ecuting) it can be associated with either a single transaction or no transaction at all. If this limitation will ma e coding your bean difficult) you should consider using bean-managed transactions.

1C;

When would you use the %A8 pattern in regards to a &tateful &ession Bean?

%A8 R %ate Access 8b3ect !0. R !ontainer 0anaged .ersistence B0. R Bean 0anaged .ersistence A B ! % " ( When using !0. to reduce dependence on underlying data store. When using B0. to reduce dependence on underlying data store. When using B0. to increase performance. When using !0. to increase performance. Lou wouldnAt use a %A8 with &tateful &ession Beans. When writing to a temporary store when e3b.assivate,- is called

!hoice " is correct. Lou would normally use a %A8 with B0. "ntity Beans or &tateless &ession Beans. "ntity Beans permanently persist data and can survive server crashes. !hoices ! and % are incorrect because you would never use a %A8 with !0. irrespective of the type of bean you were dealing with. +he %ata Access 8b3ect does not improve the performance of your application.When you use Bean 0anaged .ersistence you are writing all the &:1 needed to persist the bean yourself. +his means that you are using database specific &:1 and the same &:1 might not wor with a different database vendor. (or simple operations li e !atalog Retrieval) a &tateless &ession Bean is often employed with %A8 as well.+he flow for such operations often loo s li e42&.S!ontroller ,Re#uest .rocessor F Re#uest %ispatcher-S&ervice 1ocatorS&ession BeanS%A8S%atabaseWith both B0. "ntity Beans and &tateless &ession Beans) the %ata Access 8b3ect pattern ,%A8- is used to reduce the dependency between "nterprise Beans and the underlying database. +his means that the data ob3ect manages the connection to the data source and if the data source changes you only need update this one ob3ect) the change doesnAt affect the rest of your application.With &tateful &ession Beans) the data is never permanently stored in a database. +herefore they cannot survive a server crash. &tateful &ession Beans) as the name suggests) are used for maintaining conversational state with clients. +hey are generally more e$pensive in terms of resources ,they are not pooled- and are therefore not normally used for simple database operations such as catalog retrieval.

1C= A B ! % " ( < * I 2

What is the most important item in this list that should be considered when designing an application? &calability 0aintainability Reliability 0eeting the needs of the customer .erformance "nsuring the application is produced on time and within budget &ecure +hat the application is technically the best possible solution Availability "$tensibility

!hoice % is correct. +he most important consideration when designing an application is that it meets the needs of the customer. "nsuring the application is produced on time and within budget is something that should be done but it is not the number one concern. +he application does not have to be the best possible solution under the circumstances. As long as it meets the customerAAs needs) it is considered ade#uate. .erformance - A measure of the system in terms of response time or

number of transactions per unit time. 1oad %istribution ,e.g. %E& Round Robin- and 1oad Balancing are two techni#ues that aid in higher performance. 8ther development and deployment related tas s such as Application +uning) &erver +uning) and %atabase +uning also help the system perform better.&calability - +he ability of a system to perform and behave in a satisfactory manner with increases in load.Reliability - +he ability of a system to assure the integrity and consistency of the application and all its data as the load increases.Availability - +he ability of a system to assure that all services and resources are always accessible. +his can be achieved through fault tolerance ,the ability to prevent system failures in the event of service,s- F component,s- failures) commonly implemented via redundancytechni#ues such as Active and .assive Replication."$tensibility - +he ability to easily add new functionality to the e$isting system. +his can be achieved by using best practices and well-defined architecture and design techni#ues.0aintainability - Ability to easily correct flaws in the e$isting system.&ecurity - +he ability to protect a system and all its components and services against potential attac s. &ecurity attac s generally try to compromise confidentiality and integrity of the system. &ometimes they also ta e the form of A%enial of &erviceA ,%o&- attac s that bring down a system by flooding it with messages. &ecurity can be addressed by the use of technologies ,firewalls) %0Q) data encryption) %igital !ertificates and so on- and methodologies ,good security policies and procedures.-0anageability - +he ability to monitor and perform preventive maintenance on a system.

1C? A B ! % " (

Which list shows the correct order of "nterprise Beans in terms of resources?Eote4 *eaviest to lightest. &tateful &ession Bean) &tateless &ession Bean) "ntity Bean "ntity Bean) &tateful &ession Bean) &tateless &ession Bean &tateful &ession Bean) "ntity Bean) &tateless &ession Bean "ntity Bean) &tateless &ession Bean) &tateful &ession Bean &tateless &ession Bean) &tateful &ession Bean) "ntity Bean &tateless &ession Bean) "ntity Bean) &tateful &ession Bean

!hoice B is correct. An "ntity Bean is the heaviest bean in terms of resources usage. +he state of an "ntity Bean is permanently persisted in a database. 0a ing a connection to the database is e$pensive in terms of !.> time so this bean has to be the most e$pensive. &tateful &ession Beans maintain their state by the !ontainer writing the beans state to a temporary store such as a file. &tateless &ession Beans are least e$pensive because they have no state to persist) even temporarily.

1CB Lou need to maintain a userAs session for a web application. Which protocol do you use? Eote4 +here is no secure data in this application. A B ! % " II8. *++.& &*++. *++. 2R0.

!hoice % is correct. +his is a tric #uestion. At first you would thin that the best possible choice would be to use *++.&. *owever all the #uestion is actually as ing is how to maintain a userAs session. +his can be done through >R1 re-writing) coo ies or letting the web server handle the session. 0ost modern web servers can trac clients and maintain sessions for them. +here is also no need for the security that *++.& would give you and as encrypting each users session would be

e$pensive in terms of !.> time choice B cannot be correct. 2R0. and II8. are &tateful protocols but are not suitable for web applications.

1CD Lou are designing an application to be used to edit photographs. +he aim of the application is to provide effects such as converting a color picture to blac and white) enlarging certain areas of the print) creating a watercolor effect etc. At the moment the application is structured so that the photographic image is represented by one ob3ect) other ob3ects represent each effect and a control ob3ect is used to co-ordinate with these ob3ects. When the user selects the color to blac and white effect it changes the state of the !olor ob3ect to Blac and White. +his then needs to coordinate with the control ob3ect and apply the effect. Basically as the state of the effects ob3ects changes it need to coordinate with the photographic image ob3ect.Which design pattern do you use? A B ! % " ( !hain of Responsibility. Eotifier 8bserver 0ediator !ommand &tate

!hoice % is correct. +he ey to this #uestion is that this application uses a !ontrol ob3ect to co-ordinate state changes between ob3ects. +he 0ediator pattern allows you to co-ordinate state changes between other ob3ects by using one ob3ect. +here is no design pattern called the Eotifier in the <ang of (our boo or in the 2/"" blueprint patterns catalog. 0ediator - ,<8( /?7-4G%efine an ob3ect that encapsulates how a set of ob3ects interact. 0ediator promotes loose coupling by eeping ob3ects from referring to each other e$plicitly) and it lets you vary their interaction independently.G+he other patterns were4!hain of Responsibility - ,<8( //7-4GAvoid coupling the sender of a re#uest to its receiver by giving more than one ob3ect a chance to handle the re#uest. !hain the receiving ob3ects and pass the re#uest along the chain until an ob3ect handles it.G!ommand - ,<8( /77-4G"ncapsulate a re#uest as an ob3ect) thereby letting you parameteri'e clients with different re#uests) #ueue or log re#uests) and support undoable operationsG&tate - ,<8( 7C;-4GAllow an ob3ect to alter its behaviour when its internal state changes. +he ob3ect will appear to change its class.G&trategy - ,<8( 71;-4G%efine a family of algorithms) encapsulate each one) and ma e them interchangeable. &trategy lets the algorithm vary independently from clients that use it.G 11C Lou are designing an application that will need to use &&1 to transmit data securely from one application to another. Lou now that you can easily get hold of e$isting implementations of &&1 to use in your application but youAd li e to learn more about &&1 and have decided to implement your own version. Lou now that as part of the &&1 handsha e the client and server must agree a method of encryption. +he problem is you donAt now which method of encryption that will be. Which design pattern will help with this? Eote4 +his is not a web-based application. A B ! % " %ecorator Interpreter &trategy !omposite +emplate 0ethod

!hoice ! is correct.

+here are really only two possible answers for this #uestion) the &trategy pattern and the +emplate 0ethod pattern. +he &trategy pattern is the better choice because the algorithms are encapsulated so that they can be used interchangeably. &o you can add R&A) %"&) etc. and then during the handsha e the server can select the appropriate encryption ob3ect.&trategy - ,<8( 71;-4G%efine a family of algorithms) encapsulate each one) and ma e them interchangeable. &trategy lets the algorithm vary independently from clients that use it.G+he other patterns were4Interpreter - ,<8( /97-4G<iven a language) define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.G%ecorator - ,<8( 1?;-4GAttach additional responsibilities to an ob3ect dynamically. %ecorators provide a fle$ible alternative to subclassing for e$tending functionality.G!omposite - ,<8( 1=7-4G!ompose ob3ects into tree structures to represent part-whole hierarchies. !omposite lets clients treat individual ob3ects and compositions of ob3ects uniformly.G+emplate 0ethod - ,<8( 7/;-4G%efine the s eleton of an algorithm in an operation) deferring some steps to subclasses. +emplate 0ethod lets subclasses redefine certain steps of an algorithm without changing the algorithmAs structure.G

111 Lou are a !omputer &cience lecturer at a top >niversity. Lou are giving a presentation of a new piece of software you have written. Basically you have written the ne$t generation spell chec er) the reason yours is so good is that it can learn the common typing mista es of an individual user. Lou have already sold licenses to many ma3or software vendors and plan to retire in the &un. *owever before you go they all re#uire slight changes in the logic to suit their individual needs. What design pattern will help you slightly change the logic in a class to be used in many applications? A B ! % " &trategy Adapter 0ediator Interpreter +emplate 0ethod

!hoice " is correct. +emplate 0ethod - ,<8( 7/;-4G%efine the s eleton of an algorithm in an operation) deferring some steps to subclasses. +emplate 0ethod lets subclasses redefine certain steps of an algorithm without changing the algorithmAs structure.G+he other design patterns4&trategy - ,<8( 71;-4G%efine a family of algorithms) encapsulate each one) and ma e them interchangeable. &trategy lets the algorithm vary independently from clients that use it.G0ediator - ,<8( /?7-4G%efine an ob3ect that encapsulates how a set of ob3ects interact. 0ediator promotes loose coupling by eeping ob3ects from referring to each other e$plicitly) and it lets you vary their interaction independently.GInterpreter - ,<8( /97-4G<iven a language) define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.G

11/

When would you use the Iisitor pattern?

A Lou need two unconnected ob3ects to be able to send messages to each other. B Lou need two connected ob3ects to be able to send messages to each other. ! Lou need to create a new operation on an ob3ect and you will change the classes of elements on which it operates. % Lou need to create a new operation on an ob3ect without changing the classes of elements on which it operates. !hoice % is correct. +o solve the problem described in choice A) you would use the Adapter pattern. +here is no problem described in choice B as the ob3ects are already connected and would be able to send messages to each other. In the Iisitor pattern you donAt change the classes of elements on which it operates.Iisitor - ,<8( 771-4GRepresent an operation to be

performed on the elements of an ob3ect structure. Iisitor lets you define a new operation without changing the classes of the elements on which it operates.G

117 Lou have been reading the <ang of (our pattern boo again and you suddenly notice a similarity between a design pattern and publish-subscribe messaging. What design pattern is similar to publish-subscribe messaging? A B ! % " ( < .ublisher pattern. (lyweight pattern. 8bserver pattern. !hain of Responsibility pattern. &ubscribe pattern. Iisitor pattern. .ro$y pattern.

!hoice ! is correct. +he observer pattern is similar to publish-subscribe messaging. +here are no patterns called .ublisher or &ubscribe in the <ang of (our pattern boo .8bserver - ,<8( /D7-4G%efine a one-to-many dependency between ob3ects so that when one ob3ect changes state) all its dependents are notifies and updated automatically.G+he other patterns were4Iisitor ,<8( 771-4GRepresent an operation to be performed on the elements of an ob3ect structure. Iisitor lets you define a new operation without changing the classes of the elements on which it operates.G!hain of Responsibility - ,<8( //7-4GAvoid coupling the sender of a re#uest to its receiver by giving more than one ob3ect a chance to handle the re#uest. !hain the receiving ob3ects and pass the re#uest along the chain until an ob3ect handles it.G(lyweight - ,<8( 1D;-4G>se sharing to support large numbers of fine-grained ob3ects efficiently.G.ro$y - ,<8( /C?-4 G.rovide a surrogate or placeholder for another ob3ect to control access to it.G.ublish &ubscribe 0essaging4 <enerally .ubF&ub is used when a one to many broadcast of messages is re#uired. A.roducersA sends messages to many clients via virtual channels called A+opics.A A!onsumersA receive messages by subscribing to topics. !onsumers receive a copy of all messages in the topic they have subscribed to. +he .ublish &ubscribe Architecture is generally a push-based model. !onsumers may optionally establish AdurableA subscriptions that allow them to collect messages after periods of inactivity.

119 A B ! % " (

Which statements describe .ublish-&ubscribe 0essaging and which describe .oint +o .oint 0essaging? .ublish-&ubscribe 0essaging is a message #ueue system. .ublish-&ubscribe 0essaging R 8ne sender and one receiver. .oint +o .oint 0essaging R E senders and one receiver. .ublish-&ubscribe 0essaging R 1 sender and n receivers. .oint +o .oint 0essaging is a message #ueue system. .oint +o .oint 0essaging R 8ne sender and one receiver.

!hoices % and ( are correct. .ublishF&ubscribe is li e someone publishing one message on a bulletin board and that message being read byFemailed to many subscribers. ,8ne - many-. .oint to point messaging is a one-to-one relationship e.g. a message from one application to another. ,(rom one point to one other point-(or more detailed e$planations4.ublish &ubscribe 0essaging4 <enerally .ubF&ub is used when a one to many broadcast of messages is re#uired. A.roducersA sends messages to many clients via virtual channels called A+opics.A A!onsumersA receive messages by subscribing to topics. !onsumers receive a copy of all messages in the topic they have subscribed to. +he .ublish &ubscribe Architecture is

generally a push-based model. !onsumers may optionally establish AdurableA subscriptions that allow them to collect messages after periods of inactivity..oint-to-.oint 0essaging4 .oint-to-point4 +he point to point messaging model allows both Asend and receiveA and Asend and forgetA messages) via virtual channels called A#ueues.A +he p/p model typically uses a ApullA or ApollingA model. In this model) clients generally re#uest messages from #ueues.

11; As part of an application you are developing you need to move the state of an ob3ect but not its behavior. What should you use? A B ! % " *++.& !8RBA R0I 2R0. II8.

!hoice B is correct. !8RBA only moves the state of an ob3ect but R0I moves the ob3ects behavior as well. !hoice A is not appropriate as it is a stateful protocol and is not a framewor for moving ob3ects. !hoices % and " are incorrect as they are both names of protocols used by R0I and !8RBA respectively. +hese are both protocols) not framewor s for moving ob3ects.

11= Which of the following is an accurate description of what the 3ava.te$t pac age used for with regards to Internationali'ation? A B ! % !ontains dictionaries of foreign languages. !ontains classes used to read te$t in foreign languages. !ontains classes that support locale-specific manipulation of te$t. !ontains classes used to convert te$t into languages that use special symbols.

!hoice ! is correct. +he following is ta en from4http4FF3ava.sun.comF3/seF1.7FdocsFapiF3avaFte$tFpac age-summary.html.rovides classes and interfaces for handling te$t) dates) numbers) and messages in a manner independent of natural languages. +his means your main application or applet can be written to be language-independent) and it can rely upon separate) dynamically lin ed locali'ed resources. +his allows the fle$ibility of adding locali'ations for new locali'ations at any time.

11? A B ! %

Which of the following statements about the .roperties class are true? Is used to get access to local system resources such as files etc +o store information about the program) li e an e$ternal configuration file. It should only be used to store &trings. It should be used to store all types of ob3ects.

!hoice ! is correct.

Although choice % is technically correct this ind of use is strongly discouraged ,see below for an e$planation-. +he .roperties class stores no information about the .rogram and gives you no access to local system resources so choices A and B are incorrect.+he following is ta en from4http4FF3ava.sun.comF3/seF1.7FdocsFapiF3avaFutilF.roperties.html+he .roperties class represents a persistent set of properties. +he .roperties can be saved to a stream or loaded from a stream. "ach ey and its corresponding value in the property list is a string. A property list can contain another property list as its GdefaultsGM this second property list is searched if the property ey is not found in the original property list. Because .roperties inherits from *ashtable) the put and putAll methods can be applied to a .roperties ob3ect. +heir use is strongly discouraged as they allow the caller to insert entries whose eys or values are not &trings. +he set.roperty method should be used instead. If the store or save method is called on a GcompromisedG .roperties ob3ect that contains a non-&tring ey or value) the call will fail.

11B LouAve designed an application that allows customers to buy chapters of e-boo s. %ue to the success of the pro3ect this will be launched as a worldwide application. Lou need to be able to get access to the users environment to tell what language your application should display the te$t in. What class will help you do this? A B ! % " ( < 1ocali'ation class .roperties class 1ocale class Eational class International class "nvironment class Runtime class

!hoice ! is correct. +here are no classes called 1ocali'ation) Eational) International and "nvironment as part of the 2ava %evelopment @it. +he following is ta en from4http4FF3ava.sun.comF3/seF1.7FdocsFapiF3avaFutilF1ocale.htmlA 1ocale ob3ect represents a specific geographical) political) or cultural region. An operation that re#uires a 1ocale to perform its tas is called locale-sensitive and uses the 1ocale to tailor information for the user. (or e$ample) displaying a number is a localesensitive operation--the number should be formatted according to the customsFconventions of the userAs native country) region) or culture.+he .roperties class represents a persistent set of properties. +he .roperties can be saved to a stream or loaded from a stream. "ach ey and its corresponding value in the property list is a string."very 2ava application has a single instance of class Runtime that allows the application to interface with the environment in which the application is running. +he current runtime can be obtained from the getRuntime method.

11D

What is true about the following diagram?

A B ! %

!lass1 has a public attribute called AnAttribute !lass1 has a private attribute called AnAttribute !lass/ has a public attribute called AnAttribute !lass/ has a private attribute called AnAttribute

!hoice % is correct. +he diagram shown here is a class diagram. Attributes are shown above methods. +he symbols used to describe visibility in >01 are4P public) T protected) - private(or more information about >01 please go to4http4FFwww.uml.orgF

1/C Lou have been developing a 7-+ier web application to sell imported cars at huge discounts to customers. Lou have many types of customers) ranging from individuals to corporate customers. Lou have "ntity Beans to represent the !ars and &tateful &ession Beans for the business logic involved in pricing and selling a car. In the &ession Bean there are methods that apply discounts depending on who the customer is. Lou only want the client to be able to e$ecute these methods for corporate customers. Is it possible to specify which methods can and canAt be e$ecuted on a &ession Bean or will this ind of security need to be coded by the developer? A B ! Les this is possible. Eo this will need to be coded by the %eveloper. It is not possible to do this even by writing you own code.

!hoice A is correct. It is possible to specify who is allowed to access to business methods. (irstly you define security roles e.g. 5security-role6 5description6A corporate customer5Fdescription6 5role-name6!orporate5Frole-name6 5Fsecurity-role6 +hen you can grant method permissions) e.g. 5method-permission6 5role-name6 !orporate5Frole-name6 5method6 5e3b-name6!ar&ale5Fe3b-name6 5method-name6Apply%iscount5Fmethod-name6 5Fmethod6 5Fmethod-permission6

1/1 A B ! %

What type of diagram is this diagram? %eployment !ollaboration !omponent Activity

!hoice ! is correct. +he diagram shown here is a !omponent diagram. +o see e$amples of other diagrams please visit4http4FFwww.uml.orgF

1// Lou wor colleague is always boasting about how fast his .! is. &o as a lighthearted 3o e you decide to write an applet to slow his .! down. Basically you are going to write an applet that tries to wor out the s#uare roots of huge

numbers. In order to use up his resources) your applet will spawn a new thread every twenty to thirty seconds. Will this wor or would the 2ava security manager stop it. A It will wor . B +he security manager ill the Applet as soon as it tries to use more resources than are specified in the security.policy file. ! +he Applet will only use up the memory itAs initially allocated and therefore wonAt use up any more resources than that. !hoice A is correct. Although Applets have very tight restrictions and e$ecute within a sandbo$ they can actually use as many system resources as the operating system allows them. +here is no reference to the amount of memory an Applet can use in the security.policy file so choice B is incorrect. !hoice ! is almost right but not the most appropriate choice. +he operating system will allocate memory initially for the 2I0 to run in but it is possible for this to be e$tended once the 2I0 is running but this is entirely dependent on the operating system.

1/7 Lou have been given a 2AR file that has been signed by a 7rd .arty Iendor. A +rusted !ertificate Authority ,!A- has signed the 7rd .arty Iendors certificate. Is it possible to add any more classes to this 2AR file?+rueF(alse? A B Les Eo

!hoice A is correct. When you sign a 2AR file you are not signing the 2AR file itself but individual files it contains. +his means you can use a tool li e WinQip to add new files ,classes) images etc- to the e$isting 2AR file without necessarily invalidating the signature. Eote4 +he files that have been added wonAt be signed.

________________________________
Done upto here on 22.2.03 1/9 Lou are wor ing on a new application that will help your company co-ordinate sales data across different departments. +he aim is that everyone has the same sales data at the same time. +his pro3ect needs to be finished as soon as possible. Lou have therefore bought some third party code to speed up the development process. +he code has been signed and is pac aged in a 3ar file. +o test the signature the vendor of the software has emailed you the public ey. What do you now about it? A B ! % " ( < +he code is fully tested and performs the tas it was designed for. +he 3ar file contains no malicious code. +he code could not have been modified after it was signed. If the public ey doesnAt validate the signature then you now all the code is malicious. +he code could not have been modified after it was signed. If the public ey validates the signature then you now all the code is safe. Eone of the above.

!hoice < is correct. +here are two ey elements to this #uestion. (irstly this is a #uestion about digital signatures) not digital certificates and secondly you were emailed the public ey to validate the signature. Lou havenAt been passed the public ey in a secure fashion so how do you now that someone hasnAt altered the code signed it and then intercepted the ey that you were

going to use to validate the signature. %igital certificates solve this problem and validate that a public ey belongs to its real owner.2ust because the code is signed it doesnAt mean that it is fully tested and does what it is supposed to do. !hoices B) !) %) " and ( are incorrect because you donAt now if you have the real public ey to validate the signature.

1/; Lou should use "2Bs even if there is E8 data to persist in your application but there are transactions.+rueF(alse? A B +R>" (A1&"

!hoice A is correct. It is recommended that you use "nterprise 2avabeans if +ransactions are involved in the application. &ee below for more details.+he following is ta en from4http4FF3ava.sun.comF3/eeFtutorialF1N7-fcsFdocF"2B!oncepts/.html+he application must be scalable. +o accommodate a growing number of users) you may need to distribute an applicationAs components across multiple machines. Eot only can the enterprise beans of an application run on different machines) but their location will remain transparent to the clients. +ransactions are re#uired to ensure data integrity. "nterprise beans support transactions) the mechanisms that manage the concurrent access of shared ob3ects. +he application will have a variety of clients. With 3ust a few lines of code) remote clients can easily locate enterprise beans. +hese clients can be thin) various) and numerous.

1/= A B ! %

In "2B /.C what is the !omponent interface? +he interface that 0essage-%riven Beans must implement +here is no component interface in "2B /.C. +he new name for the *ome interface. +he new name for the Remote interface.

!hoice % is correct. Eote4 +his type of #uestion will not be in the "2B 1.1 version of the &!"A but is li ely to be in the "2B /.C version of the &!"A.0essage-%riven beans donAt implement any interfaces in "2B /.C. +he !omponent interface is the new name for the Remote interface as introduced in the "2B /.C specification.Remote Interface ,!omponent Interface in "2B /.C-4 %efines the BeanAs business methods. +he Remote Interface e$tends 3ava$.e3b."2B8b3ect.*ome Interface4 %efines the BeanAs life cycle methods - creation) location and removal. +he *ome Interface e$tends 3ava$.e3b."2B*ome. Eote that the create method is optional for "ntity Beans. +his is useful when you do not want to clients to be able to insert data into the database.

1/? Lou are wor ing on a new application that will help your company co-ordinate sales data across different departments. +he aim is to have everyone access the same sales data at all times. +his pro3ect needs to be finished as soon as possible and you have bought some third party code to speed up the development process. +he code has been signed using a digital certificate and pac aged in a 3ar file. What do you now about it? Eote4 %igital certificates have been provided that have been signed by a trusted !ertificate Authority. A B ! % " +he 3ar file contains no malicious code. +he 3ar file was signed by the 7rd party vendor +he 3ar file contents may contain malicious code. &omeone impersonating the 7rd party vendor may have signed the 3ar file. +he code is fully tested and performs the tas it was designed for.

!hoice ! is correct. All you actually now is that the code has been signed using the 7rd party vendors private certificate. Lou donAt now that it was actually signed by the 7rd party vendor. (or e$ample if the certificate was copied or stolen then there is no guarantee that the thief hasnAt distributed code signed with the stolen certificate. +he 3ar file may contain malicious code or it may not) that is all you can guarantee. 2ust because code is signed doesnAt mean it is fully tested and does what it was supposed to do. !hoice " is therefore incorrect.

1/B Lou have been contracted by a movie memorabilia company to set up an online shop. +he company buys bul goods from movie sets ,stage props) costumes) gadgets etc-) splits them into single items and then auctions them. +he company used to hire sports halls or community centers to auction items in a traditional manner. +hey predict that by moving to an online solution they will reach a wider audience and ma e a greater profit despite the initial investment that the new system will involve. What is the most suitable initial design in the list below? A +he business logic will be handled in a &ervlet B +he business logic will be handled in a &tateful &ession Bean ! >se !ontainer 0anaged +ransactions % >se Bean 0anaged +ransactions " +he customer will be represented wth an "ntity Bean ( +here is no need for a customer bean as a customers interaction with the site is 3ust business logic and will be handled in the &ervletF&tateful &ession Bean < >se !ontainer 0anaged .ersistence * >se Bean 0anaged .ersistence I +he sale items will be represented with an "ntity Bean 2 +he sale items will be stored directly on a database !hoices B) %) ") < and I are correct. +his is #uestion is really ; mini #uestions. If the business logic is put into the &ervlet you are creating (at clients with presentation and business logic tightly coupled. +herefore it is more appropriate to use a &tateful &ession Bean especially since the Bean can be used in the &ession (aKade pattern ,&ee below-. +he site is an online auction site with bids being placed at different times. +his implies that transactions will need to be handled at a very fine level of granularity therefore Bean 0anaged +ransactions is the most appropriate choice. +he customer and sales items both need to be persisted so they should be implemented as "ntity Beans. +he "ntity Beans ,customer and sales items- would not be complicated ob3ects so !ontainer 0anaged .ersistence would be the better choice.&ession (aKade4A client should neverGtal G directly to an "ntity "2B. Instead a &ession to "ntity pattern called a &ession-(aKade should be used. As the name suggests) this pattern is based on the <o( (aKade pattern. +he &ession (acade provides a simple interface to a comple$ subsystem. +he simple interface is the &ession Bean and the !omple$ subsystem is the "ntity Bean. +he client tal s to the &ession Bean) which in turn communicates with the "ntity Bean.

1/D Lou have an application that is running in a %0Q that your company has set up. +here are two firewalls) the first filters out pac ets based on destination ports other than port BC ,allows standard *++. re#uests-. +he second filters out pac ets based on the origin I. address ,only allows company I. addresses through-. !an you connect to the application running in the %0Q from your *ome computer? Eote4 +he application running in the %0Q is on port BC. +rueF(alse?

A B

+rue (alse

+he above statement is +rue. %0Q stands for %emilitari'ed 'one. +o set up a %0Q you need two firewalls and you create 7 separate regions. +he different regions are the internet) %0Q ,in the middle- and the third is your networ . Lou would have a server in the %0Q that is accessible to both the public and your networ . +he internet may not access your networ but they can access the server in the %0Q. Lour networ must access the internet through the server in the %0Q.+he ey to this #uestion is that you are not trying to connect to an application within the second firewall that filters out re#uests based on I. address. &o you could definitely connect to the application from home.A >seful lin 4http4FFwww.saintrochtree.comFnetwor -advicesFCCCCC9.htm

17C +he "nterprise 2avaBean /.C specification has introduced the notion of local !lients. What are 1ocal !lients and why were they introduced? A 1ocal !lients should be used when the web server is running on the same machine as the application server. B 1ocal !lients should be used when &ession Beans need to communicate with "ntity Beans. Beans in the same Iirtual 0achine should use local !lients. ! 1ocal !lients have been introduced to ma e testing code easier. % 1ocal !lients have been introduced to improve maintainability. " 1ocal !lients have been introduced to improve performance. ( 1ocal !lients should be used when the database is running on the same machine as the application server. !hoices ! and ( are correct. Eote4 +his type of #uestion will not be in the "2B 1.1 version of the &!"A but is li ely to be in the "2B /.C version of the &!"A..rior to the "nterprise 2avaBean /.C specification all Bean clients were seen as remote clients. +his meant that if a &ession Bean needed to tal to an "ntity Bean inside the same Iirtual 0achine it would still need to ma e a remote call. +his obviously had a direct impact on performance. In "2B /.C "nterprise Beans can now treat other beans in the same I0 as local clients. 1ocal !lients can access the beans through its local and local home interfaces.Remote clients use pass-by-value but 1ocal clients use pass-by-reference.(or more information please see4http4FF3ava.sun.comFproductsFe3bF/.C.html

171

Which of the following offers an accurate description of 0essage-%riven "nterprise Beans?

A 0essage-%riven beans are 3ust a new way of describing a 20& message. +his has been formali'ed with the "2B /.C specification. B A 0essage-%riven bean is an enterprise bean that allows 2/"" applications to process messages asynchronously. ! A 0essage-%riven bean is an enterprise bean that allows 2/"" applications to process messages synchronously. % A 0essage-%riven bean is used when you need to interact with messaging systems other than 20&. " A 0essage-%riven bean is li e a &ession Bean e$cept that if the server is busy it will put the 0essage-%riven beansA method re#uests in a #ueue and e$ecute them one at a time to reduce the load on the Application &erver. !hoice B is correct.

Eote4 +his type of #uestion will not be in the "2B 1.1 version of the &!"A but is li ely to be in the "2B /.C version of the &!"A.As stated in choice B a 0essage-%riven bean is an enterprise bean that allows 2/"" applications to process messages asynchronously. !hoice ! is incorrect because messages are sent asynchronously. !hoices A) % and " are all factually incorrect. (or more information about 0essage-%riven beans see below.+he following is ta en from4http4FF3ava.sun.comF3/eeFtutorialF1N7-fcsFdocF"2B!oncepts;.htmlA message-driven bean is an enterprise bean that allows 2/"" applications to process messages asynchronously. It acts as a 20& message listener) which is similar to an event listener e$cept that it receives messages instead of events. +he messages may be sent by any 2/"" component-an application client) another enterprise bean) or a Web component--or by a 20& application or system that does not use 2/"" technology. 0essage-driven beans currently process only 20& messages) but in the future they may be used to process other inds of messages.

17/

WhatAs the biggest difference between 0essage-%riven Beans and "ntity and &ession Beans?

A +here is no difference in structure between 0essage-%riven Beans and "ntity and &ession Beans. +hey all have *ome) Remote interfaces and a bean class. B 0essage-%riven beans donAt have a *ome interface. ! A 0essage-%riven bean is different from &ession Beans because its state is persisted. % !lients donAt access 0essage-%riven beans through interfaces. !hoices B and % are correct.

Eote4 +his type of #uestion will not be in the "2B 1.1 version of the &!"A but is li ely to be in the "2B /.C version of the &!"A.!hoice A is incorrect) 0essage-%riven beans donAt have *ome or Remote interfaces) they 3ust have a bean class. +he state of 0essage-%riven beans is not persisted li e "ntity beans. &o choice ! is incorrect.+he following is ta en from4http4FF3ava.sun.comF3/eeFtutorialF1N7-fcsFdocF"2B!oncepts;.html+he most visible difference between message-driven beans and session and entity beans is that clients do not access message-driven beans through interfaces. >nli e a session or entity bean) a message-driven bean has only a bean class.

177 A B ! %

When should you use 0essage-%riven Beans? If you need to send any 20& message. When you need to use an e$ternal service such as a credit card validation service and performance is essential. When you need to send 20& messages asynchronously. When you need to send 20& messages synchronously.

!hoice ! is correct. Eote4 +his type of #uestion will not be in the "2B 1.1 version of the &!"A but is li ely to be in the "2B /.C version of the &!"A.!hoice B is incorrect) 0essage-%riven beans will not increase the performance of a service. !hoice % is the other way around and choice A is factually incorrect.+he following is ta en from4http4FF3ava.sun.comF3/eeFtutorialF1N7fcsFdocF"2B!oncepts;.html&ession beans and entity beans allow you to send 20& messages and to receive them synchronously) but not asynchronously. +o avoid tying up server resources) you may prefer not to use bloc ing synchronous receives in a server-side component. +o receive messages asynchronously) use a message-driven bean.

179 Lou are developing an application that will have to support a huge number of users. Lou are worried about the performance of the application because you need to use many "ntity Beans. A wor colleague has suggested using the Ialue 8b3ect design pattern. What is the pattern and how will it benefit you? A A snapshot of the state of an "ntity Bean at a particular time. B An ob3ect that is used instead of an "ntity Bean. (or e$ample if you were going to use a !ustomer bean you would create a !ustomer Ialue 8b3ect and the Application &erver would use this instead. A &tateful &ession Bean would control it. ! An ob3ect that is used instead of an "ntity Bean. (or e$ample if you were going to use a !ustomer bean you would create a !ustomer Ialue 8b3ect and the Application &erver would use this instead. A &tateless &ession Bean would control it. % +here is no such thing as a Ialue 8b3ect design pattern. " +here is a Ialue 8b3ect design pattern but it would not be appropriate to use it here. ( A Ialue 8b3ect is the state of an "ntity Bean that is ept in memory by the Application &erver. ,Its state is periodically persisted.< A Ialue 8b3ect is the state of an "ntity Bean that is ept in memory by the Application &erver. ,Its state is not persisted and the data becomes stale after a while.!hoice A is correct. Eote4 +his type of #uestion will not be in the "2B 1.1 version of the &!"A but is li ely to be in the "2B /.C version of the &!"A."very time you access an "ntity Bean there is a significant overhead) as the call must go across the networ and through the container to access the bean. 8ne way to reduce the number of calls you need to ma e to "ntity beans is by using the Ialue 8b3ect pattern. A Ialue 8b3ect ,I8- is a snapshot of the state of an "ntity Bean at a particular time. +he idea is that a client will re#uire more than one value from an "ntity bean so instead of ma ing several calls to an "ntity Bean a Ialue 8b3ect is created containing all of these values. +his Ialue 8b3ect is downloaded by the client so they can ma e the same calls only this time locally and directly on the bean. A Ialue 8b3ect is normally implemented as a 2avaBean and is made immutable because there is no data synchroni'ation ,the 2avaBean only provides getter methods-.

17; Lour have been contracted by a company to upgrade their online shopping application. +heir site sells health care insurance to customers at huge discounts. +he process of buying insurance is complicated. +hey have however tried to simplify it as much as possible for the customer. When the customer arrives at their site to register) they fill out a 9C-#uestion #uestionnaire covering basic health and lifestyle information. +he answers are then used for selecting the most appropriate level of insurance. ,"ach customer does E8+ get a custom health care insurance agreementM they get the most suitable one out of a choice of 7C-. +he customer then has the opportunity to purchase the insurance within seven days before the #uote becomes void. Based on the rough description of the system which of the following is the most suitable design? Eote4 +his #uestion should be based upon the "2B /.C specification. A B ! % " ( < * +he !ustomer should be an "ntity Bean +he business logic should be represented with a &tateful &ession Bean. +he business logic should be represented with a &ervlet. +he system should use !0+. &hould use B0+. +he *ealth .lan should be an "ntity Bean that supports local clients. +he *ealth .lan should be a &tateful &ession Bean. +he *ealth .lan should be a &tateful &ession Bean that supports local clients.

I +here is no need for !ustomer Bean as there is no need to store the customers details 3ust the *ealth .lan they bought. 2 +he !ustomer should be an "ntity Bean that supports local clients. !hoices B) %) ( and 2 are correct. Eote4 +his type of #uestion will not be in the "2B 1.1 version of the &!"A but is li ely to be in the "2B /.C version of the &!"A.+he data that needs to be persisted are the customer data and the !ustomerAs *ealth .lans data ,which one out of the 7C different plans.- Although the process of buying health care insurance sounds complicated ,9C-#uestion #uestionnaire- the data that actually needs to be stored is very simple ,customer id) health plan id etc-. +his means that !0+ is more appropriate than B0+ ,choice " is therefore incorrect.- +here is no benefit in putting the business logic in a &ervlet) there still needs to be a &ession Bean to tal to the !ustomer and *ealth .lan "ntity Beans. It is also possible to use the "ntity Beans local client interfaces ,introduced in "2B /.C- which will improve the performance of the application.

17= A B ! %

What are the benefits of synchronous messaging? 1ess coupling between the sender and receiver. Eetwor doesnAt have to be available. %oes not bloc the sender. <ood for transaction processing.

!hoice % is correct. !hoices A) B and ! are all describing asynchronous messaging. &ynchronous) tightly coupled communication between distributed components4 +his is the model of !8RBA) R0I) "2B and so on. +he programming model is called Remote .rocedure !all ,R.!-.Asynchronous) loosely coupled communication between components4 +his is the 0essage 8riented 0iddleware or 080 model. +he programming model is called 0essaging.

17? A B

!an you use B0+ ,Bean 0anaged +ransactions- with "ntity Beans?+rueF(alse? Les Eo

!hoice B is correct. "ntity Beans can only use !ontainer 0anaged +ransactions ,!0+- but &ession Beans can use either !0+ or Bean 0anaged +ransactions ,B0+-. !0+ is less fle$ible than B0+ and canAt handle transactions at the same level of granularity as B0+.+he following is ta en from4http4FF3ava.sun.comF3/eeFtutorialF1N7-fcsFdocF+ransaction7.htmlIn an enterprise bean with container-managed transactions) the "2B container sets the boundaries of the transactions. Lou can use container-managed transactions with any type of enterprise bean4 session) entity) or message-driven. !ontainermanaged transactions simplify development because the enterprise bean code does not e$plicitly mar the transactionAs boundaries. +he code does not include statements that begin and end the transaction.http4FF3ava.sun.comF3/eeFtutorialF1N7-fcsFdocF+ransaction9.htmlIn a bean-managed transaction) the code in

the session or message-driven bean e$plicitly mar s the boundaries of the transaction. An entity bean cannot have bean-managed transactionsM it must use container-managed transactions instead. Although beans with containermanaged transactions re#uire less coding) they have one limitation4 When a method is e$ecuting) it can be associated with either a single transaction or no transaction at all. If this limitation will ma e coding your bean difficult) you should consider using bean-managed transactions.

17B A B ! % " ( <

*ow has !ontainer-0anaged .ersistence !hanged from "2B 1.1 - /.C? +here has been no change with !0. but B0. has changed. +he performance of !0. has been improved so it no now more efficient than B0.. +he Bean class is now an abstract class. Lou no longer need a deployment descriptor. !0. doesnAt e$ist in "2B /.C because B0. out performs !0.. Lou define the fields to be persisted in the Remote interface. Lou define the fields to be persisted in the *ome interface.

!hoice ! is correct. Eote4 +his type of #uestion will not be in the "2B 1.1 version of the &!"A but is li ely to be in the "2B /.C version of the &!"A.+he following is ta en from4http4FFdeveloper.3ava.sun.comFdeveloperFtechnicalArticlesFebeansF"2B/C!0.F.rior to the "2B /.C specification) a client stored and accessed persistent data via an entity beanAs instance variables. With the introduction of the /.C specification) you can designate instance variables to be container-managed persistence fields ,cmp fields- or containermanaged relationship fields ,cmr fields-. Lou define these cmp and cmr fields in the deployment descriptor. Lou retrieve and set the values of these cmp and cmr fields using public get and set methods defined in an entity bean. &imilar to the 2avaBeans model) you do not access the instance variables directly) but instead use the entity beanAs get and set methods to retrieve and set these instance variables. ,An enterprise bean does not declare these instance variables.- (urthermore) you use the deployment descriptor to specify the relationships between entity beans. +hese relationship specifications serve as the schema definition) so that when the bean is deployed) the bean relationships may be captured in a relational database. (or e$ample) a relationship between two beans specified in the deployment descriptor may appear as a foreign ey relationship in a relational database. !hoice A is incorrect because !0. has been reviewed in "2B /.C. !hoices () < and % are incorrect as specified in the above paragraphs. +he performance of !0. has improved but not to the point where it is more efficient than B0. so choice B and " are incorrect.

17D A B ! % " (

What are the benefits of the 2/"" Blueprints (ast 1ane Reader design pattern and when should it be used? When you the performance of an application is essential and you need to perform lots of readFwrite actions. &hould be used when reading large amounts of read only data. Increases maintainability. &hould be used when you need to access data that becomes stale very #uic ly. !an reduce the amount of code needed. Increases the amount of code needed.

!hoices B and " are correct.+he following is ta en from4http4FF3ava.sun.comFblueprintsFpatternsF(ast1aneReader.html&ometimes applications access data in a tabular fashion) such as when browsing a catalog or a list of names or when e$porting data in batches for use elsewhere. +his

ind of data access is usually read-only. In such situations) using entity beans to represent persistent data incurs overhead and provides little benefit. "ntity beans are best for coarse-grained access to individual business entities) and are not effective for read-only access to large #uantities of tabular data. +he (ast 1ane Reader design pattern provides a more efficient way to access tabular) read-only data. A fast lane reader component directly accesses persistent data using 2%B!+0 components) instead of using entity beans. +he result is improved performance and less coding) because the component represents data in a form that is closer to how the data are used. !hoice ( is incorrect because the (ast 1ane Reader can reduce the amount of code needed. !hoice ! is not the most appropriate answer because although there is less coding involved it does not have a direct affect on the maintainability of the application. ,It may even reduce maintainability by increasing the coupling between the data store and business logic-. !hoice A is incorrect because the (ast 1ane Reader pattern should only be used with Read 8nly data. Although choice % is feasible it is not the most appropriate choice.

19C

In which of the following situations would you use the 8bserver pattern?

A When you need to have ob3ects notified of events but you donAt now which ob3ects would have such needs) or if you will need to add more ob3ects to receive such notification) at a later date. B Lou want one ob3ect to monitor when the state of another ob3ect but you donAt want the ob3ect being monitored to need to send any messages regarding its state. ! When the instances of your class can be use interchangeable and you want to reduce the number of instances created in order to improve performance. % Lou are building an online auction site to sell rare and collectable toys. Lou want customers to be notified of bids on items they are bidding for in as close to real time as possible. Lou would use the 8bserver pattern to notify the customer ob3ects of changes in the auction ob3ect. " When you need to co-ordinate state changes between other ob3ects by using one ob3ect. !hoices A and % are correct. +he observer pattern is used to notify an ob3ects dependentsA when that ob3ect changes state. !hoice " is a description of the 0ediator pattern. !hoice ! is incorrect because the 8bserver pattern does not reduce the number of instances you need to create. !hoice B is almost correct e$cept that messages are sent when the ob3ect being monitored changes state.8bserver - ,<8( /D7-4 G%efine a one-to-many dependency between ob3ects so that when one ob3ect changes state) all its dependents are notifies and updated automatically.G0ediator - ,<8( /?7-4G%efine an ob3ect that encapsulates how a set of ob3ects interact. 0ediator promotes loose coupling by eeping ob3ects from referring to each other e$plicitly) and it lets you vary their interaction independently.G

191 Lou need to access a comple$ ob3ect in a recursive wayUbuilding the ob3ect from other ob3ects. +his is an e$ample of which pattern? A B ! % " Abstract (actory (actory 0ethod Builder !omposite Recursive Builder

!hoice % is correct. +his is a bit of a tric #uestionM you would assume that you would need to use a creational pattern such as the Builder or Abstract (actory to do this 5.rototype could be applicable as well) if we are not building a family or an aggregate ob3ect) but simply prototyping e$isting ob3ects6. +he ey is that you need to recursively build a composite ob3ect from

other ob3ects. +his is an e$ample of the !omposite pattern. +here is no such pattern as the Recursive Builder so choice " is incorrect.!omposite - ,<8( 1=7-4 G!ompose ob3ects into tree structures to represent part-whole hierarchies. !omposite lets clients treat individual ob3ects and compositions of ob3ects uniformly.G+he other patterns were4Abstract (actory - ,<8( B?-4 G.rovide an interface for creating families of related or dependent ob3ects without specifying their concrete classes.G(actory 0ethod - ,<8( 1C?-4 G%efine an interface for creating an ob3ect) but let subclasses decide) which class to instantiate. (actory 0ethod lets a class defer instantiation to subclasses.GBuilder - ,<8( D?-4 G&eparate the construction of a comple$ ob3ect from its representation so that the same construction process can create different representations.GVV&an3ayGneed to build a comple$ ob3ectG almost certainly suggests that we are tal ing about a creational pattern. I understand the tric y nature of the #uestion) however I was wondering if the #uestion needed to be reworded asGaccessing a comple$ ob3ectG or something. *as been updated

19/

When would you use the (lyweight pattern?

A When you need classes to be notified of events but you donAt now which classes or if you will need to add more at a later date. B When the instances of your class can be used interchangeably and you want to reduce the number of instances created in order to improve performance. ! When the instances of your class cannot be used interchangeable and you need to convert them so that they are interchangeable. !hoice B is correct. !hoice A is a description of the 8bserver pattern. !hoice ! is incorrect because the instances of your class can be used interchangeably in the (lyweight pattern.(lyweight - ,<8( 1D;-4G>se sharing to support large numbers of fine-grained ob3ects efficiently.G

197 Lou are currently designing your own %es top .ublishing application) as you have not found any that do e$actly what you want with e$isting applications. As part of the design you are using a !ontroller to which you send all <>I re#uests. Eot all ob3ects can process the same commands. (or e$ample you canAt select the spell chec tool when an image has the focus. +o stop any possible errors you would li e to filter out some of the messages as they are passed from these ob3ects to the !ontroller ob3ect. What pattern could you use? A B ! % " ( (irewall .ro$y Adapter 8bserver !hain of Responsibility (ilter

!hoice B is correct. (irewall and (ilter are not design patterns. In this scenario what you are essentially trying to do is filter all pac ets that donAt meet a certain set of re#uirements. +his behavior is 3ust li e a .ro$y server dropping pac ets from certain I. address etc..ro$y - ,<8( /C?-4 G.rovide a surrogate or placeholder for another ob3ect to control access to it.G+he other patterns4Adapter - ,<8( 17D-4G!onvert the interface of a class into another interface clients e$pect. Adapter lets classes wor together that couldnAt otherwise because of incompatible interfaces.G8bserver - ,<8( /D7-4G%efine a one-tomany dependency between ob3ects so that when one ob3ect changes state) all its dependents are notifies and updated automatically.G!hain of Responsibility - ,<8( //7-4GAvoid coupling the sender of a re#uest to its receiver by giving more than one ob3ect a chance to handle the re#uest. !hain the receiving ob3ects and pass the re#uest along the chain until an ob3ect handles it.G

199 A B ! %

When would you use the 0ediator pattern? When you need to co-ordinate state changes between other ob3ects by using one ob3ect. When you need to add functionality to a class without changing its interface. When you need create a separation between abstractions and classes that implement those abstractions. Lou need a class that will be used in lots of different applications where the logic will only change slightly.

!hoice A is correct. +he 0ediator pattern allows you to co-ordinate state changes between many ob3ects by using one mediator ob3ect. !hoice B is a description of the %ecorator pattern. +he &trategy pattern is described in choice % and choice ! describes the Bridge pattern.0ediator - ,<8( /?7-4G%efine an ob3ect that encapsulates how a set of ob3ects interact. 0ediator promotes loose coupling by eeping ob3ects from referring to each other e$plicitly) and it lets you vary their interaction independently.G

19; A prospective employer is describing the e$isting architecture of a solution that is currently in production. *e says that itAs a 7-tier system with 7 clustered web serversM a server for the 8racle database with the business logic implemented using .1F&:1 scripts. What is true about this system? A B ! % " ( +his solution has fat clients +his solution has thin clients +here is a good separation of business logic +he solution has good &calability +here is a poor separation of business logic +he solution has poor scalability

!hoices B) " and ( are correct. +he ey to this #uestion is the fact that the business logic has been implemented using .1F&:1 stored procedures. +his means the business logic is on the same server as the database and therefore this is a /-tier system not a 7-tier system as your prospective employer suggests. +here is a very tight coupling between the data store and the business logic this has a direct affect on the potential scalability of this system.When you thin of /-+ier systems you would normally associate them with (at clients. *owever as the business logic has been implemented using .1F&:1 scripts this system will have thin clients ma ing choice A incorrect. !hoice ! is incorrect because the business logic and data store are tightly coupled. +his tight coupling will have a direct affect on scalability. Lou may not be able to hori'ontally scale this system ,adding more machines-M vertical scaling might be easier ,add more memory and !.>s.- But even with vertical scaling you would always run the ris of a networ bottlenec ma ing choice % is incorrect as well.

19= Lour have been contracted by a company to help them improve the performance of their sales application. Lou have suggested that the hardware the application is currently deployed on ,/ web servers and a database server- be migrated to 7 web servers) an application server and a database server ,all on different machines.- Lou assure them that all the software re-writes needed will be well worth it in the end. What are the characteristics of your suggested architecture? A B (at !lients +hin !lients

! % " ( <

<ood separation of business logic <ood &calability .oor separation of business logic .oor scalability +here is no difference in the separation of business logic

!hoices B) ! and % are correct. +he system you have suggested they migrate to is a 7-tier system. +he characteristics of a 7-tier system are thin clients) good separation of business logic and good scalability. +his is due to the fact that each tier is separate from the other ,for e$ample it would be possible to change the data store without affecting the business logic.-!hoice A is incorrectM the suggested system has thin clients) the business logic residing on the application server) in the middle tier. &ince there is a good separation of business logic) choices " and < are incorrect. !hoice ( is incorrect the 7-tier nature of the system ma es it very scalable.

19? Lour boss is raving about the new 7-+ier architecture that your companyAs sales application will be deployed on. *e says that this architecture will solve all the e$isting problems. Is he right) or does a 7-+ier architecture have the potential to introduce any new problems? A B ! % " ( < (at !lients +hin !lients .oor scalability .oor manageability Reduced performance Reduced separation of business logic &ingle point of failure

!hoice % is correct. +he only problem a 7-+ier architecture could have is the potential for poor manageability. +he separation of tiers creates thin clients and distributes business logic processing. *owever because of the distributed nature of the servers) there could be manageability problems. With 2/"" solutions however) the potential for such problems is limited because 2/"" tiers and layers have very well defined roles and responsibilities. !hoice A is incorrect because (at clients are a characteristic of /-+ier architecture where the business logic is implemented on the client side. +hin clients are good. +herefore choice B is incorrect. A 7-+ier architecture has e$cellent scalability) including hori'ontal scalability) ma ing choice ! incorrect. ItAs possible to argue that a 7-+ier architecture may not perform as well as a single machine containing your web server) business logic and database. *owever as soon as you introduce a significant amount of users a 7-+ier architecture would out perform a single machine. +herefore choice " is correct. !hoice ( is incorrect because a 7-+ier architecture actually increases the separation of business logic. !hoice < is incorrect because aGsingle .oint of failureG is not a problem that a 7-+ier architecture introduces. Although it may have a single point of failure) with careful design you can avoid such pitfalls easily. +his is much harder to do with /-+ier architecture and impossible with 1-+ier architecture.

19B Lou have written an application to allow customers to reserve tables at their favourite restaurants. In return your company receives 1CH of whatever the customer spends at the restaurant. At the moment) the application is being run on a single Apache web server using ."R1 and !<I scripts for presentation and business logic with a separate server for the &ybase database containing the restaurant details. What are the most notable wea nesses of this architecture?

A B ! % "

(at !lients +hin !lients &calability .otential Eetwor bottlenec s .erformance

!hoices A)! and % are correct. +he architecture being described here is a /-+ier architecture. +he ey as to whether this system has fat or thin clients is that there is no reference to stored procedures. <enerally if the business logic resides on the server it is in the form of stored procedures. We therefore assume that all the business logic is in the ."R1 and !<I scripts. +he reason for poor scalability is due to the tight coupling of business logic and client presentation ,fat clients-. +here is always a potential of a networ bottlenec in /-+ier architectures because all re#uests have to go to one data store.!hoice B in incorrect as there is no mention of stored procedures in the scenario we assume that the business logic has been implemented in ."R1 and !<I scripts on the client side. .erformance is not the best answer here and so choice ( is incorrect.

19D Lou have 3ust bought a brand new dual processor server with over 7 <igabytes of memory) the fastest server in its class. +his server will host Apache Web server ,shipped with the 8racle %atabase- and an 8racle Bi database. What are the most notable wea nesses of this architecture? A B ! % &calability 0anageability &ecurity .erformance

!hoice A is correct. Lou can only vertically scale this system ,add memory) !.>s etc-. As soon as this system comes under a heavy load you would have to separate the Apache web server from the 8racle database and build up a cluster of web servers. +his would be hard to do as the 8racle database and Apache web server are so tightly coupled.Eote4 A system can still be scalable even if it is only one machine providing it has a good separation of the business logic) data store and client presentation. !hoice B is incorrect because this system would be easy to manage as everything is in one place. !hoice ! is incorrect) you donAt need to authenticate yourself to other machines or send traffic across the networ to other machines. !hoice % is incorrect because although the system would perform really well under light traffic as soon as it had heavy loads of traffic the performance would drop dramatically.

1;C A B ! % "

When should 2ava I%1 be used? When performance is essential ,.erformance is more important than scalability-. When accessing R0I servers. When servicing re#uests from R0I clients. When accessing e$isting !8RBA servers. When servicing re#uests from !8RBA clients.

!hoice % is correct. +he following is ta en from4http4FF3ava.sun.comF3/seF1.7FdocsFguideFidlFinde$.html+his is a fundamental #uestion and itAs important to understand the distinction between these two ways of integrating the 2ava programming language with !8RBA. 2ava I%1 is for !8RBA programmers who want to program in the 2ava programming language based on interfaces defined in !8RBA Interface %efinition 1anguage ,I%1-. +his is Gbusiness as usualG !8RBA programming)

supporting 2ava in e$actly the same way as other languages li e !PP or !8B81. Although !8RBA can slightly out perform R0I that is not a reason to use 2ava I%1 so choice A is incorrect. In choices B and ! you would use R0I2R0. and inc choice " you would use R0I-II8..

1;1 Lou have 3ust started a new 3ob wor ing for a top finance company and you have been as ed to provide a user-friendly interface to an e$isting mainframe application. Lou donAt have any access to the mainframes source code. What is the best techni#ue for this? A It canAt be done. B >se a screen scraper. ! Re-write the main frame using 2ava and high-end >ni$ servers. Although it may ta e some time to do this in the long run this will benefit the company. % Write a 2ava front end then use !8RBA to communicate with the mainframe. " >se the 2ava Eative Interface ,2EI- to communicate with the mainframe. ( >se ob3ect 0apping < >se 20& !hoice B is correct. +he ey to this #uestion is that you donAt have access to the mainframes source code. A screen scraper emulates a mainframe terminal. Basically the screen scraper logs on to the mainframe li e a normal user and sends re#uests to the mainframe and then reads the response. +he problem with a screen scraper is that if you change any of the mainframes code there is always the possibility that the screen scraper will stop wor ing.!hoice A is incorrect because it is possible to add a <>I to the system. !hoice ! would ta e far too long) cost too much and is not what the customer wants. !hoices %) " and ( would all re#uire access to the mainframes source code. !hoice < is incorrect because there is no mention that the mainframe supports a messaging system. &ome of them do and even provide interfaces for 20& however as it is not stated in the #uestion it is not the right answer.

1;/ Lou are wor ing for a company that has yet to realise the full potential of 2ava. Lou offer to show them some of the great things 2ava can do by integrating a new application with an e$isting !8RBA system. Lour bosses will then assess the performance and reliability of this new system. *ow will you connect your R0I application to the !8RBA system? A B ! % " >se 2ava-I%1 +his is a standard feature of R0I. !anAt be done. !an only be done by using 2EI. >se R0I-II8.

!hoice A is correct. +he following is ta en from4http4FF3ava.sun.comF3/seF1.7FdocsFguideFidlF3idl(A:.htm+here are several scenarios that will define how you will want to create distributed !8RBA applications. *ere are some of them4 2ava I%1 - If you have been developing !8RBA applications using I%1 for some time) you will probably want to stay in this environment. !reate the interfaces using I%1) and define the client and server applications using the 2ava programming language to ta e advantage of its GWrite 8nce) Run Anywhere +0G portability) its highly productive implementation environment) and its very robust platform. R0I-2R0. - If all of your applications are written in the 2ava programming language) you will probably want to use 2ava R0I to enable communication between 2ava ob3ects on different virtual machines and different physical machines. >sing 2ava R0I without its II8. option leverages its strengths of code portability) security) and garbage collection. R0I-II8. - If you are writing most of your new applications using the

2ava programming language) but need to maintain legacy applications written in other programming languages as well) you will probably want to use 2ava R0I with its II8. compiler option.!hoice B is incorrect because this is not a standard feature of R0I. !hoice ! is incorrect because it can be done. Lou donAt need to use 2EI to do this so choice % is incorrect. At present the e$isting systems all use !8RBA. +herefore it is better to use 2ava I%1. *ence choice " is also incorrect.

1;7 Lou are wor ing for a car leasing company and you need to integrate with one of their mainframe applications. Lou should do this using either ob3ect mapping or screen scraping. When should you use ob3ect mapping? A B ! % Lou should always use screen scrapers when you have the option. When you have access to the mainframes code. When you donAt have access to the mainframes code. When you are short of time and need a #uic solution.

!hoice B is correct. 8b3ect mapping is the process of building ob3ect wrappers around legacy interfaces. +his ma es the legacy system available in an 88 fashion. Lou need access to the legacy systems source code in order to do this.A screen scraper emulates a mainframe terminal. Basically the screen scraper logs on to the mainframe li e a normal user and sends re#uests to the mainframe and then reads the response. +he problem with a screen scraper is that if you change any of the mainframes code there is always the possibility that the screen scraper will stop wor ing.Any change to the mainframe might brea the screen scraper and screen scrapers are only really used when you donAt have access to the mainframes source code so choice A is incorrect. !hoice ! is incorrect because you would use a screen scraper if you didnAt have access to the mainframes source code. In choice % you would probably use a screen scraper.

1;9 Lou have 3ust 3oined a new company and have spent some time chatting with the networ administrator. *e has mentioned that one of the servers is an off-board server. What is an off-board server? A B ! % Another way to describe a standard pro$y server. Another type of a screen-scraping program) ,1i e an ob3ect mapping one-. A server that runs within the %0Q. A pro$y for a legacy system.

!hoice % is correct. An off-board server is simply a pro$y server for a legacy system.

1;; Lou are designing an online cinema tic et boo ing application. At the moment you plan to have a controller to maintain user sessions) a customer component to hold personal details) a credit card validation component) a set of <>I screens and a cinema component with details of all movies and seating capacities. What should be used for each component? A +he controller should be a &tateful &ession bean. +he customer should be a &tateful &ession bean. +he cinema component should be a &tateful &ession bean. +he credit card validation component should be an "ntity bean. B +he controller should be a &ervlet. +he customer should be a &tateful &ession bean. +he cinema component should be a &tateful &ession bean. +he credit card validation component should be an "ntity bean. ! +he controller should be a &tateful &ession bean. +he customer should be a &ervlet. +he cinema component should be a &tateful &ession bean. +he credit card validation component should be a &tateful &ession bean.

% +he controller should be a &ervlet. +he customer should be a &ervlet. +he cinema component should be a &tateful &ession bean. +he credit card validation component should be a &tateful &ession bean. " +he controller should be a &tateful &ession bean. +he customer should be an "ntity bean. +he cinema component should be an "ntity bean. +he credit card validation component should be a &tateless &ession bean. ( +he controller should be a &ervlet. +he cinema component should be a &tateful &ession bean. +he cinema component should be an "ntity bean. +he credit card validation component should be a &tateless &ession bean. < +he controller should be a &tateful &ession bean. +he customer should be an "ntity bean. +he cinema component should be an "ntity bean. +he credit card validation component should be a &tateless &ession bean. * +he controller should be a &ervlet. +he customer should be an "ntity bean. +he cinema component should be an "ntity bean. +he credit card validation component should be a &tateless &ession bean. I 0a e the <>I using 2&. pages 2 0a e the <>I an applet !hoices * and I are correct. +he controller could be implemented as either a &ervlet or a &tateful &ession Bean but it ma es more sense from a resources point of view to implement this as a &ervlet. +he customer and cinema component need data to be stored permanently so these should be "ntity beans. +he process of validating the credit card is a service so this should be a &tateless &ession Bean. 2&. pages is a better choice than the applet because it means that the system can be used by a greater number of people because there is no dependency on the 2ava plug in.

1;= Lou have an "nterprise Bean that represents a customerAs account. 8ne of the methods that this bean provides is deduct!ost,float amount- +his method is used when a customer buys something from your companyAs website. +his method must be e$ecuted as part of an e$isting transaction. What is the correct attribute setting in the deployment descriptor? A B ! % R":>IR"% R":>IR"& E"W &>..8R+& 0AE%A+8RL

!hoice % is correct. If the calling client does not have a transaction ,i.e. the transaction hasnAt already started- a 3ava$.transaction.+ransactionRe#uired"$ception will be thrown.!hoice A is incorrect as R":>IR"% will create a new +ransaction if a transaction does not already e$ist whereas the #uestion says it must be part of an e$isting transaction. !hoice B is incorrect because R":>IR"& E"W will create a new +ransaction anyway. &>..8R+& will not force the method to e$ecute in a transaction. *ence choice ! is also incorrect.

1;? Lou have a method that canAt be e$ecuted in a transaction. What is the correct attribute in the deployment descriptor? A B ! % 1eave it empty this is the default. E"I"R E8+ &>..8R+"% E8N+RAE&A!+I8E&

!hoice B is correct.

As the name suggestsGE"I"RG is the right answer!hoice A is incorrect because leaving the deployment descriptor empty is not the default for E"I"R. E8+ &>..8R+"% 3ust suspends the transaction ma ing choice ! incorrect. E8N+RAE&A!+I8E& is not a valid attribute. *ence choice % is also incorrect.

1;B Lou have been reading up of the <ang of (our patterns and you notice that the *ome interface of an "nterprise 2avabean is actually based on one of the patterns. Which pattern is the *ome Interface of an "nterprise 2avabean based on? A B ! % &ingleton (acade Builder (actory 0ethod

!hoice % is correct. +his (actory 0ethod pattern provides an interface for creating an ob3ect that allows either sub classes or helper classes to create that ob3ect.+he &ingleton pattern creates either 1 or a variable number of instances of a class. &o choice A is incorrect. +he (aKade pattern provides a simple interface to a comple$ subsystem. +hus choice B is incorrect. +he Builder pattern separates the construction and representation of an ob3ect. +he client is shielded from the ob3ectAs construction and it only needs to specify content and type. *ence choice ! is also incorrect.

1;D LouAve been developing a chat application so that members of your team can eep in touch with each other irrespective of their location. Lou decided to implement the application as a 2ava Applet. In order to ma e sure the user has the latest version) you re#uire the applet to connect bac to the server it was downloaded from and chec with a file there. !an this be done with 2%@ 1.7 or 1.9 without modifying the browserAs policy files? +rueF(alse? A B +rue (alse

+he above statement is +rue. +he ey to this #uestion is that the applet is only connecting bac to the server it was downloaded from) and reading a file. +his has always been permitted and is permitted with both 2%@ 1.7 and 1.9. +he applet wouldnAt be allowed to read a file on the clientAs machine or connect to machines other than the one it was downloaded from.Eote4 Lou may thin that if the applet has been downloaded then it must automatically be the latest one) this isnAt true as most browser cache applets.

1=C Lou are writing an "nterprise 2avabean to represent a (light in a +ravel agency application. 8ne of the developers recommended that you use Bean 0anaged .ersistence ,B0.- for the "2B. What is true about B0.? A B ! % Improves your ability to move your "2B from one Application server to another. Reduces your ability to move your "2B from one Application server to another. Improves your ability to move your "2B from one data store to another. Reduces your ability to move your "2B from one data store to another.

!hoice ! is correct. When you use Bean 0anaged .ersistence you are writing all the &:1 needed to persist the bean yourself. +his means that the &:1 would have been tailored to the data store you are using and the same &:1 might not wor with a

different database vendor. Lou can cancel this out by using a %ata Access 8b3ect. +he %ata Access 8b3ect pattern ,%A8- is used to reduce the dependency between "nterprise Beans and the underlying database. +his means that the data ob3ect manages the connection to the data source and if the data source changes you only need update this one ob3ect) the change doesnAt affect the rest of your application.

1=1 A B ! % " ( <

What do Atomic and !onsistent mean in reference to A!I%? Atomic means a transaction must e$ecute completely or not at all. Atomic means a transaction must e$ecute completely or log where it was stopped. !onsistent means a transaction must e$ecute completely or log where it was stopped. Atomic means the transaction is the same as other transactions in structure. !onsistent means the transaction is the same as other transactions in structure. !onsistent means the transaction was started and finished within the specified time. !onsistent means that the integrity of the underlying data source is always maintained.

!hoices A and < are correct. A!I% stands for Atomic) !onsistent) Isolatable and %urable. All transactions must adhere to this. Atomic means Aa transaction must e$ecute completely or not at all.A !onsistent means Athe integrity of the underlying data source is always maintained.A

1=/ Lou are wor ing late at the office one day when the security guard informs that you have to leave as the building is closed for the evening. As you are wor ing on a big pro3ect you decide to continue your wor at home. *owever when you try to connect to the application from home you get no response. Lou are trying to connect to your R0I-2R0. applicationM the port is available on the firewall) what is the most li ely reason why you canAt connect? A +he port on the firewall isnAt really available. B +he companyAs pro$y servers are filtering out your re#uest based upon your I. address. ! Lou have typed the connection address incorrectly. % Lour application is only listening for internal re#uests and you will need to change setting in the security.policy file if you wish to connect from home. " Lour company nows that most hac ing ta es place at night and ta es all of its systems off-line during the night. !hoice B is correct. +he most li ely e$planation here is that your companyAs firewall is filtering your re#uests out based upon your I. address. Lou would need to get your home I. address added to the list that the firewall trusts ,and this wonAt be easy if youAre using %*!.O-!hoices A and ! are both possible but not the very li ely here. *ence these answers are incorrect. !hoices % and " are not factually correct.

1=7

*ow are "ntity Beans persisted?

A B ! % "

"ntity beans are stored in memory by the Application server. "ntity beans are not persisted +hey are seriali'ed and stored on a database. +hey are E8+ seriali'ed but rather stored in a persistent storage medium such as a database. It is up to the developer) than can either be seriali'ed or mapped directly.

!hoice % is correct. A bean normally represents a row in the database. "ach field that is persisted is typically mapped to a database. +he bean itself is not stored in the database) as the class is the same for all bean instances of the same typeUitAs 3ust the values that change. If beans were seriali'ed when they where stored on the database you would have to de-seriali'e each one when you were doing a find operation ,by criteria-. When "ntity Beans are passivated ,the state to the bean is written to file-) seriali'ation may be used depending on the Application server) although most servers probably also synchroni'e the state with the database as well.&toring them in memory is not persistence. If the server crashes) all the data would be lost. +herefore choice A is incorrect. As "ntity beans are persisted) choice B is incorrect. !hoices ! and " are incorrect because "ntity Beans are not seriali'ed.

1=9 Which of the following statements are true?Eote4 +his #uestion assumes that the no-args constructor and set"ntity!onte$t,- method have already been called. A "ntity Beans start in theGreadyG state and move into theGpooledG state only after e3bActivate,- has been called on them. B "ntity Beans start in theGpooledG state and move into theGreadyG state only after e3bActivate,- has been called on them. ! "ntity Beans arenAt pooled. % "ntity Beans are never in either state. !hoice B is correct. "ntity Beans start in the pooled state ,this is assuming that the no-args constructor and set"ntity!onte$t method has been called-. +hen when e3bActivate,- is called) they move into the ready state and return to the pooled state when e3b.assivate,- is called.

1=; A B

*ow do you find a particular "ntity Bean? !all various find methods defined in the *ome interface. !all various find methods defined in the Remote interface.

!hoice A is correct. +he *ome interface defines the create,-) find,-) and remove,- methods and the finder methods are used for locating beans.+he Remote Interface is used to define all of the methods that can be called by the client on the "nterprise Bean. If you try and call a method that e$ists in the "nterprise bean class but not in the Remote Interface) you will get a Remote"$ception.

1== A

Which statements are true? e3b(ind,- returns the .rimary @ey.

B ! % " (

+he find methodFs in the *ome interface return an "2B8b3ect or an "numeration. +he find methodFs in the *ome interface return a .rimary @ey. e3b(ind,- returns an "2B8b3ect. +he find methodFs in the Remote interface return an "2B8b3ect. +he find methodFs in the Remote interface return a .rimary @ey.

!hoices A and B are correct. +he *ome interface defines the create,-) find,-) and remove,- methods.+he Remote Interface is used to define all of the methods that can be called by the client on the "nterprise Bean. If you try and call a method that e$ists in the "nterprise bean class but not in the Remote Interface) you will get a Remote"$ception.!hoice ! is incorrect because the find method in the *ome interface returns an "2B8b3ect or an "numeration. !hoice % is incorrect because e3b(ind,- returns the .rimary @ey. +he find methods are not defined in the Remote interface so choices " and ( are incorrect.

1=? Lou are at home trying to wor on an application youAre developing for your company. Lou want to log on to your machine at wor and develop code for your application however you are having some trouble connecting directly to the application ,running on port 1CDD-. What is the most li ely reason that you canAt connect? A B ! % " A typing error in the connection details. Lour company is filtering traffic based upon I. address +raffic is being filtered based upon the port number re#uested. Lou need to update the security manager that is being used with the application to allow e$ternal connections. +here is a bug in your program stopping anyone from connecting whether internal or e$ternal.

!hoice ! is correct. As you are able to connect to your des top .! you now that your company doesnAt filter traffic based upon I. address. +herefore the most li ely reason you canAt connect is because you are re#uesting a different port and the firewall is filtering that traffic.Although itAs possible that a typing error in the connection details may be stopping you connecting it isnAt the most li ely reason. &o choice A is incorrect. Lou wouldnAt be able to connect to your des top .! if your company was filtering traffic based upon I. address. &o choice B is incorrect. When you connect to your application from within the office you are still connecting via a soc et. &o you would not be able to connect at wor either if there was a problem with the security manager. *ence choice % is incorrect. Although choice " is possible it is not the most li ely reason.

1=B Lou now that 2ava allows you to run 2R0. over *++.) to tunnel through firewalls but does 2ava allow you to run !8RBA over *++.?,!8RBA uses II8.-. +rueF(alse? A B Les Eo

!hoice B is correct. +he ey to the #uestion is what does 2ava allow you to do. 2ava has no direct relationship with !8RBA so the answer is Eo. *owever if the #uestion was rephrased slightly for e$ample using 2ava is it possible to tunnel II8. over *++. then the answer would be yes ,most firewalls are configured to only let *++. F *++.& re#uests through-.

1=D Lou are wor ing for an investment ban . Lou have written an applet to display the current price of the shares that traders have selected for monitoring. (or the applet to wor ) it needs to authenticate who the client is. It does this by reading a file held locally on the clientAs machine. Lou now that applets canAt read files stored on a local machine by default. &o you have placed the applet in a 3ar file and that is code signed by a trusted certificate authority. Is signing the code enough for the applet to be able to read the local file?Eote4 +his is based on 2%@ 1.7 and 1.9 A B ! % " Les it would wor fine without limitation as the code is signed. Eo the security manager of the browser would prohibit this. +he applet would have been able to read the file already under 2%@ 1.7 and 1.9. As long as the code is signed is doesnAt matter which certificate authority signed it. It may or may not wor depending on the browserAs security policy.

!hoice " is correct. "ven if the code is signed) the browserAs policy file may refuse it permission to perform certain tas s. +he policy file will need to grant necessary permissions such as4grant signedByGsigning@eyG W .ermission 3ava.io.(ile.ermissionGlocalNfileG)GreadGMXto allow the applet to read local files.!hoice A is incorrect because it depends on the browsers security policy file. !hoice B is incorrect because the security manager might not prohibit this. +he applet wouldnAt automatically be able to read the file. &o choice ! is incorrect. It would matter which certificate authority signed it) if you have not chosen to trust a particular certificate authority the code might as well not be signed at allO &o choice % is also incorrect.

1?C Lou are developing an application to be used at a ma3or ban . &ecurity is a crucial element and you have decided to use 2AA&. +he <>I will be based on the 0I! framewor and it uses swing. +he application will connect people in the same office so that they can all securely review the same financial data. What protocol should you use to do this? A B ! % II8. 2R0. *++. *++.&

!hoice B is correct. As there is no reference to this being a web based solution and all of the staff are in the same office there is no need to use *++.&. 2R0. is the most appropriate answer.+here is no mention of the need for "ntity Beans or interfacing with a !8RBA system so choice A is incorrect. !hoices ! and % are incorrect because this is not being used over the web.

1?1

What are the benefits of using the &ervice 1ocator pattern?

A It is used primary by &ervlets to locate other services such as 20&. A good e$ample of this pattern would be a web based login facility. If a client enters an incorrect password their need to be redirected to a different but their session needs to be maintained across the application. B It is used to catalog "nterprise Beans so that other beans can find them #uic ly and efficiently. (or e$ample if you need to forward re#uest from a &ession Bean to an "ntity Bean then the &ession Bean re#uests the location of the "ntity Bean from the &ervice 1ocator ob3ect. +he &ervice 1ocator loo s in a table ,li e a *ash0ap- and returns the "ntity Beans location. ! +he &ervice 1ocator pattern can improve performance by introducing a caching facility. % +here is a slight loss of performance when using the &ervice 1ocator pattern but this is out weighed by the improved maintainability of the code.

" Eone of the definitions of the &ervice 1ocator pattern are accurate. ( +he &ervice 1ocator pattern is used to hide the comple$ities of initial ob3ect creation) "2B loo ups and ob3ect re-creation. < 0ultiple clients can reuse the same &ervice 1ocator pattern. !hoices !) ( and < are correct. +he following is ta en from !ore 2/"" .atterns4 Best .ractices and %esign &trategies page 7=D G>se a &ervice 1ocator ob3ect to abstract all 2E%I usage and to hide the comple$ities of initial conte$t creation) "2B home ob3ect loo up) and "2B ob3ect re-creation. 0ultiple clients can reuse the &ervice 1ocator ob3ect to reduce code comple$ity) provide a single point of control) and improve performance by providing a caching facility.G!hoice A is describing a standard web based login but this has nothing to do with the &ervice 1ocator pattern. !hoice B sounds plausible but this is not how the &ervice 1ocator pattern is used. !hoice % is incorrect as there is an increase not a loss of performance when using this pattern. !hoice " is incorrect as there are accurate descriptions of the &ervice 1ocator pattern amongst the answers.&ome useful lin s4 http4FFdeveloper.3ava.sun.comFdeveloperFtechnicalArticlesF2/""FpatternsF http4FF3ava.sun.comFblueprintsF >seful boo 4 !ore 2/"" .atterns4 Best .ractices and %esign &trategies - I&BE4 C17C=9BB91A sample chapter is available here4 http4FFwww.sun.comFboo sFcatalogFcrupiFinde$N+ablePofP!ontents.html Eote4 +his type of #uestion will probably feature in the new "2B /.C specification version of the &!"A certification.

1?/

When would you use +unnelling?

A When you donAt have access to any spare ports of the (irewall and need to tunnel your application through an e$isting port. B +o brea out of prison. ! When you do have access to spare ports of the (irewall and are able to use them. &o you tunnel your application out of one of these new ports that was created 3ust for your application. % When you are using II8. with R0I. !hoice A is correct. +unnelling is used to pass one protocol through a port that it does not) by default run on. (or e$ample if the only free port on the firewall was port BC and you needed to pass 2R0. through the firewall you would GtunnelG 2R0. through the firewall. ,2R0. by standard runs on port 1CDD-. Basically 2R0. would run on top of *++.. *owever +unnelling should generally be avoided and should only be used as a last resort. Lou use tunnelling when you donAt have access to a particular port. &o choice ! is incorrect. R0I-II8. is unrelated to tunnelling. !hoice B is incorrect because stealing the ey from the guard would be easierO

1?7 Lou are wor ing for a small to medium si'ed business that has 3ust started to use servers to host 2/"" Applications ,its own and clientsA.- *owever since its launch into this new area there have been three separate instances of hac s involving access of sensitive sales information. A security consultant has been brought in to assess the situation and he recommends that your company use a %0Q. What is a %0Q? A +he networ behind a firewall thatAs protected from the Internet.

B +he region inside the inner firewall ,we are assuming that there are two firewalls-. +his networ is called the %0Q. ! +he networ outside of the outer firewall. +his could be the Internet or other client networ s. ,We are assuming that there are two firewalls-. % A region between two firewalls. +he Internet would come in through the first firewall but only systems within the first firewall in the %0Q can go through the second firewall. !hoice % is correct. %0Q stands for %emilitari'ed 'one. +o set up a %0Q you need two firewalls with which you create 7 separate regions. +he different regions are the internet) %0Q ,in the middle- and your networ . Lou would have a server in the %0Q that would be accessible to both the public and employees in your local networ . +he internet connections will not have access your networ though they will be able to access the server in the %0Q. Lour networ will access the internet through the server in the %0Q.!hoice A is 3ust describing the process of using a firewall. +he region described in choice B is your networ the %0Q is the area between the two firewalls. !hoice ! describes the internet not a %0Q.A >seful lin 4 http4FFwww.saintrochtree.comFnetwor -advicesFCCCCC9.htm

1?9 Lou are designing a web-based application for an online recipe site. Although this may not seem that popular) the estimated number of uni#ue visitors to the site is 1CCCCC per day. +he site is purely informational) you canAt buy recipes or upload your own ,if you wish to add your own recipes they have to be emailed to the webmaster-. %espite that fact that there no transaction and persistence re#uirement it is still recommended that you use an Application server and "nterprise beans. +he main reason for using the Application server and "nterprise Beans is that it allows you to remove some of the processing from the web servers and this increases the performance of the site. +rueF(alse? A B +R>" (A1&"

+he above statement is (alse. +he ey to this #uestion is that there are no transactions and there is no data to persist. All you are sending to the client are *+01 web pagesM even if you were to use 2&.sF&ervlets you still wouldnAt use an Application server. In a situation li e this you have to thin of what the Application server should actually do? In this case there is nothing for it to do.

1?; Lou are an enterprise consultant for one of the (ortune ;CC companies. Lou have been discussing a possible design for a 7-tier application with a prospective client. +hey now very little about 2ava and are as ing you if 2ava is always the best solution. Lour response is that although normally for each pro3ect many factors have to be considered before selecting the programming language and framewor ) because this is a 7-tier architecture 2ava is definitely the best solution. Is this true? +rueF(alse? A B +R>" (A1&"

+he above statement is (alse. It is impossible to ma e sweeping statements such as 2ava is always the best solution for 7-tier architectures. A pro3ect needs to be loo ed at individually and then assessed. Lou may thin that one pro3ect naturally suits a full 2ava implementation only to find out that a company has already heavily invested in a different technology or that you donAt have the resources ,employees with s ills in 2ava based technologies- to implement a solution.

1?= Lou are designing a 7-tier architecture for a new application your company intends to deploy as part of itAs mar eting strategy. +his application will allow users to boo rental cars over the web and is estimated to save the company millions over the ne$t few years. %ue to the sheer number of users) you have decided to use the (ront !ontroller pattern. Which of the following statements describe the (ront !ontroller pattern? A +he (ront !ontroller pattern is primarily used as a cheap alternative to a !I&!8 router. It is used as a software alternative to a hardware load balancer. B .rovides a central point of entry ! .rovides a central point of entry for load balancing % +he controller manages client re#uests) security) delegation of business processing) error handling) view selection and content creation strategies. " +he controller manages the clientAs re#uest including delegating business processing) error handling) view selection and content creation strategies. But is does not have anything to do with security. ( +he (ront !ontroller is 3ust another way of describing the !ontroller out of the 0odel Iiew !ontroller architecture. < +he (ront !ontroller is 3ust using the !ontroller out of the 0odel Iiew !ontroller architecture for load balancing. !hoices B and % are correct. +he following is ta en from !ore 2/"" .atterns4 Best .ractices and %esign &trategies page 7=DG>se a controller as the initial point of contact for handling a re#uest. +he controller manages the handling of the re#uest) including invo ing security services such as authentication and authori'ation) delegating business processing) managing the choice of an appropriate view) handling errors) and managing the selection of content creation strategies. +he main aim of the (ront !ontroller pattern is to centrali'e view management. (or e$ample if a web page is moved all the lin s to it would need to be updated by using this pattern you can pass all re#uests through the (ront !ontroller only needing to ma e changes in one place. +he (ront !ontroller is classified by &un as a .resentation +ier pattern. !hoices A and B are incorrect because the (ront !ontroller has nothing to do with load balancing. !hoice " is incorrect as the (ront !ontroller can invo e security services and choices ( and < are incorrect because the (ront !ontroller does not represent the !ontroller out of the 0I! architecture. &ome useful lin s4 http4FFdeveloper.3ava.sun.comFdeveloperFtechnicalArticlesF2/""FpatternsF http4FF3ava.sun.comFblueprintsFpatternsF3/eeNpatternsFfrontNcontrollerFinde$.html http4FF3ava.sun.comFblueprintsF >seful boo 4 !ore 2/"" .atterns4 Best .ractices and %esign &trategies - I&BE4 C17C=9BB91A sample chapter is available here4 http4FFwww.sun.comFboo sFcatalogFcrupiFinde$N+ablePofP!ontents.html Eote4 +his type of #uestion will probably feature in the new "2B /.C specification version of the &!"A certification.

1?? Lou are designing a comple$ set of classes that provides a secure framewor for other programmers to use. +he idea behind this framewor is that it will allow other programmers to write secure programs without getting bogged down with the comple$ities of writing secure applications. What sort of design pattern is being used here? A B ! % " !omposite (acade %ecorator Adapter 0ediator

!hoice B is correct. (acade - ,<8( 1B;-4 G.rovide a unified interface to a set of interfaces in a subsystem. (acade defines a higher-level interface that ma es the subsystem easier to use. G+he other patterns are described below4 Adapter - ,<8( 17D-4G!onvert the interface of a class into another interface clients e$pect. Adapter lets classes wor together that couldnAt otherwise because of incompatible interfaces. G!omposite - ,<8( 1=7-4G!ompose ob3ects into tree structures to represent part-whole hierarchies. !omposite lets clients treat individual ob3ects and compositions of ob3ects uniformly. G%ecorator - ,<8( 1?;-4GAttach additional responsibilities to an ob3ect dynamically. %ecorators provide a fle$ible alternative to sub classing for e$tending functionality. G0ediator - ,<8( /?7-4G%efine an ob3ect that encapsulates how a set of ob3ects interact. 0ediator promotes loose coupling by eeping ob3ects from referring to each other e$plicitly) and it lets you vary their interaction independently.G

1?B

What is the difference between the abstract factory pattern and the factory method pattern?

A +he factory method ma es ob3ects that should be used together. +his is not the case for the abstract factory. B +he abstract factory pattern provides an interface for creating a family of ob3ects whereas factory method provides an interface for creating one ob3ect ! In the abstract factory pattern the ob3ects that the factory ma es are to be used together. +his is not necessarily true in the factory method pattern. % +he factory method pattern is used when the class does not now the class of the ob3ect it must create. But in the abstract factory this is nown in advance. " +he factory method and abstract factory are essentially the same pattern but two different names are used to describe them depending on the circumstances when they are implemented. !hoice B is correct. Both the Abstract (actory and (actory 0ethod are !reational patterns. Abstract (actory - ,<8( B?-4 G.rovide an interface for creating families of related or dependent ob3ects without specifying their concrete classes. G(actory 0ethod - ,<8( 1C?-4 G%efine an interface for creating an ob3ect) but let subclasses decide) which class to instantiate. (actory 0ethod lets a class defer instantiation to subclasses. G!hoice A offers a description of the abstract factory pattern not the factory method. +he descriptions in choices ! and % are the wrong way round. !hoice " is incorrect as the two patterns are different.

1?D LouAre designing a paint application and as part of the user interface you have a toolbar along the left hand side of the screen. "ach of the icons on the toolbar has different actions when you are using different tools. +he way youAve structured it) the application is re#uired to pass commands from one ob3ect to another. When the appropriate ob3ect receives the command) it handles the re#uest. +his is an e$ample of which pattern? A B ! % " !ommand !hain of Responsibility Adapter Interpreter &trategy

!hoice B is correct.

!hain of Responsibility - ,<8( //7-4GAvoid coupling the sender of a re#uest to its receiver by giving more than one ob3ect a chance to handle the re#uest. !hain the receiving ob3ects and pass the re#uest along the chain until an ob3ect handles it. GBelow are descriptions of the other patterns4 !ommand - ,<8( /77-4G"ncapsulate a re#uest as an ob3ect) thereby letting you parameteri'e clients with different re#uests) #ueue or log re#uests) and support undoable operations GInterpreter - ,<8( /97-4G<iven a language) define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language. GAdapter - ,<8( 17D-4G!onvert the interface of a class into another interface clients e$pect. Adapter lets classes wor together that couldnAt otherwise because of incompatible interfaces. G&trategy - ,<8( 71;-4G%efine a family of algorithms) encapsulate each one) and ma e them interchangeable. &trategy lets the algorithm vary independently from clients that use it.G

1BC LouAve had enough of you e$isting I%" ,Integrated %evelopment "nvironment- and have started wor on designing your own. At the moment youAre wor ing on the undo part of the application) basically you need to be able to roll an ob3ect bac so its previous state. What pattern would you use to do this? A 0emento B &tate ! 0ediator % Rollbac " +ransaction ( A!I% !hoice A is correct. 0emento - ,<8( /B7-4GWithout violating encapsulation) capture and e$ternalise an ob3ectAs internal state so that the ob3ect can be restored to this state later. G!hoices %) " and ( are not names of patterns. Rollbac is something you would do if a transaction were terminated halfway through. +ransaction is self-e$planatory. A!I% stands for Atomic) !onsistent) Isolatable and %urable. All transactions must adhere to this. Below are descriptions of the other patterns4 &tate - ,<8( 7C;-4GAllow an ob3ect to alter its behavior when its internal state changes. +he ob3ect will appear to change its class. G0ediator - ,<8( /?7-4G%efine an ob3ect that encapsulates how a set of ob3ects interact. 0ediator promotes loose coupling by eeping ob3ects from referring to each other e$plicitly) and it lets you vary their interaction independently.G 1B1 What is true about this diagram?

A B ! %

8b3ect 1 calls the method call1,- on 8b3ect / 8b3ect / e$ecutes its own method call7,-. +his method in turn creates 8b3ect 7. 8b3ect 1 e$ecutes its own method call1,-. +his method in turn creates 8b3ect /. 8b3ect / calls the method call7,- on 8b3ect 7

!hoices A and % are correct. +he diagram shows a >01 se#uence diagram. +his type of diagram shows the interaction of different ob3ects. +ime is shown from the top of the page descending. +he white rectangles on the dotted lines show the ob3ects life. 0ethod calls are made from one ob3ect to another. In this diagram 8b3ect 1 calls 8b3ect /As method call1,-. Where the arrow begins) the ob3ect represents the caller) and where it ends) the ob3ect called. +he te$t above the arrow is the name of the method.(or more information about >014http4FFwww.uml.orgF

1B/ A B ! % " (

What are the benefits of asynchronous messaging? 1ess coupling between the sender and receiver. .rovides an instant response. %oes not bloc the sender. <ood for transaction processing. GLou canAt get an instant response. Eetwor doesnAt have to be available.

!hoices A) ! and ( are correct. +he main difference between asynchronous messaging and synchronous messaging is that synchronous provides an instant response. +his means that when using asynchronous messaging) clients do not have not wait for responsesM they send messages and then carry on with what they were doing. +his reduces the coupling between the sender and receiver and it also means that the networ doesnAt have to be available. !hoices B and % are incorrect because they describe synchronous messaging. Although choice " is correct it is not a benefit of synchronous messaging.

1B7 Lou are designing an online shopping application to ma e it easier for customers to order products from your company. +he aim is that the ma3ority of customers buying over the phone will start using the web instead. When customers purchases goods online they will use credit cards and will re#uire an instant response as to whether the sale has been approved or not. ,Eote the credit card validation is carried out by another very powerful system.- What type of messaging should be used? A &ynchronous messaging B Asynchronous messaging ! Lou shouldnAt be using messaging at all as itAs not transactional. % Lou could use messaging because it is transactional however itAs not advised) as the system would never perform well enough for an instant response. !hoice A is correct. &ynchronous messaging provides an instant response and is therefore the right answer. It is always arguable as to whether messaging should be used if you re#uire an instant response but if you do decide to use messaging then you should always use synchronous messaging when needing an instant response. !hoice B is incorrect because asynchronous messaging does not provide an instant response. Lou can ma e messaging transactional by creating your own transactions in your code. *ence choice ! is incorrect. !hoice % is arguable too) but it is not the most appropriate answer because the #uestion suggests that the system the messages will be sent to is very powerful and will be able to cope with the volume of traffic. &o choice % would be incorrect as it suggests that the system will not perform well enough for an instant response.

1B9 A B

What should be used if you donAt need an instant response from a message? &ynchronous messaging Asynchronous messaging

!hoice B is correct. &ynchronous messaging provides an instant response therefore asynchronous messaging is correct. &ynchronous) tightly coupled communication between distributed components4 +his is the model of !8RBA) R0I) "2B and so on. +he programming model is called Remote .rocedure !all ,R.!-.Asynchronous) loosely coupled communication between components4 +his is the 0essage 8riented 0iddleware or 080 model. +he programming model is called 0essaging.

1B; Lou overheard two colleagues arguing about the difference between 1ocali'ation and Internationali'ation. +hey turn to you to as you to settle the argument. What is the difference between 1ocali'ation and Internationali'ation? A B ! % Internationali'ation is the process of preparing a program to be used in a country other than "ngland. Internationali'ation is the process of preparing a program to be used in any country. 1ocali'ation is the process of preparing a program to be used in a country other than "ngland. 1ocali'ation is the process of preparing a program to be used in any country.

!hoice B is correct.

Internationali'ation4 Adapting a program for use in any country is called Internationali'ation. 1ocali'ation4 +he process of adapting a program for use in a particular country is referred to as 1ocali'ation. %uring 1ocali'ation the language of the te$t) message icons) colors used) dialogs) number formats) time representation and even sorting algorithms are sub3ect to change. !hoice A is incorrect because it is the other way around. !hoices ! and % are not accurate descriptions of 1ocali'ation.

1B= Lou have an e$isting mail order application that runs as an applet on the customerAs browser. +he applet connects to your server to retrieve product information. ,Eote all data is sent securely over &&1- What would you e$pect to change to meet the needs of users in different countries? A B ! % " ( < <>I te$t) e.g. 0essage bo$ te$t etc. &ecurity login procedures %ates Eumbers) e.g. !urrency +he way the program writes to binary files. Icons) Images +he way the program writes to te$t files.

!hoices A) !) %) ( and < are correct. 1ist of items that may be sub3ect to Internationali'ation4 1anguage for 0essages (ormats - Eumeric) %ate and so on %ictionary sort order !urrency symbol and position +a$ and other legal rules !ultural preferences Lou would not need to change the way you wrote to binary files but you may need to change the way you write to te$t files because of the >nicode to B bit differences.

1B? Lour company has a custom operating system that it developed for some robotics hardware to be used in their research departments. 8ne of the researchers has written a cut down Iirtual 0achine to run on this 8&. Lou have started to develop some software to run on this I0 however you need to convert the >nicode to B bit characters. In order to do this you will need to use4 A B ! % (ileWriter 8utput&treamWriter BufferedWriter &treamWriter

!hoice B is correct. +he 8utput&treamWriter can be used to convert >nicode into B bit characters. Eormally this is used in Internationali'ation to convert >nicode into local character encoding but it would wor well in this situation. !hoices A) ! and % serve different purposes in the 3ava.io pac age. 2ava support for Internationali'ation .roperties 1ocale Resource Bundle >nicode 2ava.te$t .ac age Input&treamReader 8utput&treamWriter

1BB A B ! %

Lou need to convert Bbit te$t to >nicode. +o do this you use4 (ileReader Input&treamReader BufferedReader &treamReader

!hoice B is correct. +he Input&treamReader can be used to convert B bit characters to >nicode. !hoices A) ! and % serve different purposes in the 3ava.io pac age.2ava support for Internationali'ation4Y .ropertiesY 1ocaleY Resource BundleY >nicodeY 2ava.te$t .ac ageY Input&treamReaderY 8utput&treamWriter

1BD

What is the difference between composite aggregation and normal aggregation?

A Aggregation defines a part of relationship but both ob3ects can e$ist independently. But with composite aggregation if one part is removed then the other part will be removed. +hin of a plane the wings have a composite aggregation relationship with the body of the plane. B !omposite Aggregation defines a part of relationship but both ob3ects can e$ist independently. But with aggregation if one part is removed then the other part will be removed. +hin of a plane) the wings have an aggregation relationship with the body of the plane. !hoice A is correct. As the answer states aggregation defines a part of relationship but both ob3ects can e$ist independently. But with composite aggregation if one part is removed then the other part will be removed. +he following is ta en from4 http4FFwww.mos alyu .comFeduFumlFinterviewN#uestions.htm !omposition is a stronger form of aggregation. +he ob3ect which is GcontainedG in another ob3ect is e$pected to live and die with the ob3ect which GcontainsG it. !omposition is represented in the >01 by a dar ened diamond. An e$ample of a composite relation is a Boo and !hapter. A Boo Ghas aG !hapter) and the !hapter cannot e$ist without the Boo . (or more information about >01 please go to4 http4FFwww.uml.orgF

1DC Lou are loo ing at a class diagram that another developer has drawn. Lou notice a solid blac diamond and a line lin ing two classes together. What does the blac diamond imply in >01? A B ! % " Aggregation Association !omposite Aggregation F !omposition %ependency InheritanceF<enerali'ation

!hoice ! is correct. !omposite Aggregation F !omposition is shown by a solid blac diamond. Aggregation defines a part of relationship but both ob3ects can e$ist independently. But with composite aggregation if one part is removed then the other part will be removed. +hin of a plane the wings have a composite aggregation relationship with the body of the plane. Eote4 Inheritance and <enerali'ation are used to describe the same thing. +he same is also true about !omposite Aggregation and !omposition. Aggregation is shown as a white diamond ,the diamond shape is a blac outline with the centre white-. Association is 3ust a single line lin ing classesFob3ectsM this can have multiplicity and direction. +he following is ta en from4http4FFwww.mos alyu .comFeduFumlFinterviewN#uestions.htm !omposition is a stronger form of

aggregation. +he ob3ect which is GcontainedG in another ob3ect is e$pected to live and die with the ob3ect which GcontainsG it. !omposition is represented in the >01 by a dar ened diamond. An e$ample of a composite relation is a Boo and !hapter. A Boo Ghas aG !hapter) and the !hapter cannot e$ist without the Boo . (or more information about >014http4FFwww.uml.orgF

1D1 A B ! % "

What does a triangular arrow shape with a solid line mean in >01? ,+he triangle is an outline) and not solidAggregation Association !omposite Aggregation F !omposition %ependency InheritanceF<enerali'ation

!hoice " is correct. In >01 InheritanceF<enerali'ation is shown with a triangular arrow shape. &o whenever you e$tend a class) you are inheriting from the class you are e$tending. Eote4 Inheritance and <enerali'ation are used to describe the same thing. +he same is also true about !omposite Aggregation and !omposition. Aggregation is shown a white diamond ,the diamond shape is a blac outline with the centre white-. Association is 3ust a single line lin ing classesFob3ectsM this can have multiplicity and direction. !omposite Aggregation F !omposition is shown by a solid blac diamond. (or more information about >014http4FFwww.uml.orgF

1D/ Lou are studying a class diagram of an e$iting system so that the new functionality you are adding uses the e$isting class attributes wherever possible. What do the following symbols mean in >01 with regards to visibility? A B ! % T public) P protected) - private P public) - protected) T private P public) T protected) - private T public) - protected) P private

!hoice ! is correct. As the answer states the P T - symbols represent the following levels of visibility.P .ublicT .rotected- .rivate (or more information about >01 please go to4http4FFwww.uml.orgF

1D7 A B ! % " ( <

Which of the following are true about Iertical &calability? ,Achieved by adding servers to the system Achieved by adding capacity ,memory) !.> and so onIt is generally more e$pensive than *ori'ontal scaling %ecreases manageability Re#uires few or no changes to the system architecture Eot supported by 2/"" *as little or no impact on the reliability and availability of the system

!hoices B) " and < are correct. Iertical &calability) by definition means increasing a systemAs capacity by adding memory) processors and so on. 8f the two types of &calability ,Iertical and *ori'ontal-) Iertical &calability is the easier to achieve because it involves few changes to the e$isting systemAs architecture. Also adding more !.> or memory to an e$isting system does not have any impact on reliability or availability because if the system or component fails) in the absence of redundant systems) availability and reliability would suffer. *ence choices B) " and < are correct. !hoice A is incorrect because it actually describes *ori'ontal &calability) which is achieved by adding more servers to a system. *ori'ontal &calability is tougher to achieve because the architecture should inherently support a multi-server environment. *owever once implemented) it has a positive impact on the systemAs reliability and availability because it provides fault tolerance capabilities. !hoice ! is incorrect because generally it is cheaper to add capacity than to add entire new systems. !hoice % is incorrect because adding capacity should have no impact on the manageability of a system. !hoice ( is incorrect because Iertical &calability is easy to achieve. 0ost 2/"" vendors also provide support for the more difficult *ori'ontal &calability.

1D9 A B ! % " (

Which of the following are not true about /-tier architecture models? !lients may be validation intensive) conse#uently re#uiring powerful hardware. Any change to one tier typically affects both tiers. Represents a single point of failure. "ach client ma es a direct connection with the server +hey are not very maintainable +hey are #uite manageable

!hoices B) ! and ( are correct. +he #uestion as s for points about /-tier clientFserver systems that are not true. !hoice B is untrue because a change to one tier need not necessarily affect the other tier. (or e$ample consider an 8rder "ntry system where the users need to see transaction history for individual customers. A new screen can be developed to ta e data from the transaction tables and display it on the client. In this e$ample) no changes are re#uired on the server. !onsider an alternate e$ample where a stored procedure accessing data spread in multiple tables now #ueries a materiali'ed view. Eo changes would be re#uired to clients that call the stored procedure) as long as all input and output remains the same. Although it may be true in many cases) !lientF&erver architectures do not always represent single points of failure. With single database servers) of course if the server fails) clients may not be able to connect to the database. *owever in multi-database applications) if parts of the client or server fail) other parts of the system may still be accessible. *ence choice ! is a right answer. /-tier architectures are not very manageable. Although the servers can be managed centrally) client .!s are always distributed at user locations and it is very difficult to troubleshoot them without local staff. *ence choice ( is a right answer. !hoice A correctly reflects what happens on a client in /-tier applications. !hoice % e$plains how clients interact with the database and choice " clearly lists that /-tier architectures are not easily maintainable because of constant software updates re#uired on the clients. *ence they are all incorrect answers.

1D;

Refer to the following diagram4

In the above diagram A B ! % !lass A inherits from !lass B !lass B inherits from !lass A !lass B has a dependency to !lass A !lass A has an aggregation to !lass B

!hoice B is correct. (rom the diagram it can be inferred that A and B are concrete classes and B e$tends A. +his is shown by the generali'ation relationship between B and A. *ence choice B is correct. !hoice A is incorrect because class A does not inherit from class B. !hoice ! is incorrect because the relationship between the classes A and B is generali'ation) not dependency. (inally choice % is incorrect because A has an aggregation relationship with Interface !) not class B.

1D= A B ! % " (

In a >01 class diagram .rivate) .rotected and .ublic attributes are shown by -) P)T P) -)hash T) -) P -)T) P P)T) T) P) -

!hoice % is correct. In >01 notation) access modifiers are shown by the signs -) T and P to represent .rivate) .rotected and .ublic. *ence choice % is correct. All other choices show incorrect combinations.

1D?

Which of the following may be used for synchronously communicating with legacy systems?

A B ! % " ( <

II8. *++. &*+01 2R0. with 2EI &0+. R0I F II8. 080

!hoices A) % and ( are correct. II8. ,Internet Inter 8perable .rotocol- is the protocol used by !8RBA. 2R0. ,2ava Remote 0ethod .rotocol- is the protocol used by 2ava-R0I. R0I F II8. is "2B1.1As protocol. All three of these methods are e$amples of R.! ,Remote .rocedure calls- based communication) which is inherently synchronous in nature. Eote that there are e$ceptions ,event handling in !8RBA and 0essage %riven Beans in "2B/.C-) but generally spea ing R.! is used for synchronous communication. *ence A) % and ( are correct. *++.) &*+01 and &0+. are unrelated 3argons) used for confusing the reader. 0essage 8riented 0iddleware ,080is used for asynchronous messaging. *ence choices B) !) " and < are incorrect.

1DB A B ! % "

What is an off-board server used for? .roviding &ingle-&ign on to a 2ava based application %elegating comple$ processing to a separate server "nable secure remote access to a mainframe by forwarding &&1 re#uests to serial connections As a database for storing the public eys of valid !ertification Authorities ,!A(or performing symmetric ey cryptography

!hoice ! is correct. An off-board server is used enable secure remote access to mainframes. +his is done typically done by forwarding &&1 re#uests to the mainframes via serial connections) as indicated by choice !. An off-board server does not provide single sign on capabilities to a 2/"" application. It is also not an application server that can ta e up comple$ business logic processing. An 8ff board server does not store public eys of trusted !ertification Authorities ,!A- or perform symmetric ey encryption. *ence choices A) B) % and " are all incorrect.

1DD !ompany AB! has a predominantly "2B based 2/"" application that has be accessed by !8RBA clients. Which connectivity option would you recommend? A B ! % " R0I-2R0. R0I with 2EI 2ava I%1 R0I-II8. *++. tunneling

!hoice % is correct. R0I-II8. stands for Remote 0ethod Invocation ,using II8. as the transport.- +his is the protocol supported by "2B1.1 *ence choice % is correct. R0I-2R0. is used only when dealing with native 2ava clients. +he #uestion tal s about !8RBA clients but does not say anything about pure 2ava clients. *ence choice A is incorrect. +here is also no mention of 2EI support. *ence

choice B is incorrect. 2ava I%1 is useful when you have a predominantly !8RBA based application. *ence choice ! is incorrect. *++. tunneling is a way to allow protocols to mas#uerading as other protocols and bypass firewall restrictions. *ence choice " is incorrect.

/CC A B ! % "

Which of the !lasses and Interfaces need to be created by a bean developer? *ome Interface %istributed Interface Remote Interface Bean !lass Bean Interface

!hoices A) ! and % are correct. When developing "2B applications) developers need to create the *ome Interface) the Remote Interface and the Bean !lass. *ence choices A) ! and % are correct. +here is no such thing as the %istributed Interface or the Bean Interface. *ence choices B and " are incorrect.

/C1 A B ! %

+he Remote Interface of an "nterprise Bean e$tends from4 3ava.e3b."2BRemote 3ava$.e3b.RemoteInterface 3ava$.e3b."2B8b3ect 3ava$.rmi.RemoteReference

!hoice ! is correct. Remote Interfaces of "2Bs e$tend from 3ava$.e3b."2B8b3ect. *ence choice ! is correct. +hough it sounds li ely) A) B and % are incorrect because there is no interface called "2BRemote) RemoteInterface or RemoteReference.

/C/ A B ! % "

Which of the following are not applicable to the .rimary @ey !lass? It must implement the 3ava.io.&eriali'able interface It must provide a default constructor It must override hash!ode,- and e#uals,!annot be undefined if the .@ is a !ompound .rimary @ey .rimitive wrappers cannot be used when dealing with &ingle field eys

!hoices % and " are correct. +he #uestion says Anot applicableA and only choices % and " are not true. !ompound .rimary @eys can remain undefined until deployment time and primitive wrappers can be used with dingle field eys. *ence choices % and " are correct. !hoices A) B and ! are true about .rimary @eys and therefore incorrect choices.

/C7

Which of the following statements is true about &ession Beans?

A All attributes of a &tateless &ession bean have to be set to null prior to passivation. B All non-transient and non-seriali'able fields of a &tateful &ession Bean have to be set to null in the e3b.assivate,- method. ! +he container uses .assivation on &tateful and &tateless &ession Beans to allow pooling and swapping which are good techni#ues for resource management. % .assivation only applies to "ntity Beans and not to &ession Beans. !hoice B is correct. When a bean is about to be passivated) the container calls the e3b.assivate,- method. At this time) the bean instance can close all open resources and set all non-transient non-seriali'able fields to null. *ence choice B is correct. &tateless &ession Beans are not passivated. *ence choice A is incorrect. While &tateful &ession Beans are pooled and swapped) &tateless &ession Beans are not. *ence choice ! is incorrect. In addition to "ntity Beans) &tateful &ession Beans are passivated as well. *ence choice % is incorrect.

/C9 When a call is made to a single-entity find method in an entity bean) the 8b3ectEot(ound"$ception is thrown indicating that the re#uested entity was not found. What happens to the transaction? A It is automatically rolled bac since it is an application e$ception. B It is not automatically rolled bac since it is a system e$ception. ! It is not automatically rolled bac since it is an application e$ception. % It is automatically rolled bac since it is a system e$ception. " It may or may not automatically rollbac based on container specific implementation. !hoice ! is correct. +he #uestion deals with the ability to differentiate between system e$ceptions and application e$ceptions) and their impact on transactions. +he container throws the 8b3ectEot(ound"$ception to indicate that the entity re#uested by the single entity find method was not found. When this happens) the transaction is not typically rolled bac . *ence choice ! is correct. Application e$ceptions are thrown in response to errors encountered in the processing of business logic. Application e$ceptions do not cause transactions to roll bac . *ence choice A is incorrect. +he 8b3ectEot(ound"$ception is not a system e$ception. *ence choice B is incorrect. Again choice % indicates that the 8b3ectEot(ound"$ception is a system e$ception and is therefore incorrect. !hoice " indicates that it is up to the container to either roll bac the transaction or not) which is incorrect.

/C; A B ! % "

Which of the following services does the "2B !ontainer provide? 8b3ect %istribution 1ife !ycle 0anagement Integrated Web &erver and &ervlet "ngine 2ust in +ime management 2ava Runtime "ngine +ransaction 0anagement

!hoices A) B and " are correct.

+he "2B developer is only responsible to developing the core service that the component provides. All other services are decorations provided by the container. (or e$ample) the container provides ob3ect distribution via the *ome Interface and Remote Interface implementations and manages the life cycle of Beans. It also provides transaction management capabilities. *ence choices A) B and " are correct. 0any popular "2B vendors provide a web server and a &ervlet engine as well. But that is not a responsibility of the "2B !ontainer. *ence choice ! is incorrect. !hoice %) mentions something about 3ust in time management 2R") irrelevant 3argon meant to throw off the reader. *ence choice % is incorrect.

/C= A B ! %

When a client calls the create,- on a &tateless &ession BeanAs Remote Interface) +he newInstance,- method is invo ed by the container +he e3b!reate,- method is called by the container .assivated instance is activated and attached to the "2B 8b3ect +he !ontainer ta es an instance from the 0ethod Ready .ool and attaches it to the "2B 8b3ect.

!hoice % is correct. With &tateless &ession Beans) a new instance is not created each time a client re#uest comes in. Instead) the container manages a pool of bean instances) and when a client re#uests the service ,via a create method-) an instance from the pool is assigned to service the re#uest. *ence choice % is correct. +he newInstance,- method and the e3b!reate,- method are invo ed by the container to set up the instances in the bean pool and are not called with each create,- method called by the client. *ence choices A and B are incorrect. !hoice ! is incorrect because &tateless &ession Beans are not passivated or activated.

/C? A B ! %

+he container will synchroni'e an "ntity BeanAs state with the database) After every setZ$$,- method When a client calls the e3b1oad,- or e3b&tore,- method When the container thin s its appropriate based on various factors including the +ransactional !onte$t. When the connection.flush,- method is called.

!hoice ! is correct. In !0.) the container automatically handles synchroni'ation between the bean and the database. With B0. the developer is responsible for providing the logic for database synchroni'ation. In both cases however) the container decides when the synchroni'ation should occur) based on various activities such as transactions) concurrency and resource management. *ence choice ! is correct. It is not guaranteed that data will be synchroni'ed after each set method. Again this is because the container decides when to synchroni'e data. *ence choice A is incorrect. +he methods e3b1oad,- and and e3b&tore,- are considered callbac methods - the container uses them to communicate with the entity when it is about to or 3ust has synchroni'ed database state. *ence clients do not ma e calls to these methods. !hoice B is therefore incorrect. +here is no method called connection(lush,-. *ence choice % is incorrect.

/CB A B ! %

+he standard ports for *++.& and *++. are /1 F 11C BC F 997 997 F BC /1 F 11D

!hoice ! is correct. Although port numbers are configurable) the default ports for *++.& and *++. are 997 and BC. *ence choice ! is correct. .ort /1 is used with (+.) port 11C is used with .8.7 and port 11D is used with EE+.. *ence choices A and % are incorrect. !hoice B has the port numbers in the reverse order. *ence choice B is incorrect.

/CD A browser client !1 opens an &&1 session with &erver &1 on port 997. !1 then opens a new browser window and opens an &&1 session with &erver &/ ,while the &&1 session with &1 is active in the other browser window.- At the same time client !/ opens an &&1 session with &1 on 997 as well. Which of the following statements are false? A B ! % !lient !1 cannot be engaged in two &&1 connections as the same time. &1 cannot be engaged in two &&1 connections on the same port at the same time. !1 can have multiple &&1 connections open at the same time. &1 can have multiple &&1 connections open at the same time.

!hoices A and B are correct. Eote that the #uestion as s you which choices are false. &ince clients can simultaneously engage in multiple &&1 connections ,through different browser instances- and servers can support multiple concurrent &&1 connections) only choices A and B are false and therefore the right answers. !hoices ! and % are true and therefore incorrect.

/1C A B ! %

0essaging is achieved by4 &ynchronous tightly coupled communication between distributed components Asynchronous loosely coupled communication between components >sing &tubs and & eletons 0arshalling and unmarshalling of data

!hoice B is correct. 0essaging is a middleware architecture that is used for asynchronous communication. +his is generally achieved through a store-and-forward mechanism. All message producers and message consumers communicate to each other via a 0essage 8riented 0iddleware. 0essage consumers receive messages via a polling mechanism or a server-push mechanism. *ence choice B is correct. &ynchronous tightly coupled communication is a feature of R.! middleware applications. *ence choice A is incorrect. &tubs and & eletons are used to 0arshall and unmarshall data in distributed R.! environments. *ence choices ! and % are incorrect.

/11 A B ! %

0essaging supports which of the following two models4 .oint to .oint "nvelopeF1etter .ublishF&ubscribe &end to 1ist

!hoices A and ! are correct. +here are two models available in 0essaging. .oint-to-.oint is typically used for a one to one communication and .ublish &ubscribe is used when messages need to be broadcast to a group of subscribers. *ence choices A and ! are correct. +he envelope-content is not a messaging paradigm. It is an e$ample used to illustrate how messages are constructed when using &imple 8b3ect Access .rotocol ,&8A..- *ence choice B is incorrect. +here is no paradigm called &end to 1ist. .ublish &ubscribe is used for one to many communication. *ence choice % is incorrect.

/1/ A B ! %

Which of the following is not true about R.!? R.! attempts to mimic the behavior of a system that runs in one process When a remote procedure is invo ed) the caller is bloc ed until the procedure completes and returns control R.! is asynchronous in nature R.! is tightly coupled

!hoice ! is correct. +he #uestion is as ing what is false about R.!. 8nly choice !) which says that R.! is asynchronous in nature) is false. +herefore choice ! is correct. !hoices A) B and % are true statements about R.! based communication and hence incorrect.

/17

What is the difference between 0aintainability and 0anageability in &oftware "ngineering?

A 0anageability is the ability to correct flaws in the system whereas maintainability is the ability to ensure the continued health of the system. B 0aintainability is the ability to correct flaws in the system whereas manageability is the ability to ensure the continued health of the system. ! 0aintainability deals with ensuring that the system is always reliable and accessible whereas manageability deals with the ability to add functionality to the system. % +hey are both the same. !hoice B is correct. 0aintainability ,!ade B-)Gis the ability to correct flaws in the e$isting system without impacting other components of the systemG and manageability ,!ade D-Gis the ability to manage the system to ensure the continued health of a system with respect to scalability) reliability) availability) performance and security.G *ence choice B is correct.

+he definitions in choice A are in the reverse order and incorrect in choice !. !hoice % is trying to say that the two non-functional re#uirements refer to the same thing. *ence they are all incorrect.

/19 A B ! % " ( <

Which of the following are not considered tiers in a 2/"" based n-tier model? !lient +ier Web +ier "2B Integration +ier "I& +ier "I& Integration +ier 1egacy !onnectivity +ier 2!A +ier

!hoices !) ( and < are correct. +he #uestion is as ing what choices are not considered as 2/"" tiers. +here are no tiers called A"2B Integration +ierA) A1egacy !onnectivity +ierA or A2!A +ier.A *ence choices !) ( and < are correct. 2/"" applications have the following tiers4 !lient ,Browsers) Applications) Applets) 0obile clients and so on-) Web ,presentation tier consisting of 2&. as view and &ervlets as controllers-) "2B ,Business +ier) consisting of "2B and supporting classes-) "I& Integration ,2ava classes that integrate to the "nterprise Information &ystem tier- and finally the "I& tier ,relational databases) Z01 databases) "R. systems and so on.- *ence choices A) B) % and " are all valid 2/"" application tiers and therefore incorrect.

/1;

Which of the following are true about clientFserver based applications?

A !lients are typically used for data presentation) validation and for processing business logic. B 0ost clientFserver applications follow the 0odel/ architecture as opposed to n-tier applications that follow 0odel7. ! In clientFserver applications) the client normally consists of the view) controller and parts of the model. % In typical clientFserver applications) the presentation tier ,windows- generally tal s to controller ,a data dispatcher-) which then tal s to ob3ects that represent the enterprise data. " !lientFserver applications generally have fat clients and sometimes) fat servers as well. *ence both the client and the server could offer portability problems. !hoices A) ! and " are correct. In /-tier applications) clients are typically used for data presentation) validation of user inputs and processing of business logic. *ence choice A is correct. If you compare the functions performed by the client with the 0I! pattern) the client performs the duties of the view) the controller and parts of the model. +he client interacts with the database and retrieves data. +his data is then assembled into the re#uired view. (or e$ample) a window that shows all orders ta en in 1 day sorted by the customer number. +he client thus acts as the view in 0I!. When some search criteria is entered and the user presses a button to retrieve necessary data) the client appropriately dispatches the re#uest to the database interaction ob3ect that retrieves the necessary data. *ere the client acts as the controller. 0ost database interaction is encapsulated in a set of database access ob3ects. +hese ob3ects perform business rules processing. *ere the client performs the 3ob of the 0I! model. &ome logic is also encapsulated on the server side via triggers and stored procedures. *ence it is possible that the database also performs some model tas s in /-tier applications. *ence choice ! is correct.

!lientFserver applications fre#uently suffer from fat clients or fat servers or a combination of both. +his is because either all the logic is coded in the client ,9<1 scripting language- or all the logic is coded on the server ,through stored procedures and triggers- or a combination of both. +his results in poor portability of such applications. *ence choice " is correct. !hoice B indicates that /-tier applications follow 0odel/ architecture whereas n-tier applications follow 0odel7 architecture. +his is untrue) because it is n-tier applications that normally follow the 0odel/ architecture. *ence choice B is incorrect. Although ob3ect oriented clientFserver platforms may offer the tools to decouple windows and database interaction ob3ects that is not a normal feature in /-tier applications. *ence choice % is incorrect.

/1= In n-tier models) which tier is best suited for implementing the view) and controller components of an 0I! application? A B ! % " ( !lient +ier Web +ier 0I! +ier Business +ier "I& Integration +ier "I& +ier

!hoice B is correct. n-tier models typically follow a 0odel/ architecture where each tier has specific responsibilities. +he view and most of the controller components are generally placed in the Web +ier ,note4 in some 0odel/ architectures) some controller components are also placed in the business logic tier.- *ence choice B is correct. !hoice A is incorrect because the client tier is not responsible for the view and controller ob3ects. !hoice ! is incorrect because there no such tier as 0I! tier. !hoices %) " and ( are incorrect because none of them hold the view components ,although some controller components may be present in the Business logic tier.-

/1? A B ! % " ( <

Which of the following are not service level re#uirements that affect software architecture? %etailed %esign .erformance Reliability +raining Availability &ecurity %esign .atterns

!hoices A) % and < are correct. &ervice level re#uirements ,!ade =- or :uality of &ervice ,:o&- re#uirements are those that are needed by an application to satisfy the business re#uirements of a system. .erformance) &calability) Reliability) Availability) "$tensibility) 0aintainability) 0anageability and &ecurity are Eon-functional service level re#uirements. While choices A and % illustrate important aspects of a software pro3ect) they are not considered :o& re#uirements. Although choice % describes a best practice that is fre#uently used by good designers) it too is not a &ervice level re#uirement. *ence choices A) % and < are correct. .erformance) Reliability) Availability and &ecurity are service level re#uirements and therefore choices B) !) " and ( are incorrect.

/1B A B ! % " (

Which of the following >01 diagrams may be best suited for a Business Analyst? %eployment !lass >se !ase Activity !ollaboration &e#uence

!hoice ! is correct. >se !ase diagrams ,!ade 97-Gshow a set of use cases and actors and their relationships. >se !ase diagrams show the static view of a system. +hese diagrams are especially important in organi'ing and modeling the behaviors of a system.G >se case diagrams are fre#uently used by Business Analysts to capture business re#uirements of a system. !hoice ! is therefore correct. %eployment diagrams ,!ade ;C-Gshow the configuration of run time processing nodes and the components that live within these nodes. %eployment diagrams address the static view of the architecture.G Architects fre#uently use deployment diagrams. !hoice A is therefore incorrect. A class diagram ,!ade 99-Gshows a set of classes) interfaces and collaborations and their relationshipsU!lass diagrams address the static design view of a system.G &oftware designers fre#uently use class diagrams. !hoice B is therefore incorrect. Activity diagrams ,!ade 9B-Gare a special ind of state chart diagram that show the flow from activity to activity within the system. +his type of diagram is important in modeling the function of a system and emphasi'ing the flow of control among ob3ects.G %esigners and %evelopers fre#uently use Activity diagrams. *ence choice % is incorrect. A !ollaboration diagram ,!ade 9=-Gis an interaction diagram that emphasi'es the structural organi'ation of ob3ects that send and receive messages.G %esigners and developers fre#uently use Interaction diagrams. !hoice " is therefore incorrect. &e#uence %iagrams ,!ade 9=- areGinteraction diagrams that emphasi'e the time ordering of messages.G Interaction diagrams address the dynamic view of a system and are fre#uency used by designers and developers. *ence choice ( is incorrect.

/1D &ince a dependency e$ists between two pac ages if a dependency e$ists between any two classes in the pac ages) it can be deduced that all pac age dependencies are transitive in nature. +rueF(alse? A B +rue (alse

!hoice B is correct. .ac age %iagrams ,(owler 1CB-Gshow pac ages of classes and the dependencies among them A dependency e$ists between two elements if changes to the definition of one element may cause changes to the otherUA dependency between two pac ages e$ists if any dependency e$ists between any two classes in the pac agesUWith pac ages dependencies are non-transitive.G +he #uestion ma es an argument that all pac age dependencies are transitive in nature) which is false. *ence choice B is correct.

//C

Refer to the e$hibit for the following #uestion.

In the diagram) the initiali'ation call 1.1.1 is made by4

A B !

+he &ession (acade 8b3ect +he Acct 8b3ect +he AcctWebImpl 8b3ect

!hoice ! is correct. +he diagram shows a !ollaboration %iagram ,!ollaboration diagrams are Interaction diagrams and they address the dynamic view of a system. +hey emphasi'e on the structural organi'ation of ob3ects. Read the &!"A for 2/"" &tudy <uide for more information.1.1.1 Represents an initiali'ation method called by the value ob3ect AcctWebImpl on itself upon construction.

//1 0egasoft !orporation has a old application that uses a legacy database. Recently 0egasoft made a decision to develop the front-end code for the application using the 2ava Applet technology. At this time however) 0egasoft is not interested migrating its data to a relational database. In the order of importance) which of the following may be the best approach to connect to the legacy database. A B ! % 2%B!-Bridge) %atabase 0iddleware) 2%B! %atabase 0iddleware) 2%B!-8%B! bridge) 2%B! 2%B!) %atabase 0iddleware) 2%B!-8%B! bridge 2%B!) 2%B!-8%B! Bridge) %atabase 0iddleware

!hoice % is correct. >pdating the data storage tier ,2awors i ;7/.- GIf the data storage tier of a legacy system utili'es a relational database system) 2%B! may be used to provide connectivity to legacy databases. In most cases) legacy databases will not support a pure 2%B! driver. If the e$isting system provides 8%B! support) the 2%B!-8%B! Bridge can be used. If the database uses custom drivers) it might be possible to find database middleware that supports the custom driver and either an 8%B! or 2%B! interface.G It is therefore preferable to try for pure 2%B! driver support) failing which one

may opt for a 2%B!-8%B! Bridge. If that too is not possible) then a database middleware may be used. !hoice % is therefore correct. Although choices A) B and ! give the same three alternatives) they are in incorrect orders of preference. *ence choices A) B and ! are incorrect.

/// 0ichael (ell runs a computer assembly company. *e purchases parts from a wholesale parts distributor. (ell has a legacy application to trac purchases of parts and sale of computers. Although the current system is very infle$ible) the <>I is not very tightly coupled to the business layer. As an architect) what medium to long-term solution would you offer) given that (ell does not want to do away with his entire application yet? A B ! % " >se &creen &craping and 8ff-board server to provide information to a 2ava based application. Refactor the legacy code to ma e it fle$ible. Rewrite the infle$ible parts of the application alone using &ervlets %ecouple the e$isting front-end and replace it with a 2/"" based solution Replace the infle$ible parts with a fle$ible "R. solution

!hoice % is correct. +he ey in this #uestion is that the <>I is not very tightly coupled to the business layer. +his means that the <>I can be decoupled form the system fairly easily. (urther) the #uestion as s for a medium to long-term solution. +hus in this case) using a 2/"" based front-end may be preferable. *ence choice % is correct. +he use of screen scrapers may have been the best short-term solution. *owever it is certainly not the best medium to long-term approach. *ence choice A is incorrect. !ode re-factoring is not an alternative here. +he #uestion does not say anything about what the legacy system is written in and whether is easy to modulari'e its code. *ence choice B is incorrect. +he #uestion only mentions about changing the <>I. +hey are not loo ing to rewrite all infle$ible parts of the system. *ence choice ! is incorrect. !hoice " is incorrect because it refers to replacing all infle$ible parts of the system. (urther there is no indication anywhere in the #uestion that an "R. solution might ma e it more fle$ible. //7 A B ! % " Which design pattern can be used to create a family of dependent ob3ects? (actory 0ethod .rototype Builder Abstract (actory &ingleton

!hoice % is correct. Abstract (actory ,<8( B?-G.rovide an interface for creating families of related or dependent ob3ects without specifying their concrete classes.G *ence choice % is correct. (actory 0ethod ,<8( 1C?-G %efine an interface for creating an ob3ect) but let subclasses decide which class to instantiate. (actory method lets a class defer instantiation to subclasses.G *ence choice A is incorrect. .rototype ,<8( 11?-G &pecify the inds of ob3ects to create using a prototypical instance) and create new ob3ects by copying this prototype.G *ence choice B is incorrect. Builder ,<8( D?-G&eparate the construction of a comple$ ob3ect from its representation so that the same construction process can create different representations.G *ence choice ! is incorrect. &ingleton ,<8( 1/?-G "nsure a class only has one instance) and provide a global point of access to it.G *ence choice " is incorrect.

//9 .ensacola) a (lorida based soda company has 3ust started operations in %allas) +Z to counter competition from %r. .epper. .ensacola believes that using a 2/"" based application will put them ahead of the competition. +heir new architect is suggesting that &ession Beans be used to provide a unified interface to the "ntity Beans in the system. +he use of session beans here illustrates the use of what design pattern? A B ! % " ( (lyweight .ro$y (acade %ecorator Adapter Bridge

!hoice ! is correct. (a ade ,<8( 1B;-G.rovide a unified interface to a set of interfaces in a subsystem.G +he following is ta en from4 http4FF3ava.sun.comFblueprintsFcore3/eepatternsF.atternsF&ession(acade.html G>se a session bean as a facade to encapsulate the comple$ity of interactions between the business ob3ects participating in a wor flow. +he &ession (acade manages the business ob3ects) and provides a uniform coarse-grained service access layer to clients.G *ence choice ! is correct. (lyweight ,<8( 1D;-G>se sharing to support large numbers of fine-grained ob3ect efficiently.G *ence choice A is incorrect. .ro$y ,<8( /C?-G.rovide a surrogate or placeholder for another ob3ect to control access to it.G *ence choice B is incorrect. %ecorator ,<8( 1?;-GAttach additional responsibilities to an ob3ect dynamically. %ecorators provide a fle$ible alternative to subclassing for e$tending functionality.G *ence choice % is incorrect. Adapter ,<8( 17D-G!onvert the interface of a class into another interface clients e$pect. Adapter lets classes wor together that couldnAt otherwise because of incompatible interfaces.G *ence choice " is incorrect. Bridge ,<8( 1;1-G%ecouple an abstraction from its implementation so that the two can vary independently.G *ence choice ( is incorrect.

//; 8ne of the advantages of using &tateless &ession Beans is that they are lightweight ob3ects and do not have conversational state overheads. (urther) the container swaps these bean instances in and out of the bean pool to appropriately manage resources. +his allows the container to use fewer instances of the bean to service a larger number of clients. What design pattern is being illustrated here? A B ! % " %ecorator (actory (acade (lyweight Iisitor

!hoice % is correct. (lyweight ,<8( 1D;-G>se sharing to support large numbers of fine-grained ob3ect efficiently.G *ere the container uses fewer instances of &tateless &ession Beans to service a larger number of clients. *ence choice % is correct. %ecorator ,<8( 1?;-GAttach additional responsibilities to an ob3ect dynamically. %ecorators provide a fle$ible alternative to subclassing for e$tending functionality.G *ence choice A is incorrect.

(actory 0ethod ,<8( 1C?-G %efine an interface for creating an ob3ect) but let subclasses decide which class to instantiate. (actory method lets a class defer instantiation to subclasses.G *ence choice B is incorrect. (acade ,<8( 1B;-G.rovide a unified interface to a set of interfaces in a subsystem.G *ence choice ! is incorrect. Iisitor ,<8( 771-GRepresent an operation to be performed on the elements of an ob3ect structure. Iisitor lets you define a new operation without changing the classes of the elements on which it operates.G *ence choice " is incorrect.

//= Lou can traverse through the elements of many 2ava !ollection ob3ects because they provide a way to access their elements se#uentially. What design pattern is used here? A B ! % " ( Iisitor 8bserver Builder Iterator .ro$y %ecorator

!hoice % is correct. Iterator ,<8( /;?-G.rovide a way to access the elements of an aggregate ob3ect se#uentially without e$posing its underlying representation.G *ence choice % is correct. Iisitor ,<8( 771-GRepresent an operation to be performed on the elements of an ob3ect structure. Iisitor lets you define a new operation without changing the classes of the elements on which it operates.G *ence choice A is incorrect. 8bserver ,<8( /D7-G%efine a one-to-many dependency between ob3ects so that when one ob3ect changes state) all its dependents are notified and updated automatically.G *ence choice B is incorrect. Builder ,<8( D?-G&eparate the construction of a comple$ ob3ect from its representation so that the same construction process can create different representations.G *ence choice ! is incorrect. .ro$y ,<8( /C?-G.rovide a surrogate or placeholder for another ob3ect to control access to it.G *ence choice " is incorrect. %ecorator ,<8( 1?;-GAttach additional responsibilities to an ob3ect dynamically. %ecorators provide a fle$ible alternative to subclassing for e$tending functionality.G *ence choice ( is incorrect.

//? !ompact !omputers is a small computer assembly company. Any customer currently has the following choices for a .!4 ,i,ii,iiiBCC 0*' processor) 9C <B *%%) 1/B 0B RA0 1 <*' processor) =C <B *%%) /;= 0B RA0 1./ <*' processor) BC <B *%%) ;1/ 0B RA0

+he use of what design pattern would ensure that only the legal combinations could be sold? A B ! % " (actory 0ethod Builder .rototype Abstract (actory &ingleton

!hoice % is correct.

+his #uestion needs you to apply your nowledge of design patterns. We are dealing with families of related ob3ects. Abstract (actory ,<8( B?-G.rovide an interface for creating families of related or dependent ob3ects without specifying their concrete classes.G +he applicability section of Abstract (actory ,<8( BB- indicates that this pattern is to be used when4 A system should be configured with one of multiple families of products A family of related product ob3ects is to be used together and the constraint needs to be enforced. *ence Abstract (actory is the right pattern for this problem. !hoice % is therefore correct. (actory 0ethod ,<8( 1C?-G %efine an interface for creating an ob3ect) but let subclasses decide which class to instantiate. (actory method lets a class defer instantiation to subclasses.G *ence choice A is incorrect. Builder ,<8( D?-G&eparate the construction of a comple$ ob3ect from its representation so that the same construction process can create different representations.G *ence choice B is incorrect. .rototype ,<8( 11?-G &pecify the inds of ob3ects to create using a prototypical instance) and create new ob3ects by copying this prototype.G *ence choice ! is incorrect. &ingleton ,<8( 1/?-G "nsure a class only has one instance) and provide a global point of access to it.G *ence choice " is incorrect.

//B Inaccu Weather has a web site where people can chec the weather forecast of a city for up to five days in advance. +he data comes to Inaccu Weather through a speciali'ed custom feed that directly updates a relational database. If the company can e$pect between fifty to hundred concurrent hits in to their site) which of the following 2ava based technologies may be best suited for their needs? A B ! % " &ervlets and 2&. for presentation and &ession Beans with %A8 for retrieval. &ervlets and 2&. for presentation and !0. Beans for retrieval &ervlets and 2&. for presentation and B0. Beans for retrieval Applets for presentation and either "ntity or &ession Beans for retrieval &ervlets and 2&. for presentation with 2ava classes encapsulating all database access.

!hoice " is correct. +he ey points are4 1ow traffic that this site will be encountering +he fact that the data is not modified through the site. All database access is going to be for simple read-only data. (rom these points we can summari'e that the use of "2Bs will be over ill for such a simple application. *owever you still do not want to embed data access logic directly into &ervlets) as that would not be a very modular approach. *ence use &ervlets and 2&. for presentation and 2ava classes to encapsulate interactions with the database. !hoice " is therefore correct. While choice A is a straightforward 0odel/ techni#ue for this system) the use of "2B is not re#uired here. *ence choice A is incorrect. Eote that if the traffic becomes much higher and they wish to migrate to an "2B solution) choice A would become the best candidate. We have discussed that the use of "2B is not necessary for this application. (urther there is no concurrent use of shared data. *ence "ntity beans are definitely not the ideal choice. !hoice B and ! are therefore incorrect. !hoice % indicates the use of Applets and "2B. Applets are best used when better <>I capability is re#uired. In this e$ample) 2&. is a perfectly good solution. In any case) this choice refers to the use of "2B ,already discussed as e$tra baggage for this problem.- *ence choice % is incorrect.

//D +oysrfuss) a national toy store is creating a new e-front for 8rder processing. !ustomers have to create an account to transact with them) although an account is not re#uired for browsing the catalog. !ustomers can browse items and add them to a shopping cart. +hey can then proceed to chec out. At this time) they can update #uantities and submit the order. What technologies may be best suited for this application? A B ! % " ( < * 2&. for presentation and &ervlets as controllers. &ervlets for presentation and 2&. as controller. &tateless &ession Bean for &hopping cart &tateless session bean for catalog retrieval. &tateful &ession bean for shopping cart. &tateful session bean for 8rder update. "ntity bean for !atalog retrieval "ntity bean for 8rder update.

!hoices A) %) " and * are correct. +he use of 2&. for presentation and &ervlets for controllers is consistent with the 0odel / approach. *ence A is a right choice. !hoice B is the opposite of choice A and therefore incorrect. !hoice ! is incorrect because it is suggesting the use of a &tateless &ession bean for the management of the shopping cart. &ince stateless beans do not maintain any conversational state) they cannot be used for this purpose. +he use of a stateless session bean for catalog retrieval is consistent with the 0odel / architecture and a recommended best practice. !hoice % is therefore correct. &tateful &ession Beans hold conversational state. *ence the management of a shopping cart is a good e$ample of their use. " is therefore correct. &tateful &ession beans are not very useful for updating order information. ( is therefore incorrect. "ntity beans for catalog retrieval are over ill because "ntity beans are best used when shared data is being concurrently accessed or heavy transactional %01 statements are re#uired. < is therefore incorrect. "ntity beans represent the enterprise data of a system and perform speciali'ed %01 operations li e inserts) deletes and updates. +hey would be perfect for updating order information. * is therefore a correct choice.

/7C A B ! %

8f the following scenarios) which one may be best suited for the use of "ntity "nterprise Beans? !alculation of ta$ information) based on data retrieved by two other "ntity Beans +o maintain shopping cart state for an online application +o retrieve product catalogs based on a search criteria +o allow concurrent access to shared data) as in the case of on an online auction houseAs application.

!hoice % is correct. While "ntity beans model business concepts) usually persisted as records in some ind of database) it is not necessary to use "ntity beans every time you interact with the database. In fact from a performance point of view) simple selects and retrieval can be 3ust as easily done using &ession Beans with %ata Access 8b3ects ,%A8.- "ntity Beans are best used when you are dealing with concurrent access to shared data) where transactions) concurrency and integrity play a vital role. *ence choice % is correct. !hoice A refers to using e$isting data and performing some calculation on it. +his can be best achieved through a &tateless &ession Bean. *ence choice A is incorrect. !hoice B tal s about maintaining conversational state. +his is best done with &tateful &ession Beans. *ence choice B is incorrect. Retrieval of product catalogs is a simple #uery. Again this can be done through &tateless &ession Beans and %A8. *ence choice ! is incorrect.

/71 0ost "2B servers show high degree of availability. &erver clusters are an e$ample of how this is functionality is achieved. What ey advantages might server clusters offer in an "2B environment? A B ! % " 1oad distribution 1ocation transparency !aching capability 1oad balancing capability /.! ,+wo phase commit- capability

!hoices A and % are correct. &erver clusters increase availability and redundancy in a system. +hey also provide fault tolerance. With clusters) re#uests can be distributed so that multiple servers share the load. &ome servers may also offer the sophistication to determine which servers are under utili'ed so that load can be balanced. *ence choices A and % are correct. 1ocation +ransparency is achieved through 8b3ect %istribution. +his is a feature of all distributed systems. *ence choice B is incorrect. Iarious vendors may offer a variety of tools for better resource management. !aching may be one such capability. It has nothing to do with a multi-server environment though. *ence choice ! is incorrect. +wo phase commit ,/.!- may be a feature offered by many 2/"" vendors for addressing distributed transactions. Again this is not a feature of server clustering. *ence choice " is incorrect.

/7/ &tatus :uo is an emerging B/! company that has a portal through which customers can purchase clay 3ewelry. &ince the order process involves a shopping cart) session management and secure access are re#uired. *ow would you manage this? A B ! % >se *++. since it is a stateful protocol >se *++.& since it is a stateful protocol >se &8A. for state and security management. >se !<I with coo ies for state management.

!hoice B is correct. *++.& is a secure and stateful protocol. !hoice A is incorrect because *++. is inherently stateless. !hoice ! is incorrect because &8A. is an R.! mechanism) not a state management mechanism. !hoice % is incorrect because !<I programs are server side processes ,comparable to 2ava &ervlets.- +hey do not manage session state.

/77 !hocolat) an e$otic chocolate ma er in (rance is planning to provide an e-front for chocolate sales. (ed"$ would ship the pac ages to various national and international locations. In order to customi'e the customerAs interaction with the system and to ma e his F her overall shopping e$perience more pleasant) !hocolat has decided to support Internationali'ation.

What are some of the common things they would need to consider? A B ! % " ( 1anguage for messages. (ormats ,numeric) date and so on.%0Q re#uirements +a$es and legal rules. R&A 0%;

!hoices A) B and % are correct. +his #uestion deals with Internationali'ation. 1anguage for messages) formats ,numbers) date and so on-) ta$es and legal rules are all sub3ect to Internationali'ation. *ence A) B and % are correct. !hoice ! refers to a security mechanism where a demilitari'ed 'one is created between two firewalls and is irrelevant to I1BE. R&A and 0%; are security terminology used with cryptography. +herefore choices " and ( are incorrect.

/79 A sample program ships with / properties files - Base.properties) BaseNfr.properties. If the current 1ocale) 1ocale."E<1I&* has no matching properties file) what will happen when the ResourceBundle.getBundle method is called with ABaseA and 1ocale. "nglish as parameters? A &ince a matching properties file is not found) an e$ception is thrown B +his would not pose a problem because when a matching properties file is not found) the default properties file is used instead. !hoice B is correct. When the getBundle,- method is called on ResourceBundle) it chec s to see if a class or property file is available for the base parameterAs current locale. If neither is available) it uses the default. In this case Base..roperties will be used. *ence choice B is correct.

/7;

What is a %emilitari'ed Qone ,%0Q-?

A +he logical separation of tiers in a 2/"" application. "$ample4 the separation between the Web +ier and the "2B +ier B +he logical separation of layers in a 2/"" application. "$ample4 +he separation between the 8perating &ystem and the "2B !ontainer. ! A type of protection offered by pro$y firewalls) currently only available to the >.& armed forces under Eational &ecurity laws. % +he region between two firewalls !hoice % is correct. %emilitari'ed Qone ,%0Q- is an area between two firewalls. +he outer firewall lets re#uests to publicly accessible services in. It will re3ect all other re#uests. +he inner firewall will protect the companyAs internal networ and prevent re#uests coming into the %0Q from passing through it. !hoice % is therefore correct. !hoices A) B and ! are all incorrect.

/7= &creamWor s) a cinema multiple$) has a website from which you may download signed applets with the latest trailers) show timings and so on. +he Applet wor s on 2ava 1.7 or higher. +he applet needs to write user preferences to a temp file in the host machine ,where it is being e$ecuted-. Is that possible? Eote that the client has defined a use.olicy and the 3ava.policy has granted no persmissions for the applet A Applets cannot be used here because even signed applets are untrusted if the necessary permissions are not granted B +he sandbo$ model does not apply to signed applets. *ence this will pose no problem. !hoice A is correct. +his #uestion e$pects you to be familiar with the changes in the 2ava / &ecurity model. In 2%@1./ and higher) all code local and remote can be sub3ected to a security policy. By default) remote code will be constrained to the old &andbo$ model. *owever if a policy file is created with grant privileges) an applet will be restricted to the grants whether or not it is signed. *ence choice A is correct.

/7? A B ! % " (

Which of the following are valid methods in "ntity "2Bs? e3bActivate,observe,e3bRetrieve,e3b&tore,e3b%estroy,e3bRemove,-

!hoices A) % and ( are correct. "ntity Beans are sub3ect to activation and .assivation. +he container informs the bean that the bean is about to be passivated or activated through the two callbac methods - e3b.assivate,- and e3bActivate,-. "3b&tore,- is a callbac method used during database synchroni'ation. "3bRemove,- is called when the client wishes to remove the data the bean represents) from the database. *ence choices A) % and ( are correct. "3b&ave,-) e3bRetrieve,- and e3b%estroy,- are not valid methods for "2Bs. *ence choices B) ! and " are incorrect.

/7B Beans?

What does the term Atomicity mean in the conte$t of A!I% transactional properties and "nterprise 2ava

A B ! %

Integrity of underlying data Eon Interference from other processes or systems !omplete e$ecution or no e$ecution at all 0aintenance of all data changes in physical storage

!hoice ! is correct. Atomicity ,0onson-*aefel /nd edition /?;-G+o be atomic) a transaction must e$ecute completely or not at all.G *ence choice ! is correct. !hoice A refers to A!onsistency.A *ence it is incorrect. !hoice B refers to AIsolation.A *ence it is incorrect. !hoice % refers to A%urability.A *ence it is incorrect.

/7D

Which of the following statements about AEot &upportedA and AEeverA transactional attributes are true?

A Eot &upportedA suspends any transaction until the method is completed whereas AEeverA throws a Remote"$ception when called with a transaction. B EeverA suspends any transaction until the method is completed whereas AEot &upportedA throws a Remote"$ception. ! If the method is called without any transactional scope) both attributes will wor identically. % If the method is called with a transactional scope) both attributes will wor identically. !hoices A and ! are correct. !hoice A describes how the transactional attributes AEot &upportedA and AEeverA wor . A is therefore correct. B is the inverse of A and therefore incorrect. ! describes a situation where a method with transactional attribute AEot &upportedA or AEeverA is called without a transactional scope. In this case they both behave identically. !hoice ! is therefore correct. !hoice % indicates that under both circumstances the method will e$ecute identically. +his is incorrect because a AEeverA method will throw a ARemote"$ceptionA if called with a transaction. % is therefore incorrect.

/9C "2B1.1 has support for undefined .rimary @eys. +his means that the .rimary @ey can be undefined until deployment time. When we use defined .rimary @eys) the Bean class and the Interfaces use the Bean.@ type to identify the ey. What do the Bean class and the Interfaces refer to in the case of undefined .rimary @eys? A +hough the .rimary @ey itself can be undefined) its name must be predetermined. +he Bean class and the Interfaces use this name. B An instance of 3ava.util."numeration ! An instance of 3ava.lang.!lass % An instance of 3ava.lang.8b3ect !hoice % is correct. "2B 1.1 has support for undefined .rimary @eys) which means that they can be deferred until deployment time. When undefined .rimary @eys are used) the Bean class and its interfaces can refer to the undefined ey using 3ava.lang.8b3ect. !hoice A gives some incorrect information to throw you off. !hoices B and ! are incorrect because you cannot use 3ava.lang."numeration or 3ava.lang.!lass for referring to undefined .rimary @eys.

/91

Which of the following statements is true about %E& Round Robin?

A It considers actual load on machines before routing re#uests. B It uses a random generator to decide which server to route a re#uest to. ! It routs re#uests to one server until a configured threshold is reached and then sends subse#uent re#uests to the ne$t server.

"ach Re#uest is sent to subse#uent server in the list) after the end is reached it starts with the first server again.

!hoice % is correct. %E& Round Robin is a method is load distribution by which a set of servers is allowed to process incoming re#uests in se#uence. +he first re#uest goes to the first server) the second to the second server and so on. When the end is reached) the ne$t re#uest starts from the first server again. *ence choice % is correct. Eote that %E& Round Robin is a good load distribution techni#ue) not a load balancing techni#ue. &ince re#uests get processed se#uentially in %E& Round Robin) the current load on a server is not ta en into account before a new re#uest is delegated to a server. In load balancing techni#ues however) the load on individual servers is monitored before additional re#uests are sent to them. *ence choice A is incorrect. %E& Round Robin allows servers to process re#uests se#uentially) not in a random fashion. *ence choice B is incorrect. With load balancing techni#ues) a load monitor may chec for the current load on a primary server before deciding to delegate subse#uent re#uests to another server. +his is not true of %E& Round Robin though. *ence choice ! is incorrect.

/9/ A B ! %

<enerally spea ing what is the relevance between .erformance and &ecurity? +hey are not related to each other in any way t1C;9*igh &ecurity generally results in high performance *igh performance is a pre-re#uisite for secure systems &ecurity and .erformance are inversely proportional 1ow performance systems cannot be secure

!hoice ! is correct. 8ne of the ey aspects of security is encryption and decryption of data. %ata encryption ensures that sensitive data will be protected against eavesdropping and tampering. A concept called AcryptographyA is used for accomplishing this. +he two popular types of cryptography are A.ublic @ey !ryptographyA or AAsymmetric @ey !ryptographyA and A&ymmetric @ey !ryptography.A In both forms) a combination of !ryptographic algorithms ,ciphers- and hashing algorithms protect the data from intruders. +he data is decrypted at the receiverAs end and becomes intelligible again. All this wor results in e$tra overheads. *ence generally increased security results in a lower performance. !hoice ! is therefore correct. *igher security results in lower performance. *ence choices A and B are incorrect. A high performance is not a technical pre-re#uisite for secure systems although it may be a good idea to increase performance wherever possible to offset the performance loss due to higher security. *ence choice % is incorrect.

/97

Refer to the following diagram4

In the above diagram4 A B ! % " ( A has an association relationship with ! ! has an association relationship with A A has a composition relationship with ! ! has a composition relationship with A A has an aggregation relationship with ! ! has an aggregation relationship with A

!hoice " is correct. Aggregate relationship in >01 is denoted with an open diamond on one side of an association relationship. In the above diagram) class A has an aggregate relationship with Interface !. <enerally this means that at runtime) class A will hold a reference to an ob3ect that implements Interface !. *ence choice " is correct. +he interface ! does not have an association) aggregation or composition relationship with class A. !hoices B and % and ( are therefore incorrect. If class A had a solid diamond instead of an open diamond) it would have represented a composition. *ence choice ! is incorrect.

/99

Refer to the following e$hibit4

+he above diagram is an e$ample of4 A B ! % " 8b3ect Interaction %iagram !ollaboration %iagram &tate %iagram &e#uence %iagram Activity %iagram

!hoice % is correct. +he diagram shown above represents a &e#uence diagram. A se#uence diagram is an interaction diagram that shows the time ordering of events. !hoice % is therefore correct.

/9; A B ! % " (

!8RBA specification does not provide support for which of the following? Eaming &ervice !ontainer managed .ersistence &ecurity +ransaction &ervice "vent ,Asynchronous 0essaging!oncurrency !ontrol

!hoice B is correct. !8RBA does not provide support for A!ontainer 0anaged .ersistence.A !0. is a concept only supported by the "2B specification. *ence choice B is correct. !8RBA has support for Eaming) &ecurity) +ransactions) "vents and !oncurrency control. *ence the other choices are incorrect.

/9= !ompany AB! has a legacy application that can be accessed via !8RBA. +he company wants to integrate new 2ava based development with the e$isting legacy services. At this time no new services are planned. If the legacy application were primarily to be used as a !8RBA server) which connectivity option would you recommend? A B ! % " R0I-2R0. R0I with 2EI 2ava I%1 R0I-II8. *++. tunneling

!hoice ! is correct. +he ey here is that the e$isting legacy system supports a !8RBA interface and no new services are being currently planned. If 2ava code is primarily going to access !8RBA services) the recommended connectivity tool is 2ava I%1. 2ava I%1 gives 2ava code !8RBA capability. *ence choice ! is the correct answer. R0I-2R0. should be used when dealing with distributed applications) all written primarily in 2ava. *ence choice A is incorrect. +he #uestion does not specify anything about the legacy codeAs 2EI capability. *owever it specifically mentions about !8RBA compatibility. *ence choice B is incorrect. R0I-II8. is the protocol used with "2B. +he legacy system is coded with a !8RBA interface and the #uestion mentions that no new coding is anticipated. &o "2Bs are not a good choice for this problem. *ence choice % is incorrect. When you wish to communicate with a system whose firewall does not permit re#uests of a certain protocol) the re#uests are sometimes mas#ueraded as *++. re#uests. +his concept is called *++. tunneling. *ence choice " is incorrect.

/9? Which of the following defines a standard architecture for connecting the 2/"" platform to heterogeneous "I& applications? A B ! % " 2/&" 2ava Web &tart 2%B! 20& 2!A

!hoice " is correct. +he following is ta en from4 http4FF3ava.sun.comF3/eeFconnectorF G+he 2/"" !onnector architecture provides a 2ava solution to the problem of connectivity between the many application servers and "I&s already in e$istence. By using the 2/"" !onnector architecture) "I& vendors no longer need to customi'e their product for each application server. Application server vendors who conform to the 2/"" !onnector architecture do not need to add custom code whenever they want to add connectivity to a new "I&.G *ence choice " is correct. 2/&" is a platform that providesGthe compiler) tools) runtimes and A.Is for developing) deploying and running applets and applications in the 2ava programming language.G *ence choice A is incorrect.

+he following is ta en from4 http4FF3ava.sun.comFproductsF3avawebstartF G2ava +0 Web &tart -- a technology for simplifying deployment of 2ava applications-- gives you the power to launch full-featured applications with a single clic from your Web browser. Lou can now download and launch applications) such as a complete spreadsheet program or an Internet chat client) without going through complicated installation procedures.G *ence choice B is incorrect. +he following is ta en from4 http4FF3ava.sun.comFproductsF3dbcF G2%B!+0 technology is an A.I that lets you access virtually any tabular data source from the 2ava +0 programming language. It provides cross-%B0& connectivity to a wide range of &:1 databases) and now) with the new 2%B! A.I) it also provides access to other tabular data sources) such as spreadsheets or flat files. +he 2%B! A.I allows developers to ta e advantage of the 2ava platformAs GWrite 8nce) Run Anywhere +0G capabilities for industrial strength) cross-platform applications that re#uire access to enterprise data. With a 2%B! technology-enabled driver) a developer can easily connect all corporate data even in a heterogeneous environment.G *ence choice ! is incorrect. +he following is ta en from4 http4FF3ava.sun.comFproductsF3msF G+he 20& A.I improves programmer productivity by defining a common set of messaging concepts and programming strategies that will be supported by all 20& technology-compliant messaging systems.G While you may be able to communicate with "I& systems using 20& ,if the "I& supports 20&-) it is not a standardi'ed architecture for connecting to heterogeneous "I& applications. *ence choice % is incorrect.

/9B A B ! %

Which of the following methods is optional in the *ome Interface of an "ntity Bean? !reate,(indBy.rimary@ey,Remove,Eone of the above

!hoice A is correct. &ometimes when you do not want the clients of an "2B application to add data to your system) you may choose not to provide a create method in the *ome Interface of the "nterprise bean. +he create method is therefore optional. *ence choice A is correct.

/9D A B

+he Bean class provides implementations for which of the following methods? 0ethods in the BeanAs *ome Interface 0ethods in the BeanAs Remote Interface

! % " ( <

"2B !allbac methods A) B and ! A and B A and ! B and !

!hoices A) B and ! are correct. +he Bean class has implementations for the methods corresponding to the methods in the *ome and Remote Interfaces) and the beanAs callbac methods. *ence choice % is correct.

/;C A B ! %

Which of the following statements is true about &tateful &ession Beans? +hey leave 0ethod Ready .ool state to enter %oes not "$ist &tate. +hey leave 0ethod Ready state to enter &tateful &tate. +hey leave 0ethod Ready state to enter .assivated or %oes not "$ist state. +hey never leave the 0ethod Ready state.

!hoice ! is correct. +he valid lifecycle states of a &tateful &ession Bean are %oes Eot "$ist) 0ethod Ready) 0ethod Ready ,in +Z- and .assive. +he Bean instance leaves the 0ethod Ready state to enter the .assive &tate ,through .assivation- or the %oes Eot "$ist &tate ,through removal-. *ence choice ! is correct. 0ethod Ready .ool is not a valid state for &tateful &ession Beans because the specifications do not mandate the container to maintain a bean pool for &tateful &ession Beans. Eote that some containers may internally use some ind of pooling mechanism for achieving higher performance. *ence choice A is incorrect. +here is no &tateful &tate in the lifecycle of a &tateful &ession Bean. !hoice B is therefore incorrect. &tateful Beans leave the 0ethod Ready &tate to enter %oes not "$ist or .assive &tate. *ence choice % is incorrect.

/;1 A session bean called &omeBean has a method called some0ethod,-) which calls some8ther0ethod ,same bean- followed by some8therBean0ethod,- of &ome8therBean. If &ome0ethod,- starts a B0+ transaction) which of the following are true? A &ome8ther0ethod also has to be use B0+ since itAs part of the same bean. B &ome8ther0ethod can use B0+ or !0+) because transactions are defined at the method level in the deployment descriptor. ! If &ome8therBean is a &ession Bean) it has to necessarily use B0+ since the caller is a B0+ method. % If &ome8therBean is a &ession Bean) it may use either B0+ or !0+. " If &ome8therBean is an "ntity Bean) it may use either B0+ or !0+. ( If &ome8therBean is an "ntity Bean) it must necessarily use only !0+. !hoices A) % and ( are correct.

A Bean may be defined as either a B0+ bean or a !0+ bean. 8ne cannot have some methods of a bean participating in !ontainer 0anaged +ransactions and other methods participating in Bean 0anaged +ransactions. *ence choice A is correct. &ession Beans may either be defined as !0+ beans or B0+ beans whereas "ntity beans can only be !0+ beans. *ence choices % and ( are correct. +he same bean cannot have both B0+ and !0+ transaction management. *ence choice B is incorrect. &ome8therBean is a different Bean. It may either be defined as a B0+ bean or a !0+ bean. 2ust because the calling bean is in a B0+ transaction) all the other beans do not have to be B0+ beans as well. *ence choice ! is incorrect. "ntity Beans can only be !0+ beans. *ence choice " is incorrect.

/;/ In "2B 1.1 the "2B timeout property may be added to the BeanAs deployment descriptor for easier declarative life cycle management. +rueF(alse? A B +rue (alse

+he above statement is (alse. In "2B 1.C) the timeout period was specified in the deployment descriptor and defined as number of seconds. Between two business method invocations) the timer was reset. In "2B 1.1 however) the deployer is allowed to set the timeout in a vendor dependent manner. *ence the above statement is false.

/;7 A B/! company uses 2/"" based technologies for its e-commerce storefront. In order to increase scalability and availability they plan to add capacity to their e$isting server and also add a new server. Which of the following statements are true? A Adding capacity will improve scalability) as more memory would allow better bean pooling. B Adding a server would be difficult) as "2B servers cannot span multiple physical machines. ! +he proposal not does address hori'ontal scalability. % +he proposal addresses both vertical and hori'ontal scalability. " Adding a server to the system would be easy as "2B vendors generally support fault tolerant mechanisms via server clustering. !hoices A) % and " are correct.

+he proposal to add capacity and an additional server address the issue of scalability. Adding capacity is an e$ample of Iertical &calability and adding a new server is an e$ample of *ori'ontal &calability. Additional servers also improve availability because of redundancy and fault tolerance. *ence choices A) % and " are correct. 0ost 2/"" vendors provide multi-server support. *ence choice B is incorrect. Adding a new server is an e$ample of *ori'ontal scalability. *ence choice ! is incorrect.

/;9 !ompany AB! Inc. has an e$isting 2/"" application that provides an "2B interface. AB! Inc. is writing a new 2/"" based application for enhanced 0I& reporting. Which of the technologies listed below would be ideal for this? A B ! % R0IF2R0. with 2EI 2ava I%1 R0I F II8. 20&

!hoice ! is correct. +he ey here is that AB! Inc. is using a primarily "2B based application. +he protocol used in "2B is R0I-II8.. *ence choice ! is correct. +he #uestion clearly says that the e$isting application is in "2B. +here is no legacy connectivity involved here. *ence choice A is inappropriate and therefore incorrect. 2ava I%1 is primarily used when a ma3ority of the code needs a !8RBA interface. &ince the e$isting code is already in "2B) there is no need for 2ava I%1 here. *ence choice B is incorrect. 20& is useful when you want to send messages to other applications asynchronously via a 0essage 8riented 0iddleware. *ence option % is incorrect as well.

/;; A B ! % "

A firewall bloc s all re#uests e$cept those on ports BC and 997. II8. re#uests !an be processed because II8. always wor s on port BC !annot be processed because port BC belongs to a different protocol !an be processed by &&1 !an be processed via *++. bloc ing !an be processed via *++. tunneling

!hoice " is correct. +unneling is a concept that allows re#uests of one protocol to mas#uerade as re#uests of another protocol) so that they may bypass the firewall. In the case of *++. tunneling) re#uests try to pass of as *++. re#uests. *ence choice " is correct.

.ort BC is the standard port for *++. re#uests) not !8RBA re#uests. *ence choice A is incorrect. Although port BC may be used for *++.) that does not mean that !8RBA re#uests cannot be processed. As it happens) *++. tunneling will allow !8RBA re#uests loo ing li e *++. re#uests to pass through port BC. *ence choice B is incorrect. &&1 stands for &ecure &oc ets 1ayer. &&1 is a protocol that e$ists above +!.FI. and below application level protocols. &&1 does not process !8RBA re#uests. *ence choice ! is incorrect. While firewalls may bloc re#uests of certain protocols) there is no concept called *++. bloc ing. *ence choice % is incorrect.

/;= A B ! %

Applications e$change messages through4 Active channels called Eetwor s Active !hannels called 0essage Bro ers Iirtual !hannels called %igests Iirtual !hannels called %estinations

!hoice % is correct.

/;? A B ! %

Which of the following are true about .ublishF&ubscribe? &ubscribers receive a copy of every message. It is a .ull ,.olling- based model. It is a push-based model. It is generally used when one publisher wishes to send a message to one subscriber.

!hoices A and ! are correct. In the .ublishF&ubscribe messaging paradigm the publisher broadcasts a message to the 0essage 8riented 0iddleware ,080.- +he 080 then typically uses a server-push mechanism to try to push a copy of the message to every subscriber who showed interest in the topic. 8ptionally a subscriber may also register as a durable subscriber) in which case the message will have guaranteed delivery. *ence choices A and ! are correct. +he .oint-to-.oint ,./.- model is a #ueue-based model where the message consumer typically polls the #ueue for incoming messages. .ublishF&ubscribe) on the other hand is a push-based model. *ence choice B is incorrect. .ublishF&ubscribe is generally used for a one to many type of communication while ./. is typically used for a one to one communication. *ence choice % is incorrect.

/;B A B ! %

In the .ublishF&ubscribe messaging architecture) publishers send messages to4 A specified node) which is then re-distributed to all subscribes. %irectly to all subscribers in the +opic subscription list. A designated #ueue. A component transaction monitor such as an "2B &erver for further processing by a message driven bean.

!hoice A is correct. +he .ublish subscribe model of messaging is a one to many messaging paradigm where the publisher typically sends a message to a centrali'ed node. +he node then broadcasts the message to all the topic subscribers) who have registered their interest in the topic. +his allows the publisher and the subscribers to be decoupled. (urther if the subscriber is registered as a durable subscriber) he will receive the message ultimately even if he is currently inactive. +he 080 provider can thus guarantee delivery and any :uality of &ervice re#uirements pertaining to the message delivery. Although possible) choice B is not the ideal implementation method) because it couples publishers and subscribers. 0ost 080 providers use a server process that communicates with client processes for establishing heartbeats and for communicating messages. !hoice ! is incorrect because it refers to the .oint-to-.oint messaging model) which is typically a one to one communication between two parties. !hoice % is incorrect because the 0essage %riven Bean is a message listener. &o the best use of a message driven bean would be as a subscriber.

/;D 1-tier applications represent a single point of failure) although typically) changes to one part of the system do not generally affect the whole system. +rueF(alse? A B +rue (alse

!hoice B is correct. 1-tier systems represent a single point of failure. (urther if any changes are made to one part of the system) typically the whole system may be affected because of a high degree of tight coupling. *ence choice B is correct.

/=C

Which of the following are not true about E-+ier &ystems?

A E-+ier systems are distributed over many systems and hence always present a maintenance problem. B E-+ier systems are generally component based and are therefore #uite easy to maintain. ! &ince E-+ier systems do not use database stored procedures or triggers for business logic processing) they are generally very slow. % &ince E-+ier systems are container based) many E-+ier systems can be easily scaled ,both vertically and hori'ontally-. " E-+ier systems suffer from only one drawbac over clientFserver systems - E-+ier systems do not ta e advantage of resource sharing techni#ues such as connection pooling. ( E-+ier systems can use various techni#ues for Identification) Authentication and Authori'ation and are therefore considered #uite secure.

!hoices A) ! and " are correct. +his is a discussion about the benefits vs. drawbac s of E-+ier applications. Eote that the #uestion says Anot true.A +hough E-+ier systems are distributed over many systems) when architected and designed well) they do not present any maintenance problems. +his is because they are highly modular ,component-container based- and it is relatively easy to correct problems in one tier without impacting other tiers. +herefore A is a correct choice. E-+ier systems can also yield high performance. +hey can be highly optimi'ed at each tier. &erver clusters can be used where bottlenec s are encountered) connection pools can be used by applications to ac#uire and release connections ,a process more effective that creation and destruction of connections- and so on. *ence choice ! is a correct choice. +hough not relevant to the discussion it should be noted that putting all business rules in the database tier reduces database portability and also violates tier encapsulation. *ence it is not considered a 2/"" best practice to use stored procedures and triggers e$tensively for business logic processing. As opposed to clientFserver systems) E-+ier systems generally ma e e$tensive use of resource sharing capabilities. Bean .ools and !onnection pools are good e$amples. *ence " is a right answer. B) % and ( are good e$amples of other capabilities of E-+ier systems.

/=1 In general) 1-tier applications are less hori'ontally scalable than 7-tier applications) although from a scalability point of view) clientFserver applications are the most scalable. +rueF(alse? A B +rue (alse

+he above statement is (alse. +his is a tric #uestion. It starts out by ma ing a true statement although that is not the main stem of the #uestion. +he main stem seems to indicate that !lientF&erver applications are the most scalable types of applications. +hat is incorrect because E-+ier applications are modular and therefore individual components can be targeted for scaling.

/=/ A B ! % "

Which of the following do not aid a systemAs e$tensibility? 0odulari'ing !ode >sing well defined software design patterns >sing &ervlets to manage distributed database access >sing 2&. &criptlets to locate "nterprise beans >sing %ata Access 8b3ects when &ession Beans or B0. "ntity beans have to communicate to the database.

!hoices ! and % are correct.

"$tensibility refers to a systems ability to incorporate new functionality with ease. Writing %atabase access code within &ervlets or using 2&. for locating "nterprise 2ava Beans ma e the code very difficult to maintain. +hese are poor programming practices and adversely affect the e$tensibility of a system. *ence choices ! and % are correct. 0odulari'ed code) good design practices using patterns) and encapsulating database access with a %A8 all ma e the code easy to maintain) thus rendering the system easily e$tensible.

/=7

Refer to the following e$hibit

In the >01 diagram) A B ! % " ( < [AA has an association relationship with ABA ABA has an association relationship with AAA AAA e$tends ABA AAA has a composition relation with ABA ABA has a composition relationship with AAA AAA has an aggregation relationship with ABA ABA has an aggregation relationship with AAA

!hoice % is correct. +he relationship between class A and class B represents the strongest form of association - composition. A solid diamond near the ob3ect that will instantiate the other ob3ect in the association) denotes a composition relationship. !lass A does not have an association or aggregation ,open diamond near A- relationship with class B. !lass A also does not e$tend B ,open triangle near B.- *ence all other choices are incorrect.

/=9

Refer to the following e$hibit

What >01 diagram is shown in the e$hibit?

A B 8b3ect ! % " ( <

!lass !omponent !ollaboration &e#uence .ac age Eode

!hoice ( is correct. +he diagram denotes a pac age diagram. A pac age diagram ,(owler 1CB- shows pac ages of classes and the dependencies among them. !hoice ( is correct.

/=; A B ! % " (

Which of the following statements about Interaction diagrams are true? Interaction diagrams represent the dynamic view of a system. Interaction diagrams may represent static or dynamic views of the system. Interaction diagrams are polymorphic. Interaction diagrams are isomorphic. Interaction diagrams only show time ordering of messages. Interaction diagrams may show the structural organi'ation of the ob3ects that send or receive messages.

!hoices A) % and ( are correct. Interaction diagrams ,(owler =?- are models that describe how groups of ob3ects collaborate in some behavior. +here are two inds of Interaction diagrams - &e#uence diagrams and !ollaboration diagrams. ,!ade 9=- Interaction diagrams address the dynamic view of a system. A se#uence diagram emphasi'es on the time ordering of messages whereas a collaboration diagram emphasi'es the structural organi'ation of the ob3ects that send or receive messages. &e#uence diagrams and !ollaboration diagrams are also isomorphic ,you can ta e one and transform it to the other.- *ence choices A) % and ( are correct. Interaction diagrams do not describe the static view of a system. *ence choice B is incorrect. Interaction diagrams are isomorphic) nor polymorphic. *ence choice ! is incorrect. Interaction diagrams show either the time ordering of messages ,se#uence diagrams- or the structural organi'ation of ob3ects ,collaboration diagrams.- *ence choice " is incorrect. /== Refer to the following diagram

(rom the diagram) it can be inferred that4 A B ! % " A can only have / or 9 Bs associated with it A can have / to 9 ,9 not inclusive- Bs associated with it A can have / to 9 ,/ not inclusive- Bs associated with it A can have either / or 9 Bs associated with it but not 7 A can have 7 Bs associated with it

!hoice " is correct. +he multiplicity shown above translates into ,A can have / to 9 Bs associated with it.- !hoice " says that A can have 7 Bs associated with it and is therefore correct.

/=? Eopester Inc.) a !% manufacturer uses 0etallic !orporation for ma ing 3ewel cases. When the inventory of 3ewel cases falls under the reorder level) Eopester communicates with 0etallic via fa$es. Eopester now wants to build a solution for its supply chain management. 0etallic uses a legacy system that supports !8RBA interfaces for other companies to interface to them with. 0etallicAs servers are protected by firewalls and will only let *++. or *++.& re#uests through. What is EopesterAs best option here? A B ! % &ince 0etallic will not let !8RBA re#uests through) Eopester should continue sending fa$es. Eopester should ta e its business away to 0etallicAs competitors. Eopester should use the popular &8A. protocol since &8A. re#uests communicate over *++.. Eopester should use a concept called *++. tunneling to communicate with 0etallic.

!hoice % is correct. 8ne of the most common interconnection problems that arise in third party integrations is that of security. 0ost companies have strict security policies and only allow access to the ports that support *++. and *++.&. +herefore !8RBA re#uests generally have to mas#uerade as *++. re#uests to get through the firewall. While this beats the very purpose of the firewall) such implementations are #uite common. +his concept is called *++. tunneling. *ence choice % is correct. !hoice A is incorrect for obvious reasons. What is the point of automation if we still want to use a paper based solution? !hoice B is incorrect because businesses do not change partners due to minor software issues. !hoice ! is incorrect because there is no mention of whether 0etallic supports &8A. in the discussion.

/=B &yracuse &obers is a Eational *oc ey 1eague team in upstate Eew Lor . +hey currently use a mainframebased application for talent procurement and management. +heir team currently visits various schools and universities across the country. When they find an interesting candidate) they enter his profile details in hand held devices. 1ater the information is fa$ed to &yracuse) where another set of users enters the data into the mainframe.

<iven that the &obers do not want to incur too much capital and operational e$pense in rewriting the application) what would be the #uic est way of giving them an Internet based profile management system? A B ! % " Rewrite the system using Applets. Rewrite the system using 0odel/ Architecture based solution. >se screen scraper for obtaining an ob3ect interface and off-board server for forwarding re#uests. >se R0I with 2EI. "nable *++. tunneling and use !8RBA calls.

!hoice ! is correct. +he ey here is Aless e$pensiveA and A#uic est.A *ence the best method under the given circumstances is the combined use of &creen &crapers and an off-board server. !hoice ! is therefore correct. Rewriting the system is time consuming and also cost intensive. *ence choices A and B are incorrect. +here is no mention of the legacy application supporting 2EI. +he #uestion mentions that it is a mainframe-based application) ma ing screen scrapers the safest bet. *ence choice % is incorrect. +here is also no mention of !8RBA support. *ence choice " is incorrect. /=D A .hiladelphia based cable company is using 2/"" for their !ustomer 0anagement system. +he system uses a combination of *+01 and 2&. for presentation. 2ava &ervlets are used as !ontrollers. All &ervlets have access to a &ervlet!onte$t ob3ect) which functions as a !ontainer to the shared resources of the &ervlets. +he &ervlet!onte$t ob3ect best e$emplifies what design pattern? A B ! % " Iterator 0ediator Interpreter &tate &ingleton

!hoice " is correct. &ingleton ,<8( 1/?-G "nsure a class only has one instance) and provide a global point of access to it.G In the e$ample cited above) all &ervlets use a common &ervlet!onte$t ob3ect as a container for the shared resources. +his is a perfect e$ample of the &ingleton %esign .attern. *ence choice " is correct. Iterator ,<8( /;?-G.rovide a way to access the elements of an aggregate ob3ect se#uentially without e$posing its underlying representation.G *ence choice A is incorrect. 0ediator ,<8( /?7-G%efine an ob3ect that encapsulates how a set of ob3ects interact. 0ediator promotes loose coupling by eeping ob3ects from referring to each other e$plicitly) and lets you vary their interaction independently.G *ence choice B is incorrect. Interpreter ,<8( /97-G<iven a language) define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.G *ence choice ! is incorrect. &tate ,<8( 7C;-GAllow an ob3ect to alter its behavior when its internal state changes. +he ob3ect will appear to change its class.G *ence choice % is incorrect.

/?C &ince &tateful &ession Beans are not pooled as their &tateless counterparts) the container uses .assivation and activation techni#ues for better resource management. What design pattern is close to the concept of .assivation) as described here? A B ! % " ( !omposite (lyweight +emplate 0ethod !ommand 0emento !hain of Responsibility

!hoice " is correct. 0emento ,<8( /B7-GWithout violating encapsulation) capture and e$ternali'e an ob3ectAs internal state so that the ob3ect can be restored to this state later.G With &tateful &ession Beans the container e$ternali'es the state of the bean via .assivation for better memory management. When re#uired) a bean in the passive state can be brought bac to the 0ethod Ready state via activation. *ence choice " is correct. !omposite ,<8( 1=7-G!ompose ob3ects into tree structures to represent part-whole hierarchies. !omposite lets clients treat individual ob3ects and composites of ob3ects uniformly.G !hoice A is irrelevant here and therefore incorrect. (lyweight ,<8( 1D;-G>se sharing to support large numbers of fine-grained ob3ect efficiently.G *ence choice B is therefore incorrect. +emplate 0ethod ,<8( 7/;-G%efine a s eleton of an algorithm in an operation) deferring some steps to subclasses. +emplate 0ethod lets subclasses redefine certain steps of an algorithm without changing the algorithmAs structure.G !hoice ! is therefore incorrect. !ommand ,<8( /77-G"ncapsulate a re#uest as an ob3ect) thereby letting you parameteri'e clients with different re#uests) #ueue or log re#uests) and support undoable operations.G !hoice % is therefore incorrect. !hain of Responsibility ,<8( //7-G Avoid coupling the sender of a re#uest to its receiver by giving more than one ob3ect a chance to handle the re#uest.G !hain the receiving ob3ects and pass the re#uest along the chain until an ob3ect handles it.G !hoice ( is therefore incorrect.

/?1 *eavenAs &tairway) an e-auction house allows sellers to put up items for sale. .otential buyers can subscribe an interest in these items. When somebody updates the cost with a higher price) the new price information is sent to a 20& based middleware. +he 080 then intimates all subscribers of the event. What design pattern is illustrated in the discussion here? A B ! % " &ervice to Wor er (ast 1ane Reader 8bserver Iisitor .ublishF&ubscribe

!hoice ! is correct.

8bserver ,<8( /D7-G%efine a one-to-many dependency between ob3ects so that when one ob3ect changes state) all its dependents are notified and updated automatically.G In the e$ample above) when someone ,message producer- updates the bid price) the 080 has to send a message to all interested subscribers ,message consumers.- +his is a good e$ample of the 8bserver %esign .attern. *ence choice ! is correct. +he following is ta en from4 http4FF3ava.sun.comFblueprintsFcore3/eepatternsF.atternsF&ervice+oWor er.html &ervice to Wor er4G!ombine a controller and dispatcher with views and helpers ,see (ront !ontroller and Iiew *elper also- to handle client re#uests and prepare a dynamic presentation as the response. !ontrollers delegate content retrieval to helpers) which manage the population of the intermediate model for the view. A dispatcher is responsible for view management and navigation and can be encapsulated either within a controller or a separate component.G "$amples of &ervice to Wor er pattern can be seen in popular 0odel/ (ramewor s such as &truts and Web Application (ramewor ,WA(.- +his pattern is not relevant to this situation and choice A is therefore incorrect. +he following is ta en from4 G+he (ast 1ane Reader design pattern provides a more efficient way to access tabular) read-only data. A fast lane reader component directly accesses persistent data using 2%B!+0 components) instead of using entity beans. +he result is improved performance and less coding) because the component represents data in a form that is closer to how the data are used.G When "2Bs are not re#uired in an application ,smaller applications- and 2&. pages need to access the database to retrieve information) they may use helper classes) which in turn instantiate %A8s to access data. A 2&. page retrieving catalog information through the !atalog*elper class and the !atalog%A8 is a good e$ample of the (ast 1ane Reader .attern. *ence choice B is incorrect. Iisitor ,<8( 771-GRepresent an operation to be performed on the elements of an ob3ect structure. Iisitor lets you define a new operation without changing the classes of the elements on which it operates.G !hoice % is therefore incorrect. .ublishF&ubscribe is a messaging architecture) not a design pattern. *ence choice " is incorrect.

/?/ In 20& based applications components never interact with each other directly. +he messages are always sent to the 080 and the 080 stores and forwards them to the recipients. +his concept helps avoid e$plicit references and promotes loose coupling. +he 080 is acting as aFan4 A B ! % " Interpreter Iisitor 0ediator &ervice 1ocator &ervice to Wor er

!hoice ! is correct. 0ediator ,<8( /?7-G%efine an ob3ect that encapsulates how a set of ob3ects interact. 0ediator promotes loose coupling by eeping ob3ects from referring to each other e$plicitly) and lets you vary their interaction independently.G In this e$ample) the 080 decouples the message producers and consumers from referring to each other directly) thus acting as a 0ediator. !hoice ! is therefore correct.

Interpreter ,<8( /97-G<iven a language) define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.G *ence choice A is incorrect. Iisitor ,<8( 771-GRepresent an operation to be performed on the elements of an ob3ect structure. Iisitor lets you define a new operation without changing the classes of the elements on which it operates.G !hoice B is therefore incorrect. +he following is ta en from4 http4FF3ava.sun.comFblueprintsFpatternsF&ervice1ocator.html G+he &ervice 1ocator pattern centrali'es distributed service ob3ect loo ups) provides a centrali'ed point of control) and may act as a cache that eliminates redundant loo ups. It also encapsulates any vendor-specific features of the loo up process.G In 0odel/ architectures) !ontrollers may use &ervice 1ocators to delegate business events. !hoice % is therefore incorrect. +he following is ta en from4 http4FF3ava.sun.comFblueprintsFcore3/eepatternsF.atternsF&ervice+oWor er.html &ervice to Wor er4G!ombine a controller and dispatcher with views and helpers ,see (ront !ontroller and Iiew *elper also- to handle client re#uests and prepare a dynamic presentation as the response. !ontrollers delegate content retrieval to helpers) which manage the population of the intermediate model for the view. A dispatcher is responsible for view management and navigation and can be encapsulated either within a controller or a separate component.G "$amples of &ervice to Wor er pattern can be seen in popular 0odel/ (ramewor s such as &truts and Web Application (ramewor ,WA(.- +his pattern is not relevant to this situation and choice " is therefore incorrect.

/?7 !ompact !omputers is a small computer assembly company. Its online application allows customers to pic and choose accessories to build their own .!s. +he accessories are4 i. .rocessor - BCC0h') 1<h') 1./<h' ii. *%% - 9C <B) =C <B) BC <B iii. 0emory - 1/B 0B) /;= 0B) ;1/ 0B !ustomers choose parts and #uantities during the order. (or e$ample) a customer could choose a second *%% as a secondary hard drive or purchase additional RA0. What design pattern may be optimal for implementing a suitable design here? A B ! % " ( (actory 0ethod .rototype &ingleton +emplate 0ethod Business %elegate Builder

!hoice B is correct. .rototype ,<8( 11?-G&pecify the inds of ob3ects to create using a prototypical instance) and create new ob3ects by copying this prototype.G In this e$ample) the ey is that using prototypical instances ,for *ard %rives and RA0-) you can create multiple instances of the re#uired part. *ence choice B is correct.

(actory 0ethod ,<8( 1C?-G %efine an interface for creating an ob3ect) but let subclasses decide which class to instantiate. (actory method lets a class defer instantiation to subclasses.G (actory 0ethod pattern is used when concrete factory classes are re#uired for creating subclasses. *ence choice A is incorrect. &ingleton ,<8( 1/?-G "nsure a class only has one instance) and provide a global point of access to it.G *ence choice ! is incorrect. +emplate 0ethod ,<8( 7/;-G%efine a s eleton of an algorithm in an operation) deferring some steps to subclasses. +emplate 0ethod lets subclasses redefine certain steps of an algorithm without changing the algorithmAs structure.G !hoice % is therefore incorrect. +he following is ta en from4 http4FF3ava.sun.comFblueprintsFpatternsFBusiness%elegate.html GIn distributed applications) loo up and e$ception handling for remote business components can be comple$. When applications use business components directly) application code must change to reflect changes in business component A.Is. +hese problems can be solved by introducing an intermediate class called a business delegate) which decouples business components from the code that uses them. +he Business %elegate pattern manages the comple$ity of distributed component loo up and e$ception handling) and may adapt the business component interface to a simpler interface for use by views.G *ence choice " is incorrect. Builder ,<8( D?-G&eparate the construction of a comple$ ob3ect from its representation so that the same construction process can create different representations.G Builder is used to create a comple$ ob3ect made up of specific types of parts. *ere we now the parts but not their #uantities. *ence Builder is inappropriate here and therefore choice ( is incorrect.

/?9 %oomingdaleAs has an online application where customers may browse the latest seasonAs catalogs. At this time no e-commerce is planned. What 2/"" technology is best suited for this application. Eote that a study of Internet traffic over the last two years in a similar company indicated that the site can e$pect up to five hundred thousand hits a day although during +han sgiving) when sales are at the highest) it could get ten to twenty times higher) perhaps even more. A B ! % " ( 2ava &ervlets 2&. with 2ava classes !0. "ntity Beans B0. "ntity Beans &tateless &ession Beans with %A8 &tateful &ession Beans with %A8

!hoice " is correct. +he ey here is the nature of the application. Eo e-commerce is planned at this time) so there may not be any order transactions re#uiring "ntity Beans. *owever the site can e$pect half a million hits each day) the number increasing e$ponentially during holiday seasons) indicating that perhaps &ession Beans should be considered for the application. !atalog retrieval can be done with simple &ession beans and %A8. *ence choice " is correct. !hoice A and B are not suitable because using 3ust 2ava &ervlets and 2&. alone may not be the best solution in a system involving heavy usage.

As stated earlier) "ntity Beans are not necessary here because there is no transactional processing. !hoices ! and % are therefore incorrect. &tateless &ession Beans are sufficient for performing simple database retrieval operations. &tateful &ession Beans are only re#uired when conversational state needs to be maintained) as in the case of e-commerce applications with shopping carts. *ence choice ( is incorrect.

/?; *iatus Regency is a popular resort hotel. It has four regional head#uarters in the >.&. +here is also a national head#uarters in <aithersburg) 0%. All calls made to the toll-free BCC numbers are routed to the nearest call center. If the re#uested city falls outside the region) the call gets rerouted from the call center appropriately. *iatus re#uires a nightly update of all transactions to the national head#uarters for nationwide batch reporting. What 2/"" technology may be best suited for this? A B ! % " ( < 2ava-I%1 R0I-2R0. "2B 2+AF2+& 2!A 20& 2A(

!hoice ( is correct. Whenever asynchronous communication is re#uired) messaging is the best option. 0ost 080 implementations provide guaranteed delivery and high :o& levels. (urther) messaging decouples the producer and consumer and can be used when bandwidth availability is limited) since no synchronous response is re#uired. +he ey here is the nightly update clearly indicating the asynchronous nature of the communication. *ence choice ( is correct. 2ava-I%1) R0I-2R0. and "2B are used for synchronous communication. *ence choices A) B and ! are incorrect. 2+AF2+& is used to manage user-defined transactions and is irrelevant to this discussion. *ence choice % is incorrect. +he following is ta en from4 http4FF3ava.sun.comF3/eeFconnectorF G+he 2/"" !onnector architecture provides a 2ava solution to the problem of connectivity between the many application servers and "I&s already in e$istence. By using the 2/"" !onnector architecture) "I& vendors no longer need to customi'e their product for each application server. Application server vendors who conform to the 2/"" !onnector architecture do not need to add custom code whenever they want to add connectivity to a new "I&.G *ence choice " is incorrect. +he following is ta en from4 http4FF3ava.sun.comFproductsF3avabeansFglasgowF3af.html GWith the 2avaBeans +0 Activation (ramewor standard e$tension) developers who use 2ava +0 technology can ta e advantage of standard services to determine the type of an arbitrary piece of data) encapsulate access to it) discover the operations available on it) and to instantiate the appropriate bean to perform said operation,s-. (or e$ample) if a browser obtained a 2."< image) this framewor would enable the browser to identify that stream of data as a 2."< image) and from that type) the browser could locate and instantiate an ob3ect that could manipulate) or view that image.G *ence choice < is incorrect.

/?= A B ! % " (

Which of the following situations may be best suited for implementation using &ervlets and 2&.? Eeed large scale deployment Eeed heavy use of transactions Eeed to process dynamic re#uests from *++. clients Eeed access to relational databases through a generic set of A.Is +o function as Intercepting filters) re#uest processors and re#uest dispatcher When static templates are combined with data to form dynamic *+01 output

!hoices !) " and ( are correct. &ervlets and 2&. are best suited for applications where there is a need for processing dynamic re#uests from *++. clients. In 0odel/ architectures) &ervlets are used as !ontrollers and are responsible for processing incoming re#uests) and dispatching them to appropriate handlers. 2&. are used as views to combine static templates with dynamic data to form *+01 or Z01 output. *ence choices !) " and ( are correct. When an application involves large-scale deployment and heavy transactional re#uirements) "2Bs are the best technology. *ence choices A and B are incorrect. 2%B! is used to access relational databases through a generic set of A.Is. *ence choice % is incorrect.

/??

What are the benefits of Bean pooling?

A Bean instances are created during startup) thus avoiding the e$pense of creation) each time a client re#uests it. B Bean pooling allows load distribution over several machines. ! Bean pooling is the containerAs way of balancing load - moving future re#uests from client to a different machine) if load increases are encountered. % Allows a container to use beans as flyweights. !hoices A and % are correct. 8ne of the advantages of using stateless session beans are that they are light weight ob3ects and therefore) can be used in situations that do not re#uire any conversational state management. +he container ma es use of this capability to create a pool of instances that can be used to service client re#uests. When a re#uest is serviced) the bean instance is moved bac to the pool. +hus the e$pense of creation is avoided each time a client re#uest comes in. (urther the concept of using a smaller number of instances to service a large number of clients is referred to as the (lyweight pattern ,<8( 1D;-) the case with bean pooling. +herefore choices A and % are correct. Bean pooling is not responsible for load distribution ,something accomplished by %E& Round Robin.- &ome containers wor ing under a clustered environment achieve load balancing. Again this is not a benefit of bean pooling. *ence choices B and ! are incorrect.

/?B A B ! %

What are the valid life-cycle states an "ntity Bean can e$ist in? %oes Eot "$ist) .ooled) 0ethod Ready %oes Eot "$ist Ready) Ready ,in +Z-) .assivated %oes Eot "$ist) 0ethod Ready .ool %oes Eot "$ist) .ooled) Ready

!hoice % is correct. +he valid lifecycle states for an "ntity Bean are %oes Eot "$ist) .ooled and Ready. *ence choice % is correct. "ntity Beans do not have a 0ethod Ready state. *ence choice A is incorrect. When "ntity Beans are passivated they enter the pooled state. Also) there is no 0ethod Ready ,in +Z- state for "ntity Beans. *ence choice B is incorrect. +he 0ethod Ready .ool state is a lifecycle state for &tateless &ession Beans) not "ntity Beans. *ence choice ! is incorrect.

/?D A company has a third party billing system that provides !PP A.I access. In the current architecture) a daemon process listens on a specified port on the server for incoming payloads. +he incoming payloads are then decoded to the form command 5tab6 data. 8nce the command is nown) the process calls the appropriate A.I with the data. +he company is trying to move to a 2ava based solution. *owever) until the billing system is upgraded) they will still need to use the !PP bases A.Is. What .rotocol may be best suited for achieving this?

A B ! % " (

R0I-2R0. with 2EI wrappers for the A.I calls R0I-II8. ,&tateless session beans ma ing the A.I calls!ustom soc et programming to replace the !PP daemon process with a 2ava class *++. re#uest ma ing a !<I call for the Billing updates 2IEI based program to interface to the A.Is 2!A to ma e the A.I call

!hoice A is correct. +he ey here is that the billing system supports !PP based A.Is. +he new code is being written in the 2ava platform. +he best approach here is to write R0I-2R0. code to tal to the billing system and have 2EI wrappers there to communicate with the !PP A.Is. *ence choice A is correct. +he #uestion says that the billing system only supports !PP A.Is. *ence choice B is incorrect. While custom 2ava soc et programming may be used on the server side to replace the !PP process) in order to call the A.Is) !PP wrappers will still be re#uired. *ence choice ! is incorrect. *++.) 2IEI and 2!A do not satisfy the re#uirement of the !PP wrapper need. *ence choices %) " and ( are also incorrect.

/BC A B ! %

Which of the following statements are true? +he 3ava.te$t pac +he 3ava.te$t pac +he 3ava.util pac +he 3ava.util pac age contains classes and interfaces for handling te$t in a locale-sensitive way. age contains the 1ocale class and classes for %ate and +ime. age contains classes for importing and e$porting non->nicode character data. age contains the 1ocale class and classes for %ate and +ime

!hoices A and % are correct. +he 3ava.te$t and 3ava.util pac ages are used to support 2ava Internationali'ation. +he 3ava.te$t pac age has classes and interfaces for handling locale specific te$t and the 3ava.util pac age containes the 1ocale class and other classes for %ate and +ime manipulation. *ence choices A and % are correct. +he 3ava.util pac age contains the 1ocale class and %ate and +ime classes. *ence choice B is correct. +he Input&treamReader and 8utput&treamWriter classes handle non->nicode character data conversion. +hese classes are found in the 3ava.io pac age. *ence choice ! is incorrect.

/B1 A B ! %

+he representation of a set of cultural and language preferences is done using which class? 3ava.util.1anguage.reference 3ava.te$t.0essage(ormat ResourceBundle 1ocale

!hoice % is correct. +he following is ta en from4 http4FF3ava.sun.comFproductsF3d F1.1FdocsFguideFintlFintl.doc.htmlT/=?/= GA 1ocale ob3ect represents a specific geographical) political) or cultural region. An operation that re#uires a locale to perform its tas is called locale-sensitive and uses the 1ocale ob3ect to tailor information for the user. (or e$ample) displaying a number is a locale-sensitive operation- the number should be formatted according to the customs and conventions of the userAs native country) region) or culture.G *ence choice % is correct. +here is no 1anguage.reference class. Regional preferences are addressed through various I1BE features such as ResourceBundle) 1ocale and so on. *ence choice A is incorrect. +he following is ta en from4 http4FF3ava.sun.comFproductsF3d F1.1FdocsFguideFintlFintl.doc.htmlT/91=?

G+he class 0essage(ormat provides a means to produce concatenated messages in language-neutral way. +he 0essage(ormat ob3ect ta es a set of ob3ects) formats them) and then inserts the formatted strings into the pattern at the appropriate places.G *ence choice B is incorrect. +he following is ta en from4 http4FF3ava.sun.comFproductsF3d F1.1FdocsFguideFintlFintl.doc.htmlT/7C7D G+he class ResourceBundle is an abstract base class representing containers of resources. .rogrammers create subclasses of ResourceBundle that contain resources for a particular locale. Eew resources can be added to an instance of ResourceBundle) or new instances of ResourceBundle can be added to a system without affecting the code that uses them. .ac aging resources as classes allows developers to ta e advantage of 2avaAs class loading mechanism to find resources. Resource bundles contain locale-specific ob3ects. When a program needs a locale-specific resource) a &tring ob3ect for e$ample) the program can load it from the resource bundle that is appropriate for the current userAs locale. In this way) the programmer can write code that is largely independent of the userAs locale isolating most) if not all) of the localespecific information in resource bundles.G *ence choice ! is incorrect.

/B/

What is the difference in the 2ava &ecurity model between 2%@ 1.1 and 2%@1./ with regards to applets?

A +here is no difference between the two 2%@ versions in #uestion. Applets are always confined to the sandbo$. B In 2%@ 1.1) applets are never trusted and in 2%@ 1./ they always are. ! 2%@ 1./ fi$ed a flaw in the 2%@ 1.1 security policy. +here are no security holes in 2%@ 1./ because Applets are never trusted. % In 2%@ 1.1 only signed applets were trusted whereas in 2%@ 1./) any applet with the right security permissions can be trusted. !hoice % is correct. +he following is ta en from4 http4FF3ava.sun.comFdocsFboo sFtutorialFsecurity1./FoverviewFinde$.html G2%@ 1.1 introduced the concept of a Gsigned applet)G as illustrated in the ne$t figure. A digitally signed applet is treated li e local code) with full access to resources) if the public ey used to verify the signature is trusted. >nsigned applets are still run in the sandbo$. &igned applets are delivered) with their respective signatures) in signed 2AR ,2ava Archive- files. 2%@ 1./ introduces a number of improvements over 2%@ 1.1. (irst) all code) regardless of whether it is local or remote) can now be sub3ect to a security policy. +he security policy defines the set of permissions available for code from various signers or locations and can be configured by a user or a system administrator. "ach permission specifies a permitted access to a particular resource) such as read and write access to a specified file or directory or connect access to a given host and port. +he runtime system organi'es code into individual domains) each of which encloses a set of classes whose instances are granted the same set of permissions. A domain can be configured to be e#uivalent to the sandbo$) so applets can still be run in a restricted environment if the user or the administrator so chooses. Applications run unrestricted) as before) by default but can optionally be sub3ect to a security policy.G As we can see) the 2ava / &ecurity model is totally fle$ible. *ence choice % is correct.

!hoices A) B and ! are incorrect because there are differences between the 2%@ 1.1 and 2%@ 1./ security model and signed applets were trusted in 2%@ 1.1 whereas all applets are sub3ect to a security policy in 2%@ 1./.

/B7 A B ! %

Which of the following are mandatory steps in the &&1 handsha e? Ialidate !lient to &erver Ialidate &erver to !lient Allow client and server to choose cryptographic algorithm >se symmetric ey encryption to generate shared secrets

!hoices B and ! are correct. When a client tries to establish an &&1 connection with a server) the server identifies itself to the client. +he client may optionally identify itself to the server. +he client and the server then choose the best cryptographic algorithm. .ublic @ey !ryptography is used to generate shared secrets and &ymmetric @ey !ryptography is then used for communication. *ence choices B and ! are correct. +he clientAs validation to the server is an optional step in the &&1 handsha e. *ence choice A is incorrect. .ublic @ey !ryptography is used to generate shared secrets. *ence choice % is incorrect.

/B9 When a &tateful &ession Bean is passivated) what activities should the developer perform in the e3b.assivate,- method?

A B ! %

!lose all open resources &et transient fields to E>11 &et Eon-transient fields to E>11 &et non-transient non-seriali'able fields to E>11

!hoices A and % are correct. %uring .assivation) it is the developerAs responsibility to ensure that all open resources are closed and all non-transient non-seriali'able fields are set to E>11. +herefore choices A and % are correct. +here is no need to set transient fields to E>11. +hey will not be seriali'ed anyway. +herefore choice B is incorrect. If Eon-transient fields are set to E>11) there is no point in seriali'ing the bean instance. *ence choice ! is incorrect.

/B; &ession Bean &B1 calls a method in another &ession Bean &B/. If the calling Bean has a transactional scope) with which of the following attributes in &B/) will the transaction not be propagated?

A B ! % " (

&upports Re#uired Eot &upported Re#uires Eew 0andatory Eever

!hoices !) % and ( are correct. +he following is ta en from4 http4FF3ava.sun.comFblueprintsFguidelinesFdesigningNenterpriseNapplicationsN/eFtransactionsFtransactions?.html G+ransaction Attributes4 A transaction attribute is a value associated with a method of an enterprise bean that uses container-managed transaction demarcation. A transaction attribute is defined for an enterprise bean method in the beanAs deployment descriptor) usually by an application component provider or application assembler. +he transaction attribute controls how the "2B container demarcates transactions of enterprise bean methods. In most cases) all methods of an enterprise bean will have the same transaction attribute. (or optimi'ation purposes) it is possible to have different attributes for different methods. (or e$ample) an enterprise bean may have methods that do not need to be transactional. A transaction attribute must be specified for the methods in the component interface of a session bean and for the methods in the component and home interfaces of an entity bean. Re#uired - If the transaction attribute is Re#uired) the container ensures that the enterprise beanAs method will always be invo ed with a 2+A transaction. If the calling client is associated with a 2+A transaction) the enterprise bean method will be invo ed in the same transaction conte$t. *owever) if a client is not associated with a transaction) the container will automatically begin a new transaction and try to commit the transaction when the method completes. Re#uiresEew - If the transaction attribute is Re#uiresEew) the container always creates a new transaction before invo ing the enterprise bean method and commits the transaction when the method returns. If the calling client is associated with a transaction conte$t) the container suspends the association of the transaction conte$t with the current thread before starting the new transaction. When the method and the transaction complete) the container resumes the suspended transaction. Eot&upported - If the transaction attribute is Eot&upported) the transactional conte$t of the calling client is not propagated to the enterprise bean. If a client calls with a transaction conte$t) the container suspends the clientAs transaction association before invo ing the enterprise beanAs method. After the method completes) the container resumes the suspended transaction association. &upports - It the transaction attribute is &upports and the client is associated with a transaction conte$t) the conte$t is propagated to the enterprise bean method) similar to the way the container treats the Re#uired case. If the client call is not associated with any transaction conte$t) the container behaves similarly to the Eot&upported case. +he transaction conte$t is not propagated to the enterprise bean method. 0andatory - +he transaction attribute 0andatory re#uires the container to invo e a beanAs method in a clientAs transaction conte$t. If the client is not associated with a transaction conte$t when calling this method) the container throws 3ava$.transaction.+ransactionRe#uired"$ception if the client is a remote client or 3ava$.e3b.+ransactionRe#uired1ocal"$ception if the client is a local client. If the calling client has a transaction conte$t) the case is treated as Re#uired by the container. Eever - +he transaction attribute Eever re#uires that the enterprise bean method e$plicitly not be called within a transaction conte$t. If the client calls with a transaction conte$t) the container throws 3ava.rmi.Remote"$ception if the client is a remote client or 3ava$.e3b."2B"$ception if the client is a local client. If the client is not associated with any transaction conte$t) the container invo es the method without initiating a transaction.G

With Eot &upported) Re#uires Eew and Eever) the e$isting transactionAs scope will not be propagated. +herefore choices !) % and ( are correct and choices A) B and " are incorrect.

/B= A B ! %

+he findByZ$$,- method in the *ome Interface of an entity bean returns An Instance of 3ava.lang.8b3ect An instance of the Remote Reference to the bean An instance of 3ava.util."numeration An instance of the Bean class.

!hoices B and ! are correct. +he finder methods return either an instance of the Remote Reference to the bean or an instance of 3ava.lang."numeration ,if multiple rows are found.- +herefore choices B and ! are correct. +he finder methods never return an instance of 3ava.lang.8b3ect. !hoice A is therefore incorrect. +he bean class is never e$plicitly returned to the client. +he client always only wor s with the remote reference to the bean class. !hoice % is therefore incorrect.

/B?

With Bean 0anaged .ersistence) what are the developerAs responsibilities in terms of data synchroni'ation?

A +he %01 statements for inserting) deleting and updating data are coded in appropriate methods and the client program is responsible for synchroni'ing data by calling the methods appropriately. B +he %01 statements for inserting) deleting and updating data are coded in appropriate methods but since e3b1oad,- and e3b&tore,- are callbac methods) the container ma es calls to them) as needed. !hoice B is correct. With B0.) although the code necessary for inserting) deleting and updating data is provided by the developer) the container still decides when to synchroni'e the BeanAs state with the database. +he container ma es this decision based on various activities including the current transactional conte$t and so on. +he client does not call the callbac methods e$plicitly. *ence choice B is correct. !hoice A is incorrect because it suggests that it is the clientAs responsibility to invo e the callbac methods.

/BB i.

>nder which of the following conditions should you use an "ntity Bean? +he bean represents a business entity) not a procedure.

ii. A B ! %

+he beanAs state must be persistent. If the bean instance terminates or if the 2/"" server is shut down) the beanAs state still e$ists in persistent storage ,a database-. !hoice ,i- only !hoice ,ii- only !hoice ,i- or ,ii- depending on whether the !ontainer is "2B 1.C compliant or "2B 1.1 compliant Both choice ,i- and ,ii-

!hoice % is correct. "ntity Beans are best used when the bean represents a business entity and when the beanAs state must be persistent. *ence choice % is correct. i. +he bean represents a business entity) not a procedure. ii. +he beanAs state must be persistent. If the bean instance terminates or if the 2/"" server is shut down) the beanAs state still e$ists in persistent storage ,a database-. ############################################

You might also like