Sisteme distribuite

Download Report

Transcript Sisteme distribuite

TOOLS FOR DESIGN AND DEVELOPMENT
ENVIRONMENTS.
Case study - ECLIPSE
Lecture notes 3
Architecture
Abstract view of the development and runtime environment for creating and deploying
plug-in contributions.
Functional building blocks of Eclipse development environment.
Eclipse Runtime Platform
The core Eclipse Runtime Platform = the most basic level of services:
•
Plug-in registry
Loading plug-ins and managing a registry of available plug-ins.
•
Resources
Managing a platform-independent view of operating system files and folders, including linked
resource locations  important foundation for representing projects, folders, and files in an IDE.
•
UI components
The Eclipse user interface components are based on SWT and JFace libraries
•
Update facility
Eclipse applications have built-in support for installing and updating plug-ins from URL addressable
locations, including remote Internet site. - assists in customizing IDE with new plug-in contributions.
•
Help facility
Common help facility shared by all plug-ins.
Basic services are implemented as plug-ins on a very small kernel.
The Eclipse design makes everything a plug-in.
Integrated Development Environment
•
Multi-platform.
The target operating systems of Eclipse 3.0 are Windows, Linux (motif and GTK), Solaris, AIX, HPUX, and Mac OSX.
•
Multi-language.
Eclipse is developed using the Java language, but it supports writing applications in Java, C/C++,
and Cobol; additional language support is being developed for Python, Perl, PHP, and others.
Plug-in contributions to Eclipse must be written in Java.
•
Multi-role.
In addition to programming activities, Eclipse supports modeling, testing, Web authoring, and many
other roles.
Integrated Development Environment
Significant features:
•
Shared views
Many Eclipse features share the use of common views for displaying and editing properties, for
listing syntax problems found in the code, and for listing work tasks.
•
Perspectives
A perspective collects a related group of views in a layout suited to particular tasks, such as Java
development, debugging, and version control.
•
Preferences
A centralized dialog gathers preference setting pages for all plug-ins installed in the workbench.
Integrated Development Environment
Significant features (continued):
•
Search engine
The platform search engine provides general capabilities for searching resources and presenting
results. This facility can be extended with resource-specific search criteria, e.g., for Java, C++,
or UML model resources.
•
Debugging
Defines a language-independent debug model and UI classes for building debuggers and launchers.
•
Ant project build files
Ant provides general-purpose, flexible build services that can be extended with specialized tasks.
The IDE includes an Ant editor and runtime configuration.
•
Team-oriented
Eclipse provides a generic API for integration with version control repositories. Complete support for
CVS is included, and plug-ins are available for other vendors' repositories.
Integrated Development Environment
Additional features in editors(not provided in a generic way by the platform):
•
Synchronized editor and outline
An outline displays a hierarchical list of constructs in the file being edited. Select an outline item to
position the editor at the corresponding location.
•
Content Assist
The editor suggests appropriate content to be inserted at the cursor location when the Ctrl+Space
key combination is pressed.
•
Templates
Code or other text patterns (such as a Java for loop or an HTML table) are defined in templates that
are inserted into a file as part of Content Assist.
•
Formatter
Syntactic formatting rules are defined and customized in preference settings and are applied to
editor selections or entire files.
•
Problems identified on-the-fly
Errors or warnings are identified while typing in the editor and are highlighted by icons and
messages in the ruler at the editor left margin.
Integrated Development Environment
Java Development Tools (JDT)
the only programming language plug-ins included with the Eclipse SDK.
UI is organized as Java development perspective.
Fundamental capabilities:
• Editor, outline, Content Assist, templates, and formatting
• Java views
Several views are provided for navigating and managing Java projects. The Package Explorer view
is the cornerstone of the Java perspective, and a specialized Java Browsing perspective assists
developers in understanding and navigating large, multi-project applications.
•
Project Configuration
Extensive support is included for configuring Java project classpaths, dependencies, libraries,
compiler options, and many other characteristics.
•
Debugger
A rich debugging environment is provided by the Java tools. You can set breakpoints, step through
execution, inspect and set variable values, and change method code during debugging.
Integrated Development Environment
C/C++ Development Tools (CDT)
•
C/C++ editor
The generic platform text editor is specialized with C/C++ syntax coloring, Content Assist, and
formatting.
•
C/C++ debugger
A default debugger implementation is provided using GDB.
•
C/C++ program launcher
Similar to launching Java programs with optional debugging, CDT provides support for launching
C/C++ programs.
•
C/C++ parser and syntax API
The parser is an essential foundation for other plug-in contributions that extend CDT.
•
Search engine
General platform search facilities are specialized with C/C++ syntax options that accurately locate
code definitions and references.
•
Makefile generator
Similar to the use of Ant in Java development, makefiles are ubiquitous in development of C/C++
projects.
Details and downloads available on the CDT Web site, www.eclipse.org/cdt/.
Integrated Development Environment
The Plug-in Development Environment (PDE)
Supplies tools that automate the creation, manipulation, debugging, and deploying of plug-ins.
Is part of the Eclipse SDK and is not a separately launched tool.
•
PDE perspective
A specialized perspective includes views and shortcuts to commands used most frequently during
plug-in development.
•
Host and Runtime workbench
The workbench that you are running as you develop your plug-in is the host workbench. After you
are happy with your plug-in and want to test it, you can launch another workbench—the runtime
workbench. This will utilize the same plug-ins as the host workbench, but it will also run the
plug-ins you were working on in the host workbench.
•
Debugging plug-ins
The Java debugger enables complete control while testing plug-ins in the runtime workbench.
•
Packaging plug-ins
Tools for packaging plug-ins and features for distribution to users via an update site are provided.
Integrated Development Environment
Web Tools Platform (WTP)
generic, extensible, and standards-based tool platform.
common foundation of frameworks and services to create offerings for J2EE and Web-centric
application development.
The Web Standard Tools - common infrastructure targeting Web-enabled applications.
Includes tools for developing three-tier applications and publishing the resulting system artifacts to
servers.
Standard languages
Support for HTML/XHMTL, XML, XML Schema, Web Services, XQueries, SQL, and other languages
used by Web-centric applications.
Editors
Editors for supported languages, including consistent features for outlines, Content Assist,
templates, and formatting.
Validators
Languages based on XML are validated against associated schemas and other semantics from the
specifications.
Server publication
Commands and views for starting, stopping, publishing, and running applications on multiple target
servers.
Integrated Development Environment
Web Tools Platform (WTP) (continued)
Details and downloads are available on the Web Tools project Web site, www.eclipse.org/webtools/.
J2EE Standard Tools -common infrastructure for developing applications based on J2EE 1.4
specifications targeting J2EE-compliant application servers.
Tools include:
J2EE artifacts
Support for EJB, Servlet, JSP, JCA, JDBC, JTA, JMS, JMX, JNDI, and Web Services.
JSP editor
Support for mixed HTML and JSP tags, including JSP tag libraries, plus outline, Content Assist,
templates, and formatting.
JSP refactoring
Java refactoring (e.g., renaming a class, method, or package) finds and refactor dependencies
within JSP pages.
Search facilities
Search criteria are aware of syntax for JSP, XML, and other document types. For example,
searching for a method name includes cases where that name is used as a method, but not
when used in other text strings.
Comparison of syntax
Comparing two JSP or XML files considers syntax while identifying logical code constructs, such as
when viewing differences between two versions of a JSP file in a repository.
Rich Client Platform
The Eclipse Rich Client Platform (RCP)
The minimal set of plug-ins needed to build a rich client application is collectively known
as the Rich Client Platform.
Although the Eclipse platform is designed to serve as an open tools platform, it is architected so that
its components could be used to build just about any client application.
Rich applications
- based on a dynamic plug-in model
- UI is built using the same toolkits and extension points
When contributing to the IDE, plug-ins are built on the platform SDK workbench. The
layout and function of the workbench is under fine-grained control of the plug-in
developer.
Alternatively, in a rich client application, developers are responsible for defining the
application's workbench presentation.
The same PDE tools are used when developing any Eclipse plug-in contributions,
including RCP applications.
Installation and Startup
At http://www.eclipse.org
-
Eclipse SDK – complete distribution
"platform runtime" - the base workbench; omits all Java development tools.
Java JDK 1.4 or later must be installed before starting Eclipse.
Categories of Eclipse downloads:
• Latest Release
Releases are builds that have been declared major releases by the development team—for
example, "R3.0". Releases are the right builds for people who want to be on a stable, tested
release and don't need the latest greatest features and improvements.
•
Stable Build
Stable builds are integration builds that have been found to be stable enough for most people to use.
They are usually based on significant project milestones. The latest stable build is appropriate
for people who want to stay up-to-date with what is going on in the latest development stream
and don't mind putting up with a few problems in order to get the latest features and bug fixes.
•
Integration Build
Periodically, component teams will reach what they believe is a stable, consistent state, and they
indicate that the next integration build should take this version of the component. Only advanced
Eclipse users should work on these builds.
•
Nightly builds
Nightly builds are produced every night from whatever has been released into the HEAD stream of
the CVS repository. They are completely untested and will almost always have major problems.
Eclipse open source project inside view of the ongoing development
Recommendation: stay with the latest release or, at lest, with a stable build.
Installation and Startup
No automated installer  Manual procedure:
-
Unpack the ZIP archive
-
 eclipse directory
 executable file named eclipse.exe (on Windows).
Optionally create a shortcut on the desktop for eclipse.exe
Recommended:
•
Run eclipse.exe and enter a workspace location such as the following:
C:\EclipseDistilled\workspace
•
Increase the amount of heap memory allocated to Eclipse;
to allocate 256MB, change your startup command (or target in your desktop icon) to read as follows:
C:\eclipse\eclipse.exe –vmargs –Xmx256M
•
Specify the Java version to be used:
add the –vm option on the Eclipse startup program and provide the JVM command path.
•
Include the current workspace path on the workbench title:
add the -showlocation option
C:\eclipse\eclipse.exe -showlocation -vm c:\j2sdk1.4.2_02\bin\javaw.exe -vmargs –Xmx256M
Java application development – basic procedure
•
Eclipse starts in the default Resource perspective.
•
Switch to the Java perspective for most development work.
•
Use the Java perspective wizards to create new projects, new packages, and new
class files.
•
Customize the code generation templates that are used to insert code into a new
Java file.
•
Run your application within the Eclipse workbench and use the Console view for
command-line input and output.
Workbench
Runtime composition of workbench components
(perspectives, views and editors)
Perspectives
Eclipse perspective defines
a selection of views
their layout within the workbench window.
Several perspectives are available, where each is configured for a particular task, such as Java
development, debugging, or browsing CVS repositories.
The initial perspective is resource perspective
the most generic
may be used to view and edit files in any kind of project.
Perspective switcher
Toolbar
View
Editor area
Fast view
Workspace
Workspace – platform-independent logical view:
mapped to the file system directly
contains resources (files and folders that represent projects and their contents).
hierarchical structure with a singleton workspace as its root, instance of the
following model:
By default: workspace hierarchy is identical to the files-folders hierarchy in the file system.
Linked resources – mapping parts of the Eclipse workspace hierarchy onto disjoint locations in the file
system
This is especially helpful when using Eclipse in combination with other products and development tools that require
specific file locations.
Workspace
An instance of Eclipse - associated with exactly one workspace.
The workspace that will be used for the current session can be selected when starting Eclipse.
In the workspace folder - a child folder named .metadata contains data about workbench
state and preferences.
Runtime errors are registered in the .log file located within the .metadata folder.
Project resources contained within different workspaces should be independent.
Independent projects may be included in the same workspace.
Common reasons for multiple workspaces include the following:



Independent work topics, possibly managed in different version control repositories (although
projects within one workspace can be associated with any number of repositories).
The need to maintain clear separation between client resources.
Two or more workspaces are used to distinguish concurrent work on maintenance branch
versions in CVS.
To create a new workspace, simply start Eclipse and enter a new location in the Workspace Launcher dialog.
Workspace
Workspace  file system synchronization:


Change inside workbench  automatic synchronization
Change directly in the file system  manual synchronization (refresh option)
Files:
created and manipulated by the user
directly accessible to the standard programs and tools of the underlying operating
system
directly accessible to the tools integrated with the Platform (provided with API for
dealing with workspace resources)
Workspace resources are represented by adaptable objects so that other parties can
extend their behavior.
Project
Project characteristics:
special entity in a workspace
carry metadata about project characteristics
contribute automatic behavior when its resources are modified
a container that groups resources into buildable, reusable units
contains source and output folders (preferably separate locations).
Specific characteristics of Java project:
record its build path in a .classpath file,
automatically configured with an incremental builder that compiles all source files
into the output folder.