150 likes | 518 Views
Types of Java programs. Applets Applications (fat client) Server-side (n-tiered) Embedded. Applets. What an Applet is An applet is a small java program that runs within a web page on your browser
E N D
Types of Java programs • Applets • Applications (fat client) • Server-side (n-tiered) • Embedded
Applets • What an Applet is • An applet is a small java program that runs within a web page on your browser • Unlike a traditional desktop application, an applet is severely limited as to what it can perform on your desktop • read/write files • Integrate with desktop services (e.g., e-mail) • connect to other servers • Build with security in mind • If the user allows, an applet can be given more authority
Applet Architecture Web Server Browser Web Page app.jar VM app.jar database
Pros Easily updated from one location (web server) Use java GUI APIs for rich user interface (better than HTML) World-wide distributable Better for intranet (not internet) May be portable across multiple browsers Cons May not be portable across browsers VM runs in browser Correct VM (version) must be available Depending on applet size, may not be good for "thin" connections Browser configuration issues Security issues may limit your functionality Can only access hosting web server Applets
Applications ( 2-tiered client/server ) • A "full blown" java application that runs on the desktop • Locally installed VM is executed that loads/runs locally available java classes
Applications ( 2-tiered client/server ) Local Computer database1 VM app.jar database2
Pros Full functionality Compared to applets Access to all desktop services Business logic on desktop Minimize network round trips Immediate feedback Provide very complex and rich interfaces Good choice when desktop can be controlled Cons VM and java classes must be available to desktop Upgrade issues May not be portable to all desktops VMs differ from platform to platform Large applications can "choke" a desktop Applications ( 2-tiered client/server )
Server-side Applications (n-tier architecture) • Usually web applications • N-tiered • Client - browser (thin) • Web server (talks HTTP) • Application server (business logic) • DB server (data store) • Cons: • GUI is not as rich vs Applet/Application • Pros: • App is in one place (easily upgraded) • Various client types • Can manage scalability
N-tier architecture components • “Thin” client • No business logic (or very little), why? • The less demands you make of the client, the broader audience you can reach • If you have control over the client, you can do much more
N-tier components (cont.) • Web Server • Talks http protocol to browser • Application Server • Business logic • Database Server
Web Server Other Systems Authentication Server Application Architecture [Logical] Browser Application Server Database Login choices
Application Server (app A) Application Server (app B) Application Server (app C) Web Server Application Architecture[Physical] Current Princeton Architecture Database (app A db) Database (app B db) Browser Database (app B db)
Application Server (app A) Application Server (app A) Application Server (app A) Web Server Web Server Web Server Application Architecture[Physical] Better availability. If a machine goes down, those users are gone. Database (app A db) Load Balancer Browser
App Server App Server App Server App Server App Server Application Architecture[Physical] Best Availability. Most expensive. Technically more complex DB Browser Cluster