Distributed Applications The NetBeans IDE

kaputmaltwormΛογισμικό & κατασκευή λογ/κού

15 Αυγ 2012 (πριν από 4 χρόνια και 10 μήνες)

376 εμφανίσεις

Distributed applications DAT075
CHALMERS
Distributed Applications
The NetBeans IDE
Joachim von Hacht
2
Distributed applications DAT075
CHALMERS
NetBeans

An Integrated Development Environment (IDE)
supporting many different types of applications

Standalone, Web, Enterprise, Web services, Mobil
apps, ...

Targeted at Java but other platforms possible

Example: Ruby on Rails

Many languages

Java, C/C++, Python, Ruby, PHP, Groovy, JavaFX...

A
framework
, new plugins contributed at fast rate.
Joachim von Hacht
3
Distributed applications DAT075
CHALMERS
Free and Open Source

Free and Open Source!

Time for a applause...

Downloads, tutorials, ... at

http://www.netbeans.org/


Have installed at least 20 times has always worked!

Robust: Have never lost anything...

Written in Java

Runs on Windows, Mac, Linus and Solaris
Joachim von Hacht
4
Distributed applications DAT075
CHALMERS
Using NetBeans

NetBeans is the only development tool needed
in course

A highly sophisticated tool and thus...
...
you need to spend some time to learn it!

A couple of days to get going!

Please!....visit the labs if in trouble

Will save you valuable time!

ALSO: There are some quirks!
Joachim von Hacht
5
Distributed applications DAT075
CHALMERS
About Tools

Why learn a tool?

This is no general knowledge...? Or?

If working in this kind of software business
you're probably going to use a tool

Visual Studio, Eclipse, NetBeans, IntelliJ, JBuilder,
Studio Creator, Delphi, ....

One learned...

Others are similar

Know, what to look for
Joachim von Hacht
6
Distributed applications DAT075
CHALMERS
Netbeans config data

First start of NetBeans will create...
(will take some time)

~/.netbeans/6.5.1/

Hidden dir in home dir, config info

Also holds config data for Apache Tomcat server

~/.personalDomain/personalDomain

Hidden dir for GlassFish V2 (application server)

Other dir's/files

.netbeans-derby, .netbeans-
registration, .asadminpass, .asadmintruststore

Always possible to remove all the above to get
a fresh installation
Joachim von Hacht
7
Distributed applications DAT075
CHALMERS
Projects

We always work in projects (NetBeans will
create a project)

A Project uses a project directory (use
suffix .nbp (netbeans project) i.e. myproj.nbp)

Project has (default) same name as the dir

Project dir contains

Netbeans config files; build instructions, library
inclusions,dependencies,...

Source code, test code

Application config files

Possible other files, XML, XHTML, Javascript, CSS,...
Joachim von Hacht
8
Distributed applications DAT075
CHALMERS
Projects (cont.)

The project directory has a fixed (sub) directory
layout

Aka “the development environment”
Joachim von Hacht
9
Distributed applications DAT075
CHALMERS
Standalone applications
myproj.nbp (proj dir)

|--- build (used by NB during buildprocess)

|--- dist (final jar file, myproj.nbp.jar)

|--- nbproject (used by NetBean)

|--- src (your source code i.e. Java files)

|--- test (test code)

|--- build.xml (ant build file)

|--- manifest.mf (used in jar file)
Joachim von Hacht
10
Distributed applications DAT075
CHALMERS
Web applications
(more later...)
myproj.nbp

|--- (as standalone)

|--- web (for HTML, JS, CSS, ...)

|--- META-INF

|--- context.xml

|--- WEB-INF

|--- web.xml

|---- build.xml (build file)

Joachim von Hacht
11
Distributed applications DAT075
CHALMERS
Project view, Project tab

Projects tab

Many dirs and files
handled by NetBeans
don't need to see

NetBeans provides a
“logical view” of the
project, the
components and files
we normally need.

Joachim von Hacht
12
Distributed applications DAT075
CHALMERS
Project views, Files tab

Files tab

View everything in
project (files and dirs)

Joachim von Hacht
13
Distributed applications DAT075
CHALMERS
Centralized services handling

NetBeans can act as a central for managing
services

Servers, start/stop/inspect, ...

Databases start/stop, execute database operations
(SQL)

Web services

Testing webservices

Joachim von Hacht
14
Distributed applications DAT075
CHALMERS
Project views, Services tab

Services tab

Joachim von Hacht
15
Distributed applications DAT075
CHALMERS
Wizards and templates

When building an application

Use the application type wizard to get a runnable
skeleton for that specific type

File > New Project

Add files etc

Mark insertion point (CAREFUL)

Right click > New ...
Joachim von Hacht
16
Distributed applications DAT075
CHALMERS
Refactoring

Changing

Locations (packages)

Names

....

Always from inside NetBeans

Working in file system simultaneously can cause
problems
Joachim von Hacht
17
Distributed applications DAT075
CHALMERS
Multiple projects and more...

Multiple projects possible

Subversion and other support

...much, much more

Inspect Tools > Plugins
Joachim von Hacht
18
Distributed applications DAT075
CHALMERS
Netbeans Live

Quick live demo
Joachim von Hacht
19
Distributed applications DAT075
CHALMERS
Problems

Problems (are rare) possible solved by editing a
files in /nbproject dir.

Consult assistants!

Possible serious problem

If nbproject/build-impl.xml trashed....

...nearly impossible to restore by hand,

Always possible to recreate a project if you
have the sources