Apex T. G. India Pvt. Ltd Introduction To Java
Jan 23, 2015
Apex T. G. India Pvt. Ltd
Introduction To Java
Birth
• December, 1990• 13 people to find next wave of computing• Convergence of media next big wave• Oak: a video on demand receiver toolkit• *7: failed video on demand appliance• WebRunner: failed Oak Mosiac clone
– First browser to run Applets
Early ChildhoodEarly Childhood
• April, 1995• Java: Front page news of San Jose Mercury• Netscape announces Java embedded browsers• Java released to the masses• 10,000 downloads in the first few months• 2,000 emails a day within weeks• Total bandwidth for Java site twice that of Sun’s
main site
Teenage Years
• Java growth stabilizes• IBM gives keynote speech
– Introduces term “e-business”– Names Java as standard “e-business”
platform• 90% of online transaction happen with
the help of Java within a year.• Java growth explodes again• Java tried on embedded devices again
Early Twenties
• 66 Java Technologies• 50 + Java Technologies in development• Open Architecture license
– Free usage– Intellectual property free
• Community Development process– No company control over Java
Java vs. JavaScript
• Java is NOT JavaScript• Java is:
– Programming language– Server sided – client never sees it– Cannot change the state of an HTML
page• JavaScript is:
– Scripting language– Client sided – server never touches it– Can change the state of an HTML page
What is Java?
• Programming Language• Platform independent
– Write for one operating system– Run on another
• Write once, run anywhere• Java Virtual Machine (JVM)
– Runs Java programs
How do they do that?
• Two step compile• First Compile
– Done by the programmer– Platform neutral
• Second Compile– Done by the JVM (Java Virtual Machine)– Platform specific– User doesn’t do anything special– Doesn’t affect original file
Java Advantages
• Cost• Architecture• Portability• Reusability
Advantage: Cost
• Buying programming software is expensive
• Java is free– Regardless of total number of users
• Free tools– Editors– Enterprise Servers
• Free tools + free language = more free tools
Advantage: Architecture
• Java distributed for free• Community board administered
– No company can “own” Java• Every day users can contribute:
– Idea– Code– Bug-fixes
• Your in control
Advantage: Portability
• Java is platform independent– Compiled programs run on any system
• Compiled files can be compressed• Compressed files known as Jar files• Jar files executable
– Without uncompressing
Advantage: Reusability
• Reusability is using past code in current problems– Not necessarily your code
• Some one has done your work• Use other’s work• Big time saver
Enterprise (J2EE) Technologies
• JDBC• Java Servlet• Java Server Pages (JSPs)• Frameworks(Struts,Hibernate,Spri
ng)• Enterprise JavaBeans (EJBs)• Java Messaging Server (JMS)
JDBC
• Data Access Interface• Access many data sources
– Database access– Spreadsheets– Flat Files
• Performs common task like– Connection pooling– Batch updates– Transaction management
Java Servlet
• Server Side programming• Extends current web server functionality• Server and Platform independent• Similar to CGI scripting• Access to all Java Technologies• Focused on content generation
– Programmers don’t have to worry about design
Java Server Pages (JSPs)
• Embedded in HTML pages• Creates dynamic content• Server Sided• Focused on content presentation
– Designers don’t worry about programming
• Looks like regular HTML of XML– Markup tag based
Frameworks
• Java provide some framework technology that follow MVC-design pattern for programming.
• It provides Independency , Reusability, Security to web application.
• Struts , Hibernate, Spring are the frameworks technologies of java.
Enterprise JavaBeans (EJBs)
• Focused on– Customizable– Reusable
• Interface with data sources– Databases– Existing Enterprise Information Systems
(Banner)• Write once, run anywhere
Enterprise Java Beans (EJBs)
• Distributed Client/Server Model• Code executed on server
– Closer to the data– More powerful machine then client
• Code localized to server– Changing server code doesn’t cause
change in client code
Java Messaging Service (JMS)
• Communication between components• Two styles of communication
– Point-to-point messaging• Like Email
– Publish/Subscribe• Like Email Lists
Java Messaging Service (JMS)
• Synchronous– Sent once, not guaranteed to reach
server– Lost if not received
• Asynchronous– Sent until it is acknowledged– Queued until message is retrieved
Example Enterprise Application
Insert DataSubmit Link
LinksDB
LinksServlet
Check data
Error PageErrorJSP
Formats Error
Insert
JDBCApp
Construct Insert
Error Message
Example Enterprise Application
Get Classes ClassesServlet
ClassesEJB
Get ClassesEIS
(Banner)
Get Classes
Return ClassesReturn Classes
Format List
Class ListJSP
No NoticesClass List
LibraryJMS
Check Notices
Who should use Java?
• People who:– Program Enterprise systems– Interact with environments out of their
control– Want maximum flexibility– Maintain large websites
Who shouldn’t use Java?
• People who:– Maintain small website– Don’t interact external sites or systems– Looking for a quick and dirty solution
Thanks
facebook.com/apex.tgi
twitter.com/ApextgiNoida
pinterest.com/apextgi