technologies for use on different layers. technologies client tier client tier to middle tier...

22
Technologies For use on different layers

Post on 20-Dec-2015

235 views

Category:

Documents


4 download

TRANSCRIPT

Technologies

For use on different layers

Technologies

• Client tier• Client tier to middle tier protocols• Middle tier technologies• Middle tier to data tier technologies

But first…what is a protocol?

• ‘In computing, a protocol is a convention or standard that controls or enables the connection, communication, and data transfer between two computing endpoints. In its simplest form, a protocol can be defined as the rules governing the syntax, semantics, and synchronization of communication. Protocols may be implemented by hardware, software, or a combination of the two. At the lowest level, a protocol defines the behaviour of a hardware connection.’ – www.wikipedia.org

Wikipedia.org…

• Protocols are generally used to define real-time communications behaviour. Most protocols specify one or more of the following behaviours:– Detection of the underlying physical connection (wired or

wireless), or the existence of the other endpoint or node – Handshaking – Negotiation of various connection characteristics – How to start and end a message – How to format a message – What to do with corrupted or improperly formatted messages – How to detect unexpected loss of the connection, and what to do

next – Termination of the session or connection

Client tier

• Client applications– Human to human communications:

• E-mail, instant messaging, USENET news, chat.• File transfer or file swapping.• Remote login.• Proprietary applications (e.g. a multi-user game).

– Clients hosted in a Web browser can use the following:

• HTML forms.• JavaScript.• Proprietary plug-ins (e.g. Flash).• ActiveX controls.• Java applets.

Client tier protocols

• IMAP for e-mail• AIM for instant messaging• HTTP/CGI for HTML forms• Browser Apps and plug-ins can be written

in:– Java, C++, Eiffel, Fortran, even Cobol.– Need a compiler for your chosen language

that will put the code into a DLL (MS Windows) or shared library (UNIX).

HTML

• Visually rich and widely supported.

• Forms are primitive and not automatically validated on the client.

• Not visually pleasing ( step through pages, each of which flashes white before it is drawn).

JavaScript

• Permits some programming on the client side.– E.g. data validation.

• Interpreted, so slower than compiled code.

• Not purely object-oriented.

• Different browsers provide different levels of support.

Plug-ins and ActiveX

• Plug-Ins– Can provide client interaction.– Need to be downloaded and installed.– Each one requires different programming expertise.– Must be ported by supplier to each new platform.

• ActiveX controls– These are 32-bit Windows binaries, hosted by a web

browser. They can only run on Windows.– Controls such as clocks and calendars can be added

to forms.

Java and new clients

• JAVA– Simple– Pure object-oriented language.– Prohibits access to resources on the local machine

without user authorisation.

• New clients– Mobile phones– PDAs (Personal Digital Assistant)– Most of the technologies have a version for these.

Client tier to middle tier protocols

• Communicates between the client and the server.

• Layered:– At the bottom, TCP/IP– SSL (Secure Socket Layer) which encrypts and

decrypts information for privacy and integrity (optional layer).

– Secure HTTP (HTTPS), allowing a client to request a document by URI and get back the contents of that document (e.g. Squirrelmail) (optional layer).

– JRMP (Java Remote Method Protocol) allows Remote Method Invocation (RMI), allowing an object to send a method to a remote object.

How RMI can use a networkaClient aServant

JRMP

HTTPS (Optional)

SSL (Optional)

TCP/IP

After O’Docherty, M.,’Object-Oriented Analysis and Design’, p245, Wiley, 2005

Continued…

• Commonly used protocols can be specialised and general:

• Specialised:– IMAP (e-mail)– AIM (AOL Instant Messaging)– NNTP (USENET news)– HTTP / CGI (HTML forms)– FTP (File transfer protocol)– Telnet (remote login)

• General:– TCP/IP (low level transport, also known as sockets)– JRMP (for Java-to-Java communications)– IIOP (for CORBA communications

• Like RMI, but lots of different languages.

Middle tier technologies

• This tier (layer) is reached when the user’s interaction with the system is accepted and has been passed on to a server.

• Server applications may be multi-threaded and designed for high capacity.

• A server application ‘listens’ to a port (connection point) for clients to connect.

• Applications can be stand-alone or can be run from a web-server.

Stand-alone applications

• Mail, messaging, news, chat servers.• FTP daemon

– A daemon is a type of housekeeping task, that is used by the operating system in a multitasking environment, to ensure that all tasks are properly initiated and ended.

• Telnet daemon• Naming services

– These allow clients to find the server object by name E.g.:• CORBA registry• RMI registry or • Java Naming and Directory Interface (JNDI) server ( a general

name-to-thing mapping service)

• Proprietary server (e.g. a process hosting CORBA or RMI objects, an EJB client or a .NET client).

Server code

• Hosted by a web server:– JSP (Java Server Pages) for building Web pages.

• Raw HTML interspersed with Java code.

– ASP (Active Server Pages) (VB version)– CGI scripts

• Textual files written in a command language (e.g. PERL – usually invoked by HTML)

– Servlets (Java server objects that are instantiated on demand by applets, JSPs or HTML forms).

Middle tier to data tier technologies

• To access the data tier, either:– Include database-client code on the middle tier, sot

we can access a DBMS running on the data tier (e.g. using Java and JDBC (Java Database Connectivity))

– Use same protocols as for client-to-middle tier– Use some non-TCP/IP protocol (legacy system)– Include Enterprise Java Beans (EJB) client code in

our middle-tier server and access the data tier via EJBs (see next slide)

– Include .NET code in the middle tier server. (Microsoft version of EJB)

Enterprise JavaBeans• The Enterprise JavaBeans (EJB) specification is one of the

several Java APIs in the Java Platform, Enterprise Edition.• EJB is a server-side component that encapsulates the business

logic of an application. The application server provides:– persistence – transaction processing – concurrency control – events using Java Message Service – naming and directory services (JNDI) – security – deployment of software components in an application server

• remote procedure calls using RMI-IIOP or CORBA • Additionally, the Enterprise JavaBean specification defines the roles

played by the EJB container and the EJBs as well as how to deploy the EJBs in a container.– Wikipedia.org

How they fit together

Client

preemptive

MessagingNewsMailInternet Relay ChatFile transfer toolRemote login (Telnet)Proprietary toolWeb browserHTML/CGIPlug-inApplet

DataLayer

DBMSJDBC net serverDatabase clientProprietary data serverEJB data source

Middle

Mail ServerMessaging serverInternet Relay chat serverFile transfer daemonrlogin/telnet daemonProprietary server (Corba/RMI/EJB)JNDI serverCORBA naming serviceWeb server

IMAP, AIM, NNTP, IRC, FTP, TELNET, HTTP, TCP/IP, JRMP,I...

Propretary DB protocol, JDBC net, IIOP, JRMP, TCP...

Client tierClient

preemptive

MessagingNewsMailInternet Relay ChatFile transfer toolRemote login (Telnet)Proprietary toolWeb browserHTML/CGIPlug-inApplet

Middle tierMiddle

Mail ServerMessaging serverInternet Relay chat serverFile transfer daemonrlogin/telnet daemonProprietary server (Corba/RMI/EJB)JNDI serverCORBA naming serviceWeb server

Data tierDataLayer

DBMSJDBC net serverDatabase clientProprietary data serverEJB data source