Building Web Services Source Code
Basically, I thinking that we can make the examples that come with the book a really key part of the value that we deliver. Here are some things that we can do:
- Build a framework within which all examples can live.
I've taken a crack at this.
- We have a single web app for all examples. It's bound to the
/bws
root.
- There is a way to organize all chapters and examples. The directory structure is
/chN/exM
.
- There is a way to organize resources used by the examples. Since these are likely to be shared they all go into
/resources
.
- There is a way to organize SkatesTown's SW assets. They go in
/WEB-INF/classes/com/skatestown/...
. I've already set up packages data
, xml
, backend
and services
to separate SW logic into small manageable and explainable chunks.
- All example code that uses SkatesTown's stuff goes in
/WEB-INF/chN/exM
.
- Utilities used by our book go into
/WEB-INF/bws
. None of the other code should work with external resources directly. It should all go through bws.BookUtil
. In this way, the example code is most readable and most reusable.
- Build an application around the examples to ease navigation and learning
I've taken a crack at this, too.
- Frames-based navigation with a crumb trail so that one can easily move around the examples.
- Single deployment of all services.
- Source/resource browsing (TBD)
- Make the examples look and feel similar.
We should all work towards this.
So, while I have most of the things in place up to a point where we can use the screenshots, I think the plumbing can be improved. I have a vision that we can make all examples be driven off of a simple XML "descriptor" for the example apps, something along the lines of:
...
Resource description goes here
...
...
...
Once we have this, we can activate the [ source ] link on the examples navigation bar. It will take readers to an auto-generated page that will list all important files that are being used by this example, e.g.,
Example 5 uses the following resources:
Avail.java
[source] [javadoc]
This file implements an Axis web service that, given a SKU and quantity desired, checks for the availability of an item in SkatesTown's product database.
- ...
All we need on top of this is to plug in opensource colorized Java and XML pretty printers.
It seems like a great thing to do while the book is getting polished. We can leave the competition in the dust and make our examples shine. There will be a buzz on Amazon. Let your imagination soar...