CLICK TO ADD MAIN TITLE

Download Report

Transcript CLICK TO ADD MAIN TITLE

Developing Blackboard
Building Blocks: Getting
Started
John Knight
Senior Engineer
Blackboard Inc.
July 18th
© Blackboard, Inc. All rights reserved.
Overview
»
»
»
»
Goals
Blackboard® Building Blocks® Technology
Java/JSP Development Tools
Blackboard Building Block Development – Tools and
Techniques
Now a word from our lawyers…
»Any
statements in this presentation about future
expectations, plans and prospects for Blackboard and
other statements containing the words "believes,"
"anticipates," "plans," "expects," "will," and similar
expressions, constitute forward-looking statements
within the meaning of The Private Securities Litigation
Reform Act of 1995. Actual results may differ materially
from those indicated by such forward-looking
statements as a result of various important factors,
including the factors discussed in the "Risk Factors"
section of our most recent 10-K filed with the SEC. In
addition, the forward-looking statements included in this
press release represent the Company's views as of July
Audience
»
»
»
»
Basic to Intermediate Java developer
Java/JSP/Servlet development is assumed
Blackboard Building Block development is not
assumed, but is helpful
Familiarity with, but not necessarily expertise in,
current Java development tools
Goals
»
»
»
Focus on process and environment, rather than
Blackboard Building Block technology
Cover a selection of tools that are available to build
Blackboard Building Blocks
Describe techniques and practices that will make the
development process easier
Blackboard Building Blocks Technology
»
Extensibility mechanism for Blackboard
Provide drop-in functionality, or ...
» Provide a bridge to an external system
»
»
Standards-based
Blackboard Building Blocks are Java webapps with
additional metadata
» Rely on/integrate with embedded Tomcat engine
»
Blackboard Building Blocks Architecture
Business Layer
(JSP, Servlet, Struts)
View Layer
(JSP, Servlet, Tag Library)
Data Objects
Core Services
Security
Log
Config
Session
Context
Persistence
Plug-ins
I18N
VXI
Anatomy of a Blackboard Building Block
Package (.war/.zip file)
web.xml (Servlets)
Platform Descriptor
bb-manifest.xml
Blackboard Manifest
Servlets, JSP (Java)
Web Resources
.class, .jar files (Java)
Libraries
The Process
»
Feature Planning
»
»
Set up the build environment
»
»
Defines what you’ll need in terms of entry points
Local Blackboard server works best
Perform an initial build
Get entry points defined
» Install the Blackboard Building Block
»
»
Iterate
Build/rebuild
» Redeploy
»
The Build Stages
»
Compile
»
»
Stage
»
»
Web app structure is created from other components
Package
»
»
Custom .java files compiled into .class files
Web app structure is zipped into the .war file
Deploy
»
An alternate to “package”, depending on the cycle
The Process
Preliminary
Feature
Planning
Compile
Environment
Set-up
Stage
Initial Build/
Install
Package
Iterate
Compile
Stage
Deploy
The Process
»
Initial Install vs. Re-deploy
Initial Install reads manifest and establishes the entry
points
» Re-deploy simply makes Blackboard Building Block
inactive, then makes it Available again
»
Cycles webapp, reloads classes
» Inactive/Available cycle unnecessary for JSP changes
»
Example – The Build Environment
»
»
»
»
JDK 1.4/5.x – The core Java library you’ll need
Eclipse 3.x – An IDE for editing/debugging/formatting
Ant 1.6.2 – A tool to automate many of the tasks
(within Eclipse and via shell automation)
... All Freely Available
The Tools – JDK
»
Version is dependent on which Blackboard install is
targeted
6.0.11 and higher supports 1.4.x
» 6.3 and higher require 5.x
»
»
New language features are extremely nice
The Tools – Ant
»
»
»
An Apache Software Foundation project
Not bound to Blackboard release
Samples developed against 1.6.2, but should work
against earlier versions
The Tools – Eclipse
»
Java IDE with substantial productivity features
»
»
»
»
»
Ant integration
Refactoring
JUnit integration
Plugins (e.g., SCM integration, JSP editing)
You’ll need 3.1 if you’re developing with JDK 5.x
The Strategy
»
Organize the workspace to separate the different types of
files you’ll work on
Web Files (JSPs)
» Logic Files (.java files, servlets, etc.)
» Configuration Files (.tld, .xml)
» Etc.
»
»
Use a tool that will automate the transformation of each
artifact into the next
»
»
Build the configuration to support rapid iteration
Use the tools to support unit development, unit testing, and
debugging
»
Better encapsulated, smaller units helps make the iteration easier
Organizing the workspace...
Example – The Directories
Compiled Classes
Config Files
Library Files
Java Source
“Prep” Directory
JSP/HTML/Image
Automating the environment...
An Ant Primer
»
»
»
»
»
Build utility to manage compile/build tasks and
dependencies
Uses XML as the syntax (compare to make, etc).
Core data model:
project  target  task
Targets define dependencies and contain tasks
Tasks are the units of work...
Many built-in tasks (javac, jar, copy, etc.)
» Easy to customize
»
An Ant Primer
»
File typically named “build.xml”
»
»
Ant will automatically process that file if no file
argument is provided
Arguments can include specific targets
»
Project default target is used if no target is provided.
E.g.,
»
»
»
c:\projects\sample>ant
c:\projects\sample>ant compile
c:\projects\sample>ant -f alternate.xml compile
Example – A Simplified Build File
Init properties, files
Compile Java Files
Copy files to staging
Create .war file
Copy to install
Example – Build File
Example – Eclipse Integration
Making It Easier
»
»
»
The Starting Block
Server Blackboard Building Block to Install, Cycle,
and Uninstall
An Ant task to invoke the Starting Block from your
build environment
Using the tools...
Test Driven Development
»
Write objects that can be used independently of the
container
Re-use
» Testability
»
»
Get used to writing methods (and tests)
corresponding to user interface features
Example – JUnit Integration
Debugging
»
A valuable and under-used technique
»
»
Limitations actually encourage better practices
»
»
Avoid System.out.println() like the plague
If you’re used to stepping through code, and hate the
lack of JSP  source correlation, you’ll build better
business objects
Caveat: environment is slightly different, notably, the
security manager is not enabled by default
Debugging – How To
»
»
»
»
Stop the Blackboard Tomcat instance
Open a command line, define the JPDA environment
variables
Execute the shell launcher that brings Tomcat up in
JPDA mode
Connect with debugger of choice
Debugging – How To (Windows)
»c:\blackboard\apps\tomcat>
net stop bb-tomcat
»c:\blackboard\apps\tomcat>
set JPDA_ADDRESS=2222
»c:\blackboard\apps\tomcat>
set JPDA_TRANSPORT=dt_socket
»c:\blackboard\apps\tomcat>
bin\blackboard-tomcat.bat jpda start
Debugging – How To (Unix)
»/usr/local/blackboard/>
./tools/admin/ServiceController.sh
services.appserver.stop
»/usr/local/blackboard/>
export JPDA_ADDRESS=2222
»/usr/local/blackboard/>
export JPDA_TRANSPORT=dt_socket
»c:\blackboard\apps\tomcat>
./bin/blackboard-tomcat.sh jpda start
Debugging – Connecting
Debugging – Connected
Debugging – Connected
Conclusion
»
»
Planning your build environment can help ease some
of the headache of Blackboard Building Block
development
Use tools that help automate the process
Resources
»
»
»
»
Ant: http://ant.apache.org/
Eclipse: http://www.eclipse.org/
Java/JDK: http://java.sun.com/
Blackboard Building Blocks:
http://buildingblocks.blackboard.com/
Questions