260 likes | 352 Views
Software Development Foundations, 1/12/12. J. Yates Monteith , Clemson University. Introductions. Welcome! Who am I? Why am I here? Why should you be listening to me? Syllabus Aside on cheating. Introduction to Java Introduction to Eclipse Write Programs Time. Who am I?.
E N D
Software Development Foundations, 1/12/12 J. Yates Monteith, Clemson University
Introductions • Welcome! • Who am I? • Why am I here? • Why should you be listening to me? • Syllabus • Aside on cheating. • Introduction to Java • Introduction to Eclipse • Write Programs Time
Who am I? • J. Yates Monteith, M.S. • You can call me Yates or Mr. Monteith. Either. I Don’t care. • Advisor: Dr. John McGregor • Education: • B.S. Computer Science, Manhattan College 2008 • (Go Jaspers!) • M.S. Computer Science, Clemson University 2010 • (Go Tigers!) • Ph.D. Computer Science, Clemson University 20…15? • Interests: • Music, Software Product Lines, Software Ecosystems, Software Engineering, Writing Code. • Favorite Languages: C++, PHP, Java. In that order.
Why Should You Listen To Me? • Past Experience • CPSC 111 Teaching Assistant (2008) – 3 Sections • CPSC 120 Teaching Assistant (2009) – 3 Sections • CPSC 215 Teaching Assistant (2010) – 2 Sections • CPSC 215 Guest Lecturer (2010) – 2 Lectures • CPSC 215 Guest Lecturer (2011) – 2 Lectures • CPSC 372 Substitute (2009-2011) • CPSC 871 Substitute (2011) • CPSC 875 Substitute (2010-2011)
More on Me… • So I’ve got a little bit of experience. • If you want more info, check my C.V. and Resume on my website.
Syllabus • http://www.cs.clemson.edu/~jymonte/docs/cpsc215s12/syllabus.pdf
About This Course… • Software Engineering • Software Development is just a small part of Software Engineering. • We will be learning the principles and activities that lead to good software development. • Class and Module Design • Design Patterns for reusable functionality • Testing • Cross Language
More about this course… • Java is the The Language. • No other substitutes allowed. • Why? • Java is great for a wide range of development projects and topics. • Has a thriving tools community that develops tools and super tools to make certain activities much easier (re: testing). • Java is Object Oriented with less attention to detail than C++. • Also, Java Runtime, Virtual Machine-platform independence, etc…
So what about Java? • Released in 1995 by Sun, developed by James Gosling. • Now owned by Oracle • General Purpose language focused on OO programming. • General Purpose in that it can do anything any other language can do. Why Java then? • Often described as: Simple, OO, Distributed, Multithreaded, Dynamic, Portable, Architecture Neutral, Robust, Secure, etc… • Highly portable because of Byte Code, the JVM and the Java Runtime Library…
Byte Code and the JVM • The JVM is the Java Virtual Machine. • It’s a virtual machine in which Java Code is executed. • Developed by Sun, it is multi-platform, multi-architecture. Anything can run it. • Java utilizes this through compiling to Java Byte Code. • In C/C++, we compile down to assembly code which is highly architecture dependent. • The assembler then translates the assembly code to machine code, which is even more architecture dependent. • In Java, we compile down to Java Byte code which is then interpreted by the Java Virtual Machine.
Byte Code and the JVM • Why is this a great idea? • What do we gain from this? • What do we lose from this? Cited from [1]
Byte Code and the JVM • Why is this a great idea? • It means that we only need to write a Virtual Machine for all targeted architectures, instead of a translator that takes Byte Code to machine code for each processor architecture and type • What do we gain from this? • What do we lose from this?
Byte Code and the JVM • Why is this a great idea? • It means that we only need to write a Virtual Machine for all targeted architectures, instead of a translator that takes Byte Code to machine code for each processor architecture and type • What do we gain from this? • Portability! Duh. We can run a Java program with very little setup on any computer that can run the JVM. • What do we lose from this?
Byte Code and the JVM • Why is this a great idea? • It means that we only need to write a Virtual Machine for all targeted architectures, instead of a translator that takes Byte Code to machine code for each processor architecture and type • What do we gain from this? • Portability! Duh. We can run a Java program with very little setup on any computer that can run the JVM. • What do we lose from this? • Performance. Because optimization relies heavily on architecture specific features, and the JVM is architecture-neutral, we cannot exploit those features for better performance.
The Java Runtime • Computer Science eschews reinventing the wheel. • Think libraries: stdio.h, stdlib.h, STL Library, etc… • Java does the same thing, but bigger and better. • The Java Runtime Library. • Large and Robust set of libraries for doing just about anything you want to do in Java. • No more writing Linked Lists. • Common to all JVM installations. Guaranteed portable between same versions.
Syntax • Much like C/C++ syntax: • Semicolon after every line. • All basic control statements (if, if-else, for, while, do while, switch). • All basic data types (int, char, float, double, bool) • Bracket Block Structuring • Comments • // Single line comments • /* Multi-line comments */ • /** Documentation comments */
Semantics • Slightly different semantics with respect to… • Pass by value and pass by reference • Inheritance and Generics • Templating • And more stuff… • But we’ll get to that stuff later… For now: Eclipse.
Introduction to Eclipse and IDEs • What is an IDE? • Integrated Development Environment. Text (usually) editing application with built in functionality specifically for programming, usually focusing on a specific language. • Better than command-line / text-pad programming. • Akin to the difference between cooking with electricity and cooking without electricity. (Think Eggbeaters). • Will make life easier, will make programming easier.
What is Eclipse? • Eclipse is a plug-in based IDE managed by the Eclipse Foundation. • Provides robust set of tools for programming (primarily) in Java. Includes code highlighting, organization, completion, refactoring. • Plug-in architecture allows users to create their own tools to extend functionality. Includes testing, profiling, modeling and more. • Free. Open Source. State of the art. • I do not require that you use Eclipse; however, I do require that all assignments be submitted as exported Eclipse projects.
More on Eclipse • Platform independent • Because it is written in Java! • Can be obtained here: www.eclipse.org • Note on Windows: Requires no installation. Completely registry independent. Can drag-and-drop between different installations of same-versioned Windows.
Lets write Hello World! • Time to go to Eclipse…
Discussion • Every application is encapsulated in a class. That class must contain a main function. • That function must be implemented by public static void main(String[] args) • Public – It is a public function of the class. Anybody with access to the class can call it. • Static – Exists only as a single function across all scopes that have access to it. • Void – Java does not explicitly pass a return value from main(). • (String[] args) – Array of Strings containing command line arguments. Why no argc?
Homework • Over the weekend, install Java, install Eclipse and write Hello World. • No turn in necessary.
References • [1] Java Tutorials. http://docs.oracle.com/javase/tutorial/getStarted/intro/definition.html