Bu linkte, Boğaziçi Üniversitesi Bilgisayar Mühendisliği bölümünde okutulan CMPE473 dersinin örnek sınav soruları bulunmaktadır.
Aşağıdaki cevaplar ise, benim bu dersin 2.sınavına hazırlandığım gecenin sabahında çalışma amaçlı yazılmıştır.
Sorulara bakabilir ve cevapları yorumlayabilirsiniz.
Bu yazıyı okuyan arkadaşlara yardımcı olması dileğiyle.
MIDTERM-1:
=============
1. JMS’de mesajlar birer communication nesnelerdir. Böylece, JMS’te objeler remote node’lara gönderilebilirler. Socketslerde obje pass etme olayı yoktur. sadece data alış verisi olur. RMI ile objeler serialize edilip bu objelerin methodları çağırılır.
—A remote object passed as a parameter can only implement remote interfaces.
—By reference, not value.
—when a non-remote object is passed as an argument in a remote method invocation, the content of the non-remote object is copied before invoking the call on the remote object.
2.Birinci forma bir actionListener metodu ekleriz. actionPerformed() metodu ile event’i handle edip bu eventin hangi item seçilip yapıldığını anlarız. combobox.selectedItem gibi. daha sonra JMS provider kullanarak bir point to point messaging yaratıp bu selectedItem’ı queue ekleyip ikinci formun bu mesajı almasınını sağlarız. Java event delegate model ile onMessage methodunda bu mesajı alır ve ikinci formu doldururuz.
3.
–RMI can be used in remote situations where JNDI cannot be used. EJB components are named and looked up with JNDI. rmi registry’de objenin url’si parametre olarak geçilirken, JNDI ile obje/componentin ismi geçilir.
–JNDI provides a “naming and directory service” within a JVM,
–RMI provides the ability to execute procedures in a remote JVM from another [remote] JVM
4.In point-to-point messaging, there are only one consumer and producer. There are a queue and messages in the queue may be expire if it is defined as. In publish/subscribe messaging, there may be many consumers and producers. consumers should subscribe themselves to topic to receieve messages. Topic is expire whene all messages delivered to all subscribes.
Use PTP messaging when every message you send must be processed successfully by one consumer.
the subscriber must continue to be active in order for it to consume messages.
Use pub/sub messaging when each message can be processed by zero, one, or many consumers.
MIDTERM-2
1. a. application server will take care of security,transactionimultithreading.
appserver–>webserver+ejb container.
b.a web server handles HTTP protocol.Receives HTTP requests, process it and response static or dynamic response with program.an application server provides access to business logic for use by client application programs
c.application server accessed thin adn thick client. but webserver is accessed only thin client.
d.An Application Server may include a Web Server inside it.
2. container supports components. container is interface between components and low-level functionalities of app server. So programmers no need to know underlying details. components are assembled into J2ee module and deploed its container. the container manages nonconfigurable services such as enterprise bean and servler life cycles. they contain components. EJB container, web container,app client container,applet container.Container settings customize the underlying support provided by the J2EE server,The container is responsible for creating the enterprise bean, binding the enterprise bean to the naming service. container-managed persistence. Naming and finder methods. db connections and store persistence.
3.similarities: both of them is servlet. because JSP page dynamically compiled to servlet. both of them need java-complient server.both of them use Java language.
differences: servlet is java class. changing in even html part in servlet should be compiled. in JSP changing automatically complied. require java knowledge. JSP: extends servlet. JSP seperate application logic from presentation more than servlet.JSP includes scriptlet,directives, tags.
JSP is docuemnt centric.
4.starts with a set of seed url. retrieve web page from that url. detect links from that url. add these url to seed.
memory management is challenges because, a url is about 16kb. and serach engine store much more secondary storage and memory.
also, traversal between URL requires strong graph algorithms to determine which url comes next.
then, link extracting is challenger issue because there are many links in pages and there are many types of pages such as html,doc,pdf.
7. I will use and implement 3 EJBs. They are: stateless session bean, steteful session bean and entity bean.
I use stateless session bean because first item, returned value is not client specific. showing times and movies is always same for all clients. I can use here stateful session bean also, however I worry about performance of my app. because staeful session beans holds values user-centric until clients over. I will use stetuful session beans because in the 2nd item there is an operaiont client-specific. Soi my app. should be hold state between method invocations. In here, I cannot use any other type of beans.
GetMovieBean as stateful session bean.
MovieBean as Entity bean. persistent.
customer bean ???
stateful bean and steteless bean
both can be used for 1st operation. getMovie(today) can manage first operaion in stateful bean.
customerBean
customerbean,moviebean.
getMovie()–>