300 likes | 407 Views
Welcome to Advanced programming. Spring 2011 Introduction. Instructor. Atif Aftab Ahmed Jilani Email: atif.jilani@nu.edu.pk URL: www.atifjilani.web.officelive.com Group: http://groups.yahoo.com/group/Advanced_Prog_Spring11 Office: Room (215-F 2 nd Floor Computer Science Block)
E N D
Welcome to Advanced programming Spring 2011 Introduction
Instructor • Atif Aftab Ahmed Jilani • Email: atif.jilani@nu.edu.pk • URL: www.atifjilani.web.officelive.com • Group:http://groups.yahoo.com/group/Advanced_Prog_Spring11 • Office: Room (215-F 2nd Floor Computer Science Block) • Office Ext: 325 Office Hours: Displayed outside my office. Don’t visit other than these hours without a prior appointment, through email
Overview of Course Goal is to give students a roadmap and make it easier for them to learn the details on their own • If you work hard, you will know the basics of a lot of different technologies and libraries • You will understand when they are used and the relative strengths and weaknesses The course will help to utilize the incredible power of component oriented, Network Centric and distributed computing of JAVAJ2SE and J2EE to create effective, scalable, maintainable, and adaptable applications to solve an extremely wide range of problems.
Course is really 3 mini-courses Advanced (Client-Side) Functionality • Functionality that is useful even in single-process applications • Covers Objects, Classes, Streams, Collections, reflection, serialization, and beans. An Introduction to Distributed Computing • Builds on first part of course (especially streams, reflection and serialization) • Covers threads, sockets, and RMI
Course is really 3 mini-courses Intro to Client-Server Frameworks • Redoes the RMI examples using a variety of different server APIs • Uses RMI (the “java” way to do distributed programming) as a source of intuition • JDBC, XML, Servlets, Java Server Pages JSPs, Java Server Faces JSF, Enterprise Beans etc
Target Student Comfortable with Java • Has built, or could build, a single-user application Wants an overview of recent developments Wants an overview of client-server programming in Java Seeking for good carrier as a Sun Certified Java Developer
Lecture Format Start with Q & A Main Lecture • No any short break in the middle This is not entirely a lecture course • There are in-class labs
Outside of Class Download code and lecture materials from the margalla course folder Walk through examples and browse Javasoft documentation (2 to 3 hours) Do homework (some number of hours)
Feel welcome • …with stupid questions • …to help your peers with new bright ideas. • (never share syntax though) • …to have fun and explore
Cheating vs. Helping • Read the “Code of honor”. • Dare to talk with your peers. • Share ideas, not code/syntax. • Mention it in the report. • Don’t get stuck for too long. • This is a high pace course. • Don’t sit at home. Get up early and join your peers on campus. • Don’t cheat. • There are two kinds of people. Those who listen, and those who should listen.
What is Java? • New and Effective OOP language • Run-time Environment (tools, class library, documentation) • Compiled for speed • Interpreted • Portable (architectural-neutral via JVM) • Directly supported by major OS’s • Apple, Linux, HP, Hitachi, IBM, Windows, Novell, Silicon Graphics, Sun, Tandem
What Can Java Do? • Two types of Java Programs • Applets • run within a Java-enabled browser • Applications • a standalone program that runs directly on the Java platform, examples • servers • servlet
Java Platform Features • The essentials: Objects, strings, threads, numbers, input and output, data structures, system properties, date and time, and so on • Applets: The set of conventions used by applets. • Networking: URLs, TCP (Transmission Control Protocol), UDP (User Datagram Protocol) sockets, and IP (Internet Protocol) addresses. • Internationalization: Programs can automatically adapt to specific locales and be displayed in the appropriate language.
Security: Both low level and high level, including electronic signatures, public and private key management, access control, and certificates. • Software components: Known as JavaBeansTM, can plug into existing component architectures. • Object serialization: Allows lightweight persistence and communication via Remote Method Invocation (RMI). • Java Database Connectivity (JDBCTM): Provides uniform access to a wide range of relational databases.
Object Oriented Benefits • Better software design • different way of thinking about software • software can more closely models real world problem being addressed • domain experts can more easily participate in initial software design • Easier to maintain • changes are more localized • Easier to extend • easy to make extensions to existing functionality • Less code to write
Features Important for Internet Language • Secure • Portable • sizes of primitive data types are the same in all implementations • don’t have to recompile to run on another platform • Fast • Simple to release
Features Important to Developer • Object-Oriented (benefits discussed earlier) • Productive • fewer compiles are needed than with C/C++ • faster development cycle since linking is not required • Familiar • syntax resembles C and C++ • Garbage collection • avoids memory leaks (failing to free memory that will no longer be used) • avoids accessing freed memory • Extensible
Aspects of C/C++ Improved in Java • Time consuming links • Confusing features • multiple inheritance, operator overloading, templates • Dangerous features • unsafe casts between unrelated types(Now controlled through generics) • array access w/o bounds checking • lack of memory management (garbage collection) • Non-OO features
Reasons to Select Java • Web-based applications • common interface to applications/data inside and outside company • Portability • even for non-web-based applications • applications will run on all major platforms • Distributed Applications • RMI is easier and less expensive than CORBA but lacks services • Networking • supports TCP and UDP sockets • can access remote data using a variety of protocols
Reasons to Select Java (Contd.) • Multithreading • can utilize multiple processors • more natural style of coding for some applications • Object-oriented • encourages better software design • easier to maintain, extend and reuse • Garbage collection • software is less prone to errors • Productivity • fewer source files need to be compiled when changes are made • eliminates time to repeatedly link executables during development
Examples of Java’s Versatility • Standalone Application: TicTacToe • Applet: TicTacToe • Servlets: SelfTest Web site • Mobile Computing: Cell phones
JDK Editions • Java Standard Edition (J2SE) • J2SE can be used to develop client-side standalone applications or applets. • Java Enterprise Edition (J2EE) • J2EE can be used to develop server-side applications such as Java servlets and Java ServerPages. • Java Micro Edition (J2ME). • J2ME can be used to develop applications for mobile devices such as cell phones.
Java IDE Tools • Borland JBuilder • NetBeans Open Source by Sun • Sun ONE Studio by Sun MicroSystems • Eclipse Open Source by IBM • And so on…