Units 7 & 8 Flashcards

1
Q

Remote Method Invocation (RMI)

A

object-orientated counterpart of RPC

raised the naming, locating + binding problems of distributed systems

a technology that can be used by itself

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Registry

A

a naming service that associates objects to unique names

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Layered architecture of remote method calls

A
  1. server application binds the server object to a symbolic name in the registry
  2. client object looks up the symbolic name in the registry + obtains a reference to the server object
  3. client object uses the reference to make a remote method call
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Remote method

A

a method that can be called from outside the JVM where is is executing

(local in same JVM)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Remote object

A

an object with at least one remote method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Remote interface

A

specifies methods available to client objects

objects of classes implementing this interface will be accessed remotely

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Remote Method Invocation (RMI) proxy later

A

aka stub/skeleton layer

stub - client-side proxy object

skeleton - server-side proxy object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Location transparency (RMI)

A

the actual location of the stub object is unknown to the client

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Enterprise JavaBeans (EJB)

A

a component model defined by JavaEE for building enterprise applications

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a bean?

A

a component written in Java

types - session beans (business logic) + entity classes (business data)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Primary key

A

uniquely identify a record

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Foreign key

A

uniquely identifies a record in another table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How can a remote object, remote interface + a remote method be detected in the server-side code?

A

a remote interface extends Remote

a remote method throws a RemoteException

a remote object’s class usually extends UnicastRemoteObject

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How must the registry be set up?

A

a registry service is started on a port known to the client + server applications

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

how does the server make the remote object available to clients

A

server application creates a remote object + exports it so that it is ready to receive incoming calls

server application then asks the registry to bind a name to a remote reference - this name is made known to clients

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How does a client obtain a reference to the remote object?

A

client looks up the name in the registry

registry returns (using serialisation) a copy of the stub object

client now has a local reference to the stub object residing on the same JVM heap

17
Q

Entity classes

A

classes that represent the business entities stored persistently in the relational db

their corresponding instances are called entities

@Entity annotation to state it is an entity class

18
Q

Persistence context

A

a set of entities for which the runtime system knows where the data is in persistent storage

only when an entity is within a persistence context can any previous changes to it be made persistent

19
Q

Entity manager

A

manage an entity’s lifecycle

javax.persistence.EntityManager interface provides methods to put entities into persistent contexts

20
Q

Entity lifecycle stages (4)

A

New
Managed
Detached
Removed

new + detached outside persistent context

managed + removed inside persistent context

21
Q

Session bean

A

access + modify entities

encapsulates an interactive session of a single client with the application server

an interaction consists of clients calling the one of the bean’s methods + possibly getting a result back

a session is therefore a sequence of one or more method calls + returns between client + session bean

session beans are not persistent + are not shared among clients

22
Q

Stateless session bean

A

annotated with @Stateless

access to the db can be done be:

  1. beans’s constructor creates an entity manager
  2. each bean’s method calls the necessary entity
    manager methods to retrieve, change + store
    entities
  3. entity manager is closed when the bean is no
    longer necessary
23
Q

Dependency injection

A

an object (e.g. session bean) indicates that it depends on the existence of another object (e.g, entity manager) + the container ‘injects’ such an object into the application at runtime

24
Q

Stateful session bean

A

retain info across multiple method calls

annotated with @Stateful

typically provides:

  • one or more constructors to initialise the session
  • one or more methods to use during the conversation
  • one method to signal the end of the session
    (annotated with @Remote)
25
Q

What are the 2 types of entity manager?

A
  1. application-managed

2. container-managed

26
Q

Transfer objects

A

contain all the necessary info in their instance variables

fewer methods required + their signatures concise + fewer remote method calls have to be made

represent the clients view of data while entities represent the server’s view

suitable for data transfer between clients + session beans

if client remote transfer objects must be declared as Serializable + they are copied in method calls + returns - this means any change to the TO by the client is not reflected in the server

27
Q

Summarise the rationale for using transfer objects

A

shield entities from clients
simplify business interfaces
reduce the number of methods + calls necessary to transfer data between clients + session beans