Page 1 – Autumn 2009Steffen Vissing Andersen SDJ I1, Autumn 2009 Agenda: Java API Documentation Code Documenting (in javadoc format) Debugging.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

Page 1 – Spring 2010Steffen Vissing Andersen Software Development with UML and Java 2 SDJ I2, Spring 2010 Agenda – week 7, 2010 • Pakages • Looking back.
CompSci 427jd.1 Javadoc. CompSci 427jd.2 Javadoc The Plan  What is Javadoc?  Writing Javadoc comments  Using the Javadoc tool  Practice.
Utilities (Part 3) Implementing static features 1.
More sophisticated behaviour Using library classes to implement some more advanced functionality.
16-Jun-15 javadoc. 2 Javadoc placement javadoc comments begin with /** and end with */ In a javadoc comment, a * at the beginning of the line is not part.
Object-Oriented Enterprise Application Development Javadoc Last Updated: 06/30/2001.
More sophisticated behavior Using library classes to implement some more advanced functionality 4.0.
26-Jun-15 Methods. About methods A method is a named group of declarations and statements If a method is in the same class, you execute those declarations.
1 Doc Comment Conventions. 2 Write for your audience Rule 32: Write documentation for– those who must use your code Users should not need to care how.
More sophisticated behavior Using library classes to implement some more advanced functionality 3.0.
Concordia University Department of Computer Science and Software Engineering Click to edit Master title style ADVANCED PROGRAMING PRACTICES API documentation.
1 Documenting with Javadoc CS 3331 Fall 2009 How to Write Doc Comments for the Javadoc TM Tool available from java.sun.com.
3.1 Documentation & Java Language Elements Purpose of documentation Assist the programmer with developing the program Assist other programers who.
Prepared by Uzma Hashmi Instructor Information Uzma Hashmi Office: B# 7/ R# address: Group Addresses Post message:
1 Web Based Programming Section 6 James King 12 August 2003.
Java 程序设计 Java Programming Fall, Contents for Today Java Program Structure  How to Compile a Java Program  How to Run a Java Program Environment.
Javadoc. The Plan ● What is Javadoc? ● Writing Javadoc comments ● Using the Javadoc tool ● Demo ● Practice.
Writing JavaDocs Mimi Opkins CECS 274 Copyright (c) Pearson All rights reserved.
Copyright © Curt Hill Java Looking at our first console application in Eclipse.
Program documentation using the Javadoc tool 1 Program documentation Using the Javadoc tool.
Introduction to Eclipse CSC 216 Lecture 3 Ed Gehringer Using (with permission) slides developed by— Dwight Deugo Nesa Matic
1 Documenting with Javadoc. 2 Motivation  Why document programs? To make it easy to understand, e.g., for reuse and maintenance  What to document? Interface:
Question of the Day  On a game show you’re given the choice of three doors: Behind one door is a car; behind the others, goats. After you pick a door,
Welcome To Eclipse. Basic Concepts Workspace – directory where your projects are stored –Projects grouping of related works –Resources generic term to.
INTERFACES More OO Concepts. Interface Topics Using an interface Interface details –syntax –restrictions Create your own interface Remember polymorphism.
Documentation and Programming Style Appendix A © 2015 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Javadoc Comments.  Java API has a documentation tool called javadoc  The javadoc tool is used on the source code embedded with javadoc-style comments.
Software Documentation Section 5.5 ALBING’s Section JIA’s Appendix B JIA’s.
Eclipse Basics Create projects Debug Import/Export: s/import_export/
Documentation javadoc. Documentation not a programmer's first love lives in a separate file somewhere usually a deliverable on the schedule often not.
Javadoc A very short tutorial. What is it A program that automatically generates documentation of your Java classes in a standard format For each X.java.
Documentation Dr. Andrew Wallace PhD BEng(hons) EurIng
CSC 212 – Data Structures Prof. Matthew Hertz WTC 207D /
Javadoc Dwight Deugo Nesa Matic
JavaDoc and Contracts Spring Documenting Contracts with JavaDoc Contract model for methods Preconditions Postconditions JavaDoc Industry standard.
Eclipse. An IDE is an Integrated Development Environment Different IDEs meet different needs BlueJ, DrJava are designed as teaching tools Emphasis is.
Javadoc. Purpose of javadoc javadoc is a program that reads your Java program and produces great-looking documentation in HTML format Without any help,
Javadoc. Purpose of javadoc  javadoc is a program that reads your Java program and produces great-looking documentation in HTML format  Without any.
Georgia Institute of Technology Creating Classes part 4 Barb Ericson Georgia Institute of Technology May 2006.
CreatingClasses-SlideShow-part41 Creating Classes part 4 Barb Ericson Georgia Institute of Technology Dec 2009.
A brief introduction to javadoc and doxygen. What’s in a program file? 1. Comments 2. Code.
Java Doc Guideline R.SANTHANA GOPALAN. Java Doc Guideline Audience Internal Developers PQA - who write test plans PPT – who write the documentation Customers.
1 Documenting with Javadoc CS 3331 Section and Appendix B of [Jia03] How to Write Doc Comments for the Javadoc TM Tool available from
Documentation Javadocs. Design/Documentation An essential ingredient of good Object Oriented programming is known as design by contract. This means that.
Intro to. Contents These slides describe how one can obtain (download) and use eclipse to build, run, and debug basic Java programs.
CompSci 427jd.1 Javadoc. CompSci 427jd.2 Javadoc The Plan  What is Javadoc?  Writing Javadoc comments  Using the Javadoc tool  Practice.
Eclipse Basics Create projects Debug Import/Export: s/import_export/
Chapter 2 Wrap Up 2/18/16 & 2/22/16. Topics Review for Exam I DecimalFormat More Style Conventions Debugging using eclipse The Java API.
C. Thomas Wu An Intro O-O Java Programming javadoc Utility.
Winter 2006CISC121 - Prof. McLeod1 Stuff We had better discuss a midterm date… –27 Feb. to 3 March or –6 to 10 March.
1 Documenting with Javadoc How to Write Doc Comments for the Javadoc TM Tool available from java.sun.com.
Today Javadoc. Packages and static import. Viewing API source code. Upcoming Topics: –protected access modifier –Using the debugger in Eclipse –JUnit testing.
Java IDE Dwight Deugo Nesa Matic
Variable Scope & Lifetime
Advanced Programing practices
More Sophisticated Behavior
Software Development Handing Errors and Creating Documentation
JavaDoc CECS277 Mimi Opkins.
More sophisticated behavior
Introduction to javadoc
Some Tips for Using Eclipse
Decisions, repetition, Code Snippets, Comments, and Intellisense
Fall 2018 CISC124 12/1/2018 CISC124 Note that the next assignment, on encapsulation, is due next Wednesday at 7pm – not Friday. The next Quiz is not until.
DEBUGGING JAVA PROGRAMS USING ECLIPSE DEBUGGER
Documentation Comments in C#.
JavaDoc and Contracts Fall 2008.
Advanced Programing practices
Introduction to javadoc
Java Looking at our first console application in Eclipse
Presentation transcript:

Page 1 – Autumn 2009Steffen Vissing Andersen SDJ I1, Autumn 2009 Agenda: Java API Documentation Code Documenting (in javadoc format) Debugging

Page 2 – Autumn 2009Steffen Vissing Andersen Online Help

Page 3 – Autumn 2009Steffen Vissing Andersen Help (documentation for classes and methods) Purpose: Want to see documentation for the class String

Page 4 – Autumn 2009Steffen Vissing Andersen Help (SHIFT + F1) SHIFT + F1  Click on String Open the javadoc help: Rightclick  "Open in Help Contents"

Page 5 – Autumn 2009Steffen Vissing Andersen Javadoc-Help (for class String) This workspace is setup to get online help Note: Following the video about Eclipse workspace on "HowToInstall SDJSoftware" (Tools menu in the SDJ folder) The help will be local instead of online

Page 6 – Autumn 2009Steffen Vissing Andersen Javadoc-Help for String (Method summary)

Page 7 – Autumn 2009Steffen Vissing Andersen Javadoc-Help for String (Method details)

Page 8 – Autumn 2009Steffen Vissing Andersen Documenting the code – javadoc Your own classes should be documented the same way library classes are Other people should be able to use your class without reading the implementation Make your class a 'library class'!

Page 9 – Autumn 2009Steffen Vissing Andersen javadoc for a class Documentation for a class should include: the class name a comment describing the overall purpose and characteristics of the class a version number the authors’ names documentation for each constructor and each method

Page 10 – Autumn 2009Steffen Vissing Andersen Javadoc for a method The documentation for each constructor and methods should include: the name of the method the return type the parameter names and types a description of the purpose and function of the method a description of each parameter a description of the value returned

Page 11 – Autumn 2009Steffen Vissing Andersen javadoc comments /** * A Student class representing a student Steffen Vissing Andersen 1.0, 30/11/2008, */ public class Student extends Person { private int studentNumber; /** * Three-argument constructor address the address name the name number the student number */ public Student(String address, String name, int number) { super(address, name); this.studentNumber = studentNumber; }

Page 12 – Autumn 2009Steffen Vissing Andersen javadoc comments /** the studentNumber */ public int getStudentNumber() { return studentNumber; } /** studentNumber the student number to set */ public void setStudentNumber(int studentNumber) { this.studentNumber = studentNumber; } }

Page 13 – Autumn 2009Steffen Vissing Andersen javadoc comments

Page 14 – Autumn 2009Steffen Vissing Andersen javadoc comments

Page 15 – Autumn 2009Steffen Vissing Andersen Some javadoc comments Between /** and */ is a javadoc comment and will not be part of your program javadoc comments uses a number of tags, The name of the The version of the Description of parameters for a Description of what is returned from a Description of the exceptions thrown by the A reference to something else Find more tags in the documentation The javadoc comments will be extracted of the javadoc tool

Page 16 – Autumn 2009Steffen Vissing Andersen How to generate javadoc files 1.Write your javadoc comments in the code 2.Generate javadoc files from the Project menu in Eclipse Use javadoc.exe file Select project or files This is the location of the javadoc files the startup file is called index.html

Page 17 – Autumn 2009Steffen Vissing Andersen Debugging Debugging can be performed Using the build-in Debugger in Eclipse Inserting print statements before and after statements that we want to inspect

Page 18 – Autumn 2009Steffen Vissing Andersen The build-in Debugger 2. step: Debug: SHIFT + F11 (or Run menu) Note: You may answer yes in a confirm box 1.step: Insert "Break points": doubbleclick...

Page 19 – Autumn 2009Steffen Vissing Andersen Debugging our solution You are here in the code: The Debug Perspective opens The variables

Page 20 – Autumn 2009Steffen Vissing Andersen Debugging our solution You can 1)step into 2)step over Next statement If this is from the API then step over. If it is a method or something you want to inspect then step into

Page 21 – Autumn 2009Steffen Vissing Andersen Debugging our solution Next statement This is from the API then step over step over

Page 22 – Autumn 2009Steffen Vissing Andersen Debugging our solution Next statement This is our own work (here the constructor), and we want to inspect this step into

Page 23 – Autumn 2009Steffen Vissing Andersen Code Documentation (API documentation) You have to present a subject to the class. Subject: Java API Documentation. Why use online help? How can you get an overview of the lots and lots of classes and methods in the API? How can you see which methods are available for a specific class in the API? How can you access the details of a class and a method from the API? Take at least one example of a class in the API and explain what you can see in the API documentation Explain why it is a good idea to use the API documentation Show how you think the praxis of using the API documentation should be incorporated in your use of Java and Eclipse – and how you think your fellow student should use the API documentation

Page 24 – Autumn 2009Steffen Vissing Andersen Code Documentation (javadoc) You have to present a subject to the class. Subject: Code Documentation in javadoc Why should you use javadoc for your code documentation? How can you generate a javadoc Documentation for your programs? How should you make comments in the source code? Explain why it is a good idea to use the API documentation Show how you think the praxis of making code documentation should be – and how you think your fellow student should make this (as easy as possible)

Page 25 – Autumn 2009Steffen Vissing Andersen Debugging You have to present a subject to the class. Subject: Debugging by hand, by use of print statements and using the build-in debugger in Eclipse Why should you debug some of your programs? What can you do if your code turn out not to do what it should do? How can you look for logical errors (bugs)? How can you debug a code snippet by hand? How can you debug a code snippet using print statements? Explain why it is a good idea to have some kind of strategy to look for bugs Show how to use the build-in debugger in Eclipse Where should you insert break points? Show how you think the praxis of identifying bugs could be – and how you think your fellow student should do this (as easy as possible)