Tech all over the world
Thursday, April 26, 2007
  Java Technology Fundamentals (April '07)

You are receiving this email at kiri.tech@gmail.com because you have subscribed to the Java Technology Fundamentals newsletter. To update your communications preferences, please see the links at the bottom of this message. We respect your privacy and post our privacy policy prominently on our Web site: http://www.sun.com/privacy

Please do not reply to the mailed version of the newsletter; this alias is not monitored. Feedback options are listed in the footer.


April 2007

Welcome to the Java Technology Fundamentals Newsletter.

This monthly newsletter provides a way for you to learn the basics of the Java programming language, discover new resources, and keep up-to-date on the latest additions to Sun Developer Network's New to Java Center.

Note: For the code in this issue of Fundamentals to compile, use the JDK 6 software.

In This Issue

» Basic Java Technology Programming
» Making Sense of the Java Platform Classes and Tools Annotations
» Desktop Java Platform Development
» Server-Side Java Platform Development
» The 2007 JavaOne Conference
» Free Online Training
» Java Technology Training: Instructor-Led, Self-Paced Web, CD, and Virtual Courses
» For More Information

 

  Basic Java Technology Programming

Getting Started With Your New Application Project

When you're getting ready to create an application, it's tempting to go straight to the coding phase. But if you don't think through an initial design approach, you could be stuck with a complete system redesign and a maintenance nightmare as soon as that first change request comes in. Before you begin coding, take a look at a simple application and think it through.

The application to be developed is a typical To-do list manager. The initial set of requirements are a stand-alone application that supports the entry of tasks with different priorities and due dates. The application must also be able to print a report of outstanding tasks.

This may not sound very complicated, but it is easy to imagine a user wanting support for more features:

  • A web interface. Instead of a stand-alone application, the user needs a web interface.
  • Support for multiple users. Each user can have his or her own list of tasks.
  • Ability to create reports. The user's boss wants a weekly report of the list of completed tasks.

None of these added features is that complicated on its own. But how you design the original system will have serious implications for how you will add each of the features.

For instance, when a task is completed, if the application deletes the task from the system, there is no way to generate a report of completed tasks at a later time. You can argue that just about everything in the original system can be extended. How much future-proofing do you need to do? This decision is primarily driven by available time and resources. Although disk space is relatively inexpensive, if the application is targeted to a mobile phone, saving all completed tasks might make less sense.

Moving from the theoretical to the To-do list manager, where do you start with the design? To go from design to code, it is helpful to document the usage scenarios, or use cases. For something as simple as the To-do list manager, this step might seem like overkill, but in the grand scheme of things, it helps you to understand what tasks are expected to be supported within an application. Once applications get bigger, you'll find that creating use cases help when you work with project stakeholders, who tend to think about the tasks they need to do.

Creating the use cases involves going through the requirements and documenting the tasks that need to be done. For the original requirements of the To-do list manager, the easy set of requirements are the following:

  • Create a task.
  • Mark the task as completed.
  • View the current To-do list.
  • Generate the report.

The original requirements include prioritizing tasks and ensuring that tasks have a due date, but those are really parts of creating a task. Common sense says that there should be an "update task" requirement, but that is not explicitly spelled out in the requirements. If this were a real-life project, you would need to go back to the domain expert and ask whether updating tasks is a requirement. They would probably say, "Duh, isn't that obvious?" However, it is always safest to ask to make sure you always fully understand the requirements for the system. Thus, there is one more requirement to add:

  • Edit the task.

Depending upon implementation, marking a task as completed can be done during the edit task use case. However, marking tasks as completed or edited still involves separate use cases. When everything is completed, successful implementation of the use cases involves testing both cases.

Once you feel you have all the use cases, you can start coding. However, as projects get bigger, it is helpful to formalize the use cases in documentation with additional details. Although you might write each use case on an index card, you typically combine them all into a use case diagram for system documentation. A use case diagram offers an overview of the system design involving actors, the tasks they perform (the use cases), and their relationships.

Figure 1 shows what a use case diagram might look like for the To-do list manager:

Use Case Diagram

Each use case is named with an action verb. Nowhere is there mention of how the list of tasks is displayed. For example, is a tree or table view used? Unless the display format is a hard requirement, it should not be part of a use case.

With the simple version of the To-do list manager, there is only one actor in the system, the user. Had this been designed for multiple users, the left side of the diagram might show User 1, User 2, User 3, and so on as actors. And another actor called Boss could be there as the receiver of the weekly status report. Each of these actors is external to the system and only interacts with the system. One person could be different actors in the system if that person has different roles at different times. For instance, when the boss wants to manage the To-do list, the boss becomes User N, not Boss, as far as the use case diagram is concerned.

Once the use case diagram is complete, you can jump into coding. As you go from diagram to coding, each use case presents a high-level interface that can be used by the system. Because you'll need to support each of the use cases, the high-level coding structure requires methods of the same name. Then connect the tasks with some user interface element. If you design it well, changing the user interface from a stand-alone application to something like a web interface should be easy, as the business logic should be sufficiently separated out to not be dependent on the user interface. Getting this right takes practice. Working with use case diagrams should help in getting you in the right direction.

For additional information on use cases, the Wikipedia entry http://en.wikipedia.org/wiki/Use_case includes benefits, limitations, and guidelines for writing. There are also many helpful books out on the topic and online tutorials.

  Making Sense of the Java Platform Classes and Tools Annotations

Annotations provide data about a program that is not part of the program itself. They have no direct effect on the operation of the code they annotate.

Annotations have a number of uses, among them:

  • Information for the compiler. The compiler can use annotations to detect errors or suppress warnings.
  • Compiler-time and deployment-time processing. Software tools can process annotation information to generate code, XML files, and so forth.
  • Runtime processing. Some annotations are available to be examined at runtime.

Annotations can be applied to a program's declarations of classes, fields, methods, and other program elements.

The annotation appears first, often -- by convention -- on its own line, and may include elements with named or unnamed values:

    @Author(
       name = "Benjamin Franklin",
       date = "3/27/2003"
    )
    class MyClass() { }

or

    @SuppressWarnings(value = "unchecked")
    void myMethod() { }

If there is just one element named "value," then the name may be omitted, as in the following:

    @SuppressWarnings("unchecked")
    void myMethod() { }

Also, if an annotation has no elements, the parentheses may be omitted, as in this case:

    @Override
    void mySuperMethod() { }


Read the rest of this tutorial
  Desktop Java Platform Development

UML Modeling: Creating Use Case Diagrams

This tutorial applies to NetBeans integrated development environment (IDE) 5.5 and NetBeans 5.5 UML modeling.

In this tutorial, you learn how to use the UML modeling features of the IDE to create a simple UML use case diagram. Using the use case diagram model, you show the relationship among actors and use cases within an application. The use case diagram that you create tracks various functions and people who interact with the functions within a theoretical banking application.

A use case diagram is useful when you are describing requirements for a system in the analysis, design, implementation, and documentation stages. The purpose of this tutorial is to introduce the IDE's UML modeling use case diagram, not to teach you about UML concepts or the Java programming language.

Contents

  • Creating the UML Project and the Use Case Diagram
  • Adding and Labeling Use Case Elements
  • Adding and Labeling Actor Elements
  • Linking Actor Elements to Other Actor Elements
  • Linking Actor Elements to Use Case Elements
  • Using Extend Links
Read this tutorial
  Server-Side Java Platform Development

Webinar: Simplifying Data Access Using NetBeans Visual Web Pack

Interested in learning how to simplify data access when building web applications? Are you tired of the complexity associated with data access? Join us for an hour-long webinar on Simplifying Data Access Using NetBeans Visual Web Pack and learn to do the following:

  • Rapidly build visual applications that read, display, and update databases
  • Browse and edit database schemas, data, and commands
  • Access databases using a variety of JDBC drivers
  • Import Sun Java Studio Creator 2 database applications into Visual Web Pack

Speakers: Jim Davidson, Senior Staff Engineer, Sun Microsystems, and John Baker, Staff Engineer, Sun Microsystems

Note, the presentation starts off with a few slides, but quickly goes into a screencast that shows how to use the NetBeans IDE for the topics listed above.

As of December 2006 only the Sun Java System Application Server supported Java EE 5.

This tutorial has been tailored for use with the Sun Java Application Server PE 9.0 Update Release 1 and with Tomcat 5.5.17. If you are using a different server, consult the Release Notes and FAQs for known problems and workarounds. For detailed information about the supported servers and Java EE platform, see the Release Notes.

Watch the webinar
  The 2007 JavaOne Conference

May 8-11, 2007
Moscone Center, San Francisco, California

The 2007 JavaOne conference presents a wide variety of interesting and helpful destinations for developers new to Java technologies. These destinations are either technical sessions or Birds-of-a-Feather (BOF) talks. This article highlights the top 10 destinations for the new Java technology developer, covering topics with varying levels of complexity.

Top 10 Destinations for New Java Technology Developers

   Free Online Training

Sun Developer Network members get free access to the following online courses:

  • Introduction to Developing Rich Client Applications
  • Overview of Java Application Security
  • Creating Web-Tier Applications Using Visual Development Environment
  • Overview of XML
  • Web Services Enabling Technologies
  • Web Services Infrastructure and Organizations
  • Solaris Developer Introduction to Sun Studio
  • Sun Java Identity Management: Overview
  • Sun Java Identity Management Suite: Integrated Solutions
  • Sun Java System Message Queue Platform Edition 4.0: Introduction
  • Sun Java System Application Server Platform Edition 9: Overview
Join the Sun Developer Network
   Java Technology Training

Instructor-Led, Self-Paced Web, CD, and Virtual Courses

  • Object-Oriented Analysis and Design Using UML (OO-226): This course progresses through a primer on OO technology and software development methodologies, requirements gathering and analysis (including interviewing stakeholders), system architecture and design, implementation, testing, and deployment.

  • Introduction to Developing Rich-Client Applications (WJO-1107): This course defines the concept of a Java technology rich-client application (also known as a Swing application) and describes how to use the Swing API. Students learn how to use the features of the NetBeans IDE for rapid application development. The course demonstrates how to extend the NetBeans platform to build a simple Swing application.

  • Developing Applications for the J2EE Platform (CDJ-310A): This course provides students with the knowledge to build and deploy enterprise applications that comply with Java 2 Platform, Enterprise Edition (J2EE) standards. Students are taught how to assemble an application from reusable components and how to deploy an application in the J2EE platform runtime environment.
See the course catalog
   For More Information


To comment about the content of this newsletter, send an email to fundamentals_newsletter@sun.com.

© 2007 Sun Microsystems, Inc. All rights reserved. For information on Sun's trademarks see: http://www.sun.com/suntrademarks

To unsubscribe from this list, reply to this message with "Unsubscribe" in the subject line or use this link:
http://communications1.sun.com/r/c/r?2.1.3J1.2Vd.12SMlS.C2kx7I..H.ERUY.1fx%5f.aT1raXJpLnRlY2hAZ21haWwuY29tHACHGb00

To manage your Sun subscriptions, visit the Subscription Center.

Sun Microsystems, Inc., 10 Network Circle, MPK10-209 Menlo Park, CA 94025 U.S.A.





 
Tuesday, April 24, 2007
  W3C Public Newsletter, 2007-04-23
Dear W3C Public Newsletter Subscriber,

We invite you to read the 2007-04-23 version of the
W3C Public Newsletter online:

http://www.w3.org/News/Public/pnews-20070423

For your convenience, we have attached a simplified
plain text version.

At any time you may consult the latest version of the
W3C Public Newsletter:

http://www.w3.org/News/Public/

Thank you,

Ian Jacobs, W3C Communications Team

 
Tuesday, April 17, 2007
  W3C Public Newsletter, 2007-04-09
Dear W3C Public Newsletter Subscriber,

We invite you to read the 2007-04-09 version of the
W3C Public Newsletter online:

http://www.w3.org/News/Public/pnews-20070409

For your convenience, we have attached a simplified
plain text version.

At any time you may consult the latest version of the
W3C Public Newsletter:

http://www.w3.org/News/Public/

Thank you,

Ian Jacobs, W3C Communications Team

 
  W3C Public Newsletter, 2007-04-16
Dear W3C Public Newsletter Subscriber,

We invite you to read the 2007-04-16 version of the
W3C Public Newsletter online:

http://www.w3.org/News/Public/pnews-20070416

For your convenience, we have attached a simplified
plain text version.

At any time you may consult the latest version of the
W3C Public Newsletter:

http://www.w3.org/News/Public/

Thank you,

Ian Jacobs, W3C Communications Team

 
News, Articles, events from all over the world

My Photo
Name:
Location: India

Born on shraavana shudha chauthi of dundubhi naama samvaswara, Im kiran alias kini alias kiri bought up by loving parents. Being from agricultural family I have learnt plowing, carting but never learnt climbing trees. Now away from home I have lost touch with the agricultural skills.

ARCHIVES
January 2006 / February 2006 / March 2006 / April 2006 / May 2006 / June 2006 / July 2006 / August 2006 / September 2006 / October 2006 / November 2006 / December 2006 / April 2007 / May 2007 / June 2007 / July 2007 / August 2007 / September 2007 / October 2007 / November 2007 / December 2007 / January 2008 / February 2008 / March 2008 / April 2008 / May 2008 / June 2008 / July 2008 / August 2008 / September 2008 / October 2008 / November 2008 / December 2008 / January 2009 / February 2009 / March 2009 / April 2009 /


Powered by Blogger