Eben Hewitt on Java

Eben Hewitt writes about Java, Service-Oriented Architecture, and general enterprise software development practices.

My Upcoming Speaking Schedule

Here's my conference schedule for the next couple of months:

Speaking on Cassandra at Cassandra Summit San Francisco, Tuesday August 10.  http://cassandrasummit2010.eventbrite.com


Speaking on "Scaling Web Applications with Cassandra" at Web Expo 2.0, New York City, September Monday 27 through Thursday September 30. http://www.web2expo.com/webexny2010/


Speaking on "Creating an Event-Driven SOA" at SOA Symposium in Berlin, Germany October 5-6. http://www.soasymposium.com


Speaking on "Adopting Apache Cassandra" at Strange Loop St. Louis, Missouri. Conference October 14-15. http://strangeloop2010.com/

July 22, 2010 | Permalink | Comments (0) | TrackBack (0)

Service Design Review Checklist for SOA Governance

One thing that seems to come up with some frequency in SOA circles is creating a checklist that would help make the development team, the architecture group, SOA Governance board, and the business customer feel confident about rolling out a service--something that would act as a guide so that developers know they're making something appropriate and useful, to help encourage good SOA design principles, and to make sure that the business actually realizes the benefits of SOA (instead of just moving the problem).

So I thought I'd put this checklist together and hopefully save you some effort. This is probably something I should included in Java SOA Cookbook, but here it is now.

This checklist for Service Implementation includes 90 questions for ensuring that a proposed candidate service will make a good addition to your catalog, and has a good chance of being successful after it's gone live. 

Here’s how this is intended to be used in the context of SOA Governance:

  1. Introduce this Review Checklist to the Application Architect or development team who will design and realize the service—before they start working on it. If they know this test will be coming at the end, they will account for these things. Just as with Test-Driven Development where you write the code that makes the test pass, this is Test-Driven Service Design—create the service that will pass the test below. No Programmer Left Behind!
  2. As the service is in development, the team should consult back with this checklist to make sure nothing is being forgotten. Of course, not everything will apply for every service.
  3. When the service is nearing the end of the development cycle, the Application Architect or whoever is the lead developer of the service should present her service before the SOA Governance Board, so that they can be responsible for introducing it to production deployment and the service catalog. If too many items have been left unconsidered by the development team, don't let the service be promoted.

 Tailor this list for your own organizational needs, of course. Here's the checklist:

Background

  1. What business assumptions have been made? What risks do they pose?
  2. What system assumptions have been made? What risks do they pose?
  3. What specifically does this service do to address the following:
    1. Decrease costs
    2. Increase revenue
    3. Promote agility
    4. Promote productivity
  4. What is the business governance domain for this service?

 

Service Design

  1. What is the category of this service?
    1. Stateful Business Process (Employee Onboarding, Return Merchandise)
    2. Business Entity (nouns such as Employee, Customer)
    3. Business Functions (verbs for atomic actions in a process). May also be Event Handlers
    4. Utility (perform an application-agnostic function such as Email)
    5. Security Service (handle identity, authorization, privacy)
  2. How has the design iterated or evolved? Did you start by considering the consumer view?
  3. Describe how the design used a “middle out” approach.
  4. Where are the tightest couplings with other services, other systems, etc?
  5. How do you anticipate this service being reused? In what systems? By what kinds of consumers? How can modifications be minimized?
  6. What patterns from the Service Design Patterns catalog have been employed? (If you don't have your own internally approved SOA Patterns catalog, start out using Thomas Erl's excellent http://soapatterns.org).
  7. Have you followed relevant organizational implementation standards (Java coding conventions, etc)?
  8. How have you accounted for internationalization? How will your service support localization (eg, return different data based on geographic location, formatting concerns for currency, language, and other items)?
  9. What transports does your service support (SOAP, JMS, HTTP, etc)? Why were those selected?
  10. Does the service make use of or allow for user preferences (eg, number of results returned, etc).
  11. What are the basic Message Exchange Patterns used for this service?
  12. How does the design support an event-driven approach?

 

Service Operations

  1. Does the service support purely stateless connections (unless it is a business process service)?
  2. Do service operation definitions support typical variations in the domain?
  3. Have you avoided any messages, operations, or logic that are consumer-specific?
  4. Are all operations capable of being executed independently, without necessarily relying on any previous invocation of another operation?
  5. Are all data access operations idempotent?
  6. Does the service offer a variety of operations for retrieving minimal, most common, and full data sets?
  7. Does the service use only standard logging facilities and a log rotation strategy?

 

Coupling

  1. Name all external systems called by this service.
  2. Does this service wrap an existing legacy system or database? Could that system be entirely replaced by a newer or different implementation without affecting consumers?
  3. How does the service capture inputs and outputs as business documents? How does your level of abstraction avoid RPC?
  4. Does this service not directly invoke another service, but instead pushes such invocations up to an orchestration?

 

Business Processes/Rules

  1. Have any specific business processes have been identified that can use this service in automation?
  2. What business rules have been identified that can be extracted to a business rules management system or external rules engine?
  3. Does the service reference any business rules that may feature thresholds or other items that could be configured by a business user, or are they baked into code?
  4. What KPIs have been identified for the service?

 

Function

  1. How does the design fulfill the functional requirements of the service?
  2. How have the boundary cases been considered?

 

Data

  1. Describe how this service accesses data, what data it accesses, and where.
  2. Are transactions required? How does the design handle transactions? Has compensation been considered as an alternative?
  3. Describe how this service fully encapsulates its data. If it cannot at this point, what is the transition plan for doing so?
  4. Describe how this service uses the Canonical Data Model.
  5. How does the service perform validation on incoming data? How does the service respond to invalid inbound data?
  6. How does the service account for data quality?
  7. Have you externalized strings?

 

Service Contract

  1. Have relevant current and potential future consumers been consulted on the service contract?
  2. Will this service use virtualization? Why or why not?
  3. How does the service support the principles of Service Orientation?
    1. Loose coupling
    2. Abstraction
    3. Composability
    4. Standard Contract
    5. Autonomy
    6. Statelessness
    7. Reusability
  4. Does the service contract need to vary for external business consumers as opposed to internal application consumers? How so?

 

Errors

  1. Does the service use only standard message return codes and user-friendly descriptions?
  2. What checked exceptions (faults) does the service offer? Under what circumstances can they be generated?
  3. What runtime exceptions are likely to be generated from the service? What result do you expect in consumers receiving runtime exceptions? How can this be mitigated?

 

Performance

  1. What is the measured latency of service response in testing?
  2. What SLAs have been defined for this service? What mechanisms are in place to prevent SLA violations? What mechanisms are in place to report SLA violations?
  3. What steps in an orchestration can you design to be executed in parallel and joined later?
  4. How does the design encourage asynchronous invocation?
  5. Are the operations designed at various levels of appropriate granularity so that they are not prone to network chattiness and do not return data clients are not likely to need?
  6. How does the design delineate between operations that must be performed quickly and operations that are long-running?
  7. Can the service be scaled be adding more nodes running the service? What might prevent this?
  8. What is your caching strategy behind the service implementation? Can known consumers easily cache data in front of the service? How will this be managed (eviction policy, invalidation, etc)?
  9. If your messages use binary data, do they employ MTOM?
  10. Does your design allow for clients to select variations on an operation based on their context? For example, do you offer both doXandWait(m) : Response and a doXLater(m) : Void operation options?

 

Security

  1. Does the service require authentication? Authorization? How are these implemented?
  2. What other regulatory constraints (PCI, Sarbanes-Oxley, etc) might affect this service contract or deployment? How have those been directly accounted for in the design?
  3. What are any additional security requirements for this service? How are they fulfilled?
  4. Does the service allow for auditing? How is that implemented?
  5. Are logs free from PCI or PII information?

 

Quality Assurance

  1. How many unit tests are available for this service?
  2. Are all unit tests independently executable (ie, not dependent on the successful run of any prior test)?
  3. Were test cases created for every user function? Did the tests use a variety of data inputs (valid, invalid, null, many different combinations of length and character)?
  4. Were test cases created for all exception conditions?
  5. Were test cases created around a generated client (in Java or .NET)?
  6. Are the unit tests in version control, and versioned in clear correspondence with the service so that the environment can be entirely reproduced?
  7. What is the test coverage percentage for this service?
  8. If this is a new version of an existing service, have you tested directly for backwards compatibility issues?
  9. What functional tests were written if a consumer is available?
  10. How was the service load tested? What metrics were recorded?
  11. If the service uses asynchronous or fire-and-forget operations, were these tested by subscription?

 

Lifecycle

  1. Are the service and attendant schemas appropriately versioned?
  2. What can be retired or sunsetted after this service is deployed?
  3. Have you externalized configurable data?

 

Availability & Support

  1. Will the service be highly-available? What are the availability requirements? How will these be met? What is the business impact if the service is down for 1 minute? 5 minutes? 30 minutes? 1 hour? 4hours?
  2. How will availability be measured?
  3. How will the production support team receive messages or alerts regarding the current state or health of the service?
  4. How will runtime issues with the service be addressed organizationally? Has an on-call schedule been established?
  5. What visibility does the service directly offer (eg, in the form of JMX) to different support teams?
  6. Does the service require planned downtime for maintenance? How much time, and how often? What is expected to be performed during this down time?
  7. How have you involved the infrastructure team in the creation and design of this service?
  8. What is the plan for future maintenance of the service after it is successfully deployed?

 

Deployment

  1. What problems is service deployment likely to pose?
  2. Will the service be load balanced?

 

Documentation

  1. Have you captured the design in the Service Template?
  2. Has the service been captured
  3. Have you followed relevant standards for code-level documentation?
  4. Have all test execution results been recorded (eg, in the Maven site)?

The blog ArtOfSoftwareReuse.com has a very good checklist too, and I've incorporated some of the excellent work done by Vijay there at http://bit.ly/3UJaNk. That checklist has fewer than 50 items; mine is approximately twice the length. Of course, it's expected that you'll use only what makes sense for your organization. Good luck!

July 05, 2010 | Permalink | Comments (0) | TrackBack (0)

10 Ways to Beat Writer's Block

Some friends on Twitter (@starbuxman and @mikojava) recently had a quick exchange regarding writer's block. Now that I'm in the midst of writing what is probably my sixth book (I forget), and because I know many writers, I think about writer's block a bit. I wrote my first book in exactly 90 days. It was 900 pages. Years later, my 750 page book Java SOA Cookbook was written in 6 months. 

You can beat writer's block. It's easy. Unable to fit my comments into 140 characters (I tried for a while, and failed), I offer these simple steps to beating writer's block. 

1. Don't be a "Writer". Write. There's a line from a George Orwell story that I just love: "Every time he entered a room, he thought, 'he entered the room...'". 

"Writer" sounds special. It sounds glamorous and fascinating, as if you're about to jot off to Lucerne to schmooze with "artists" and captains of industry over martinis. Eventually the story goes, as you trade witticisms, the movie starts, and a spirituous muse of inspiration will slowly encircle you, mist-like, and you'll suddenly break away from the mob to blurt out your latest flash of genius on a cocktail napkin, clutching it with you for the long, lonely ride home as you look longingly out the window of the plane, the cheerful stewardess bobbing above the water of blissful ignorance as you slowly drown, down through the leagues, burdened by the heaviness of your introspection, hung about your neck. 

"Loneliness" is not glamorous. More importantly, it is not required, and certainly not helpful, for writing. I am not a lonely writer. I have written most of my books with my lovely Alison a few feet away, reading her book or writing herself. We talk. I glance up to see her pretty little toes every once in a while. We chat. I go on. She goes on. 

These cultural overlays promote this fantasy of a writer, and they're necessary for two reasons: it creates images for movies, and it helps writers feel important. The first is required because there is no image of a writer, save one: a typist, which is not interesting--at least, it's not cinematic. The second point is a matter of money. When people find out I have written books, this conjures up a lot of culture overlays for them, and a primary one is that it's made me rich. There's a reason that even Nobel prize winners and best sellers like Toni Morrison and Joyce Carol Oates have day jobs. Writing does not make one rich. We seek, then, a story, in which we are the hero, because heroes, as everyone knows, never are looking for something so pedestrian as money. This is a basic reaction formation, and nothing more.

So do not be a "writer", where writer is lit up like a Las Vegas sign, suggesting something fantastical. Writing is not special. The act of writing is interesting to writers, perhaps, but in the way that a carburettor is interesting to a mechanic. It's just this thing you do. Like exercising (if you exercise, of course; I make it a point never to do so). But it's not interesting to anyone else. Or if you suspect it may be, pretend that it isn't. Being a writer means typing words. Put the words down. Which leads us to the next point.

2. Are You Just Being Lazy?

"Writer's block" is a phrase that helps us feel that we are at the mercy of something else. We say to ourselves, I would go out and play, but I can't because I have chicken pox. Something else is keeping us from our true desire. We say, I would write, but I have writer's block. Hogwash. There is no such gravitational pull on you. There is no Death Star with a tractor beam pulling you away from writing. If you feel such a pull, it's laziness. Just switch this off in your mind. Go write, as if you were someone else. Pretend you are not you, the you under the sway of this tractor beam. Pretend, if you must, that you are someone else, who just doesn't have that problem. Let the other you be the one who can't write. Then you don't have to deal with the problem, you and the problem can happily co-exist. The other you will have writer's block, and the you-you will be the one writing. 

3. Make Writing a First-Class Citizen

The things of the world take time. There are many distractions. We feel that writing is not important, it tends to come last. Treat it as important as your day job. Defend your writing time. Sometimes this will not go over well with your friends and loved ones. No one will help you write. If you're to do it, you must take it and own it and be occasionally ruthless about your time. 

4. Writers Deal in Words. 

If you don't love language, if you don't care about clarity of expression, if you aren't delighted by a certain turn of phrase, if you aren't inspired by the perfect, distillation in the capturing of a thought maybe you aren't that into words. Writers like words. If you're a great programmer or geologist or whatever you're writing about, you may not make a great writer. Because writing is a thing. If you don't love words, you're going to have a very hard row to hoe, and no advice will help you--you're just in the wrong gig.

5. Take Breaks

This is boring, cliched advice, but it also has the merit of being helpful. Your body gets tired. Every once in a while, get up and wander outside, poke around, clear your head. Don't start something else. Just putt around for 5 or 7 minutes. Think about what you need to write in your next chunk of time. Then just go do it. Don't get distracted. The purpose of the break is not to take a break. The purpose of the break is to organize your next chunk of writing.

6. Make Lists

I make a list at the start of a writing day. It is a simple bullet list of what topics I want to cover by the end of the day. I typically have 6-8 things on the list. I typically accomplish 2. But I feed this list into the next day. It feels good to cross stuff off a list. Lists keep us focused. Lists are a litmus test that we actually know what we're doing. If you can't make a list, you don't know what to write, and you'll just bang away. It will be unpleasant and unproductive.

When you're starting a book you know will be 300 pages or 700 pages, it's daunting. Lists help me focus on what I can do just today, and screw the rest. The saying goes, how do you eat an elephant? One bite at a time.

Sorry to mix metaphors, but just pick up the shovel, and start digging.

7. Block off Big Chunks of Time

You'll never get anything done writing for an hour or two. The context switching is too expensive. When I write, I get up at 6 on Saturday, start writing within the hour, and write until about 6 at night. Just truck. In this much time you can easily get 5 or 7 or 10 good pages. 

This is hard to do, depending on circumstances. Oh well. 

8. Write As If There's Only One Draft

My finished books look an awful lot like my first drafts. If you're one of these "writing is rewriting" people, I wish you luck. You'll never get done. And yes, I know the theory, and yes, I see the value. But that helps academics think about writing. It doesn't help you get words on the page. 

So you need to have a clear idea of Done. And mine is two-fold: There's Done, which is something that is readable by an editor, which is basically a first draft that is potentially shippable if people didn't care about typos and some awkward phrasing. And then there's a single second round of Done-Done, because people turn out to care about those things when they're paying $40 for your book. 

Sure there's copy editing and whatever, but that's just stuff. It's important to do, but the writing is baked at that point. 

Typically, writers don't do this. They have absolutely no idea what their current relation to Done is for whatever they're working on today. Think of writing a chapter as a two week sprint, and at the end of it, you need to be potentially shippable. 

This will not only help actually get the book done. It will also help you psychologically, because you can see real progress: the finish line must always be in site, or you'll get mired in worry and generalization.

9. There is No Such Thing as "Writer's Block".

If you think you have writer's block, it follows that you think that writing is something-that-can-be-blocked, that it implements the Blockable interface. Fiddlesticks. Who talks about "mechanic's block"? Who talks about "programmer's block"? No one. Because they don't exist. As a mechanic or programmer or writer, some days you got it, some days you don't. Big deal. If you set out to write today and you're not feeling it, write off the whole day. Go do something else. Not because it will free your block, which doesn't exist, but because if you're not in the mood, you're not in the mood--but you'll do your valiant best to fight through it anyway, and end up writing a bunch of disorganized rubbish that you'll just have to throw away tomorrow. So if today's not the day, blow it off and do it later. Listen to your internal voice to know if today's the day or not.

If you honor the term "writer's block" with ontological status, you'll have to deal with it. This inventiveness takes time and energy which you should spend typing. 

I don't think writer's block exists, so I never, ever have it. I'm not being mystical; this is a statement of fact.

10. Deadlines Matter. Deadlines matter at our jobs. If you blow them off, there are consequences, because it's Serious Business. It matters. Honor the many people who have jobs of their own who are working to support your book, including your family, by getting the bloody thing done. On time. Writers are the single most notorious blower-offers of deadlines. Only because they think they are special. They are artists, and the rules of the world don't apply to them. Fiddlesticks. That's not being an artist; that's being a jerk who doesn't understand how the world works.

Of course, from time to time, things come up, and stuff happens, and we miss a deadline. Just make status updates so everyone's prepared.

If you think deadlines don't matter, you will get writer's block, because, secretly, you think what you're doing doesn't matter. It does. And it doesn't. It's just a thing some people do. 

If all else fails, step away from the keyboard, relax with a beer. Hit it tomorrow. If you love writing, you'll get it, my friend. If you don't love writing, you won't--and it won't matter anyway.

July 03, 2010 | Permalink | Comments (0) | TrackBack (0)

Moving Main Blog to Cassandra Guide

I've redirected my landing page for http://io.typepad.com. You'll now get the Cassandra Guide blog page as that's the main blog I'll be updating. 

If you'd still like to access posts on Java web services and more personal matters (which I don't frequently post, but will do so occasionally in the future), here's the full link: 

http://io.typepad.com/eben_hewitt_on_java/

Thanks for all the fish, and see you at the Cassandra Guide.

May 16, 2010 | Permalink | Comments (0) | TrackBack (0)

A Literary Life: Our Book Reorganization Project

This weekend Alison and I reorganized all of our books. We were drowning in them, with no ability to find what we were looking for. This is not the first time we've done this, but, as with all things, organizational efforts of years past have eventually given way to entropy, transmogriphying  our beloved set of books into an antagonizing annoyance.  

This is a very revealing little compilation in some ways. We learned some stuff, which I'll share later. I thought I would make my representation of our little journey fun by styling it after a Harper’s Index. Below are the statistics we came up with. For extra fun, get a friend and try to have them guess the answers to the questions.

Total Books:
 3343

Total number of book cases:
 24

Greatest number of book cases in a single room:
 Bedroom with 11

Total Length of All Books if Laid Out Side by Side:
 1,577 feet

Total Length of an American Football Field:
 300 feet

 Estimated Total Weight of Books in pounds (based on weighing representative samples):
 1920

 Weight in pounds of a 2008 Smart Car:
 1852

 Weight in pounds of a 2008 Toyota Yaris:
 2290

 Book with the Highest Cover Price*:
 1. Exploring Criminal Justice, John D. Hewitt, $84.99
 2. David Luckham’s The Power of Events, $64.99

*Many of our books do not have visible cover prices.

 Widest Books in Inches:

  1. A.L. Rowse’s Annotated Shakespeare: 3.7 inches
  2. Oxford French Dictionary: 3.1 in
  3. History of Art: 3.0 in.
  4. A New Kind of Science: 2.5 in
  5. Core ColdFusion 5 (Hewitt): 2.5 in
  6. C# .NET Certification Exam Guide: 2.5
  7. Richardson’s Clarissa: 2.5 in

 Categories we bothered to actually completely alphabetize:
 Shakespeare, Theater, Philosophy

 Books with the Greatest Number of Pages:

  1. The Norton Shakespeare, Stephen Greenblatt, ed: 3420 pages
  2. Norton Anthology of English Literature, Vol 2, 5ed: 2616 pages
  3. Norton Anthology of English Literature, Vol 2, 6ed: 2543 pages
  4. Oxford French Dictionary: 1915 pages
  5. Norton Anthology of Modern Poetry, 2ed: 1865 pages
  6. Core Java Foundation Classes: 1655 pages
  7. Clarissa by Samuel Richardson: 1531 pages

 Heaviest Books in pounds:

  1. Strong’s Exhaustive Concordance of The Bible: 9.0 lbs
  2. History of Art, ed. Gowing: 8.0 lbs
  3. A.L. Rowse’s Annotated Shakespeare: 7.5 lbs
  4. Modern Painting and Sculpture 1800-Present: 7.0 lbs
  5. Gardner’s Art Through the Ages: 7.0 lbs

Stephen Wolfram’s A New Kind of Science was a surprising disappointment in these categories with only 1196 pages, 5.0 lbs.

 Number of Books by Category:

  1. 20th Century Fiction/Literature: 574
  2. Philosophy (including Logic and Ethics): 515
  3. Kids/Adolescents: 356
  4. Programming: 301
  5. Theater: 217
  6. Poetry: 212
  7. Psychology: 165
  8. Literature (Pre-20th Century): 160
  9. Books by or About Shakespeare (not included in Theater tally): 94
  10. Literary Criticism: 84
  11. Journals: 75
  12. Feminism: 73
  13. Miscellaneous: 37
  14. Cookbooks: 31
  15. Religion: 29
  16. Writing/Publishing: 21
  17. Books About Food with No Recipes: 18
  18. Cats: 15
  19. Language Dictionaries: 15
  20. Science: 9
  21. Walt Disney or Disneyland" 7
  22. Business: 5
  23. "Knowledge Management": 3

 Number of Self-Published Books on our Family Heritage That We Decided Belonged in "20th Century Fiction":
 1

Longest Book Authored by a Member of Our Family:
 Eben's Core ColdFusion 5 at 962 pages

Total Number of Pages in Books with Eben as Sole Author:
 2829 (does not include CD ROM courseware)

Number Authored by Alison's Dad in Our Collection:
 2

Number Co-Authored by Eben’s Dad:
 3 (8 if you include different editions of same book)

Number of Books Authored by Alison:
 4

Number of Books Alison Contributed To as Writer:
 5

Number of Books Authored by Eben:
 5

 Number of Books Eben Contributed To as Writer:
 1

 Number of Printed Books Eben is Cited In:
 1

 Number of Books For Which Eben Served as Reviewer:
 2

 Number of Books For Which Alison Served as Reviewer:
 20

 Number of Books with Eben as Editor:
 8

 Number of Books by Alison Translated into Polish:
 2

 Number of Books by Alison Translated into Chinese:
 2

 Number of Books by Eben Translated into Any Language: 
 0

Our Weirdest Title:
 1st Place: The Armed Robbery Orgasm: A Lovemap Autobiography of Masochism by Ronald W. Keyes & John Money

2nd Place: The Pronouncing Dictionary of American English, Merriam Webster

 Greatest Number of Titles Written by a Single Author:
 
Joyce Carol Oates (including her various pseudonyms): 32

 Most Represented Author (ie, Greatest Number of Titles By and About a Single Author):

  1. William Shakespeare: 94
  2. Karl Marx: 51
  3. James Joyce: 34

 Number of Complete Editions of Shakespeare:
 3

 Most Copies of the Exact Same Title and Edition:
 3 copies of Shakespeare's Pericles, Penguin edition

 Number Given Away Not Included in Any Other Tally:
 292

 Chance that a Programming Book is Specifically about Java:
 1 in 3

 Books about Dungeons and Dragons:
 2

Number of Copies of the Same book (allowing different editions/translations)*:

1st Place is a 2-way tie. We have 5 copies each of:

  • Goethe: Faust
  • Marx: Capital (vols 1-3)

3rd Place is a 7-way tie. We have 3 copies each of:

  • Camus: The Stranger
  • The Complete Chaucer
  • Don DeLillo: White Noise
  • Kant: Critique of Pure Reason,
  • Jean-Paul Sartre: Being and Nothingness
  • Shakespeare: Pericles (does not count instances in collected works)
  • The Bible

10th Place is a 34-way tie. We have 2 copies each of:

  • Auden: Lectures on Shakespeare
  • Georges Bataille, Tears of Eros
  • Gilles Deleuze and Felix Guattari: Anti-Oedipus
  • Gilles Deleuze and Felix Guattari: A Thousand Plateaus
  • Gilles Deleuze and Felix Guattari: What is Philosophy?
  • Gilles Deleuze and Felix Guattari: Negotiations
  • Jacques Derrida: Dissemination
  • Jacques Derrida: Writing and Difference
  • Jacques Derrida: Glas
  • Jacques Derrida: Of Grammatology
  • Jacques Derrida: The Ear of the Other
  • Jacques Derrida: Spectres of Marx
  • Jacques Derrida: The Politics of Friendship
  • Jacques Derrida: Speech and Phenomenology
  • Decartes: Mediations
  • William Faulkner: Absolom, Absolom!
  • William Faulkner: As I Lay Dying
  • William Faulkner: Light in August
  • William Faulkner: The Unvanquished
  • F. Scott Fitzgerald: The Great Gatsby
  • Michel Foucault: Discipline and Punish
  • Michel Foucault: History of Sexuality
  • Hegel: Phenomenology of Spirit
  • Heidegger: Being and Time
  • Hobbes: Leviathan
  • James Joyce: Ulysses
  • Kierkegaard: Either/Or
  • Kierkegaard: Fear and Trembling
  • Lacan: Ecrits
  • Neitzcshe: Beyond Good and Evil
  • Silverman: Edgar Allan Poe
  • Slavoj Zizek: The Abyss of Freedom
  • Slavoj Zizek: Looking Awry
  • Slavoj Zizek: The Sublime Object of Ideology
  • Slavoj Zizek: Tarrying with the Negative

 * Does not include multiple copies of books authored by us sent from the publisher.

 * * *

That's it for the numbers. A few comments:

Please, dear reader, before becoming disgusted with us that we're terrible gluttons, please note that these books were accumulated over decades. In addition, Alison is a Philosophy professor, and I am in software, and we are both paid to write. Reading, beyond its intrinsic pleasures, is a non-negotiable predicate for writers. Many of Alison's books relate to her teaching and her graduate study. Many of my books relate to my graduate study, and I do not have a degree in Computer Science, which occasioned me to be not "self-taught", but rather taught by the wonderful authors responsible for all of those programming books. We have given away hundreds of books over the years, none of which are reflected here, obviously. Finally, books make for an excellent source of insulation in the extreme temperatures of the desert. 

I learned, and I think I will presume to apply this small rule as a universal against my better instincts, that Pay-As-You-Go does not work. It's like a mortgage--your house is much cheaper if you can pay for it up front all at once. This is an interesting thought in particular with respect to software architecture, which, of late, I have been trying, perhaps in vain, to work under such an apparently "business-friendly" model. But that's for another time.

We initially tried rearranging things in their own place, within their own shelf. But the books inevitably relate to some other category, or there is another book by the same author on another shelf, and this meant we had to touch the same book many many times while making little progress. In the end, it became clear that we needed to pull everything off of the shelves, deal with them, and put them back. A sort of Extract-Transform-Load process, if you will. 

Here is a picture of a small percentage of the books following the Extract: 

Books
 

We then categorized things, choosing to alphabetize the ones we care about most and refer to most, depending on how we look them up. For example, I use my computer books more than my plays, and I alphabetized only the plays. But plays are very thin and hard to find, and I typically look them up based on author. I rarely look up computer books by author, and often have no idea who the author even is, so it wouldn't help me.

There were many subcategories that we ended up with that surprised us. For example, we had no idea that we had a number of books on "what it's like to be a black man in America not including Richard Wright" to rival your local bookstore.

I will admit to not being embarrassed about the discovery of our weirdest book, The Armed Robbery Orgasm, which we both have read. This is a non-fiction psychology book about some people with a particular kind of affliction whereby they can only find sexual pleasure while committing robbery. As if the title didn't give it away.

The Elephant in the Room

The elephant in the room here is the fact of the books themselves. They are bound books, not in digital form. As not just a prodigious reader and writer, but in particular as a software professional, I suppose I'm supposed to make a statement of some kind regarding the Kindle (no, I don't have one), the Nook (none either), or whatever Apple is making today that starts with "i-". I suppose we would not have to have devoted our weekend to this had we all of these thousands of title squirreled away on some flip drive. But we wouldn't have had so much fun either. Lady GaGa helped. 

We love our books. We love to see the beautiful mosaic portrait they make on the walls. 

Bound books are a pain to trudge around with--just taking them to work is a pain; forget about moving them. But they make you select them carefully if you're going to trudge.

Bound books allow serendipity. You can discover them in a moment of wandering in a way that simply isn't afforded by digital counterparts. I'm not only talking about the notes I discovered falling out of onoe book, written in my mother's handwriting during her own graduate study of TS Eliot's "objective correlative"--the idea that an author needs to represent in some concrete way abstractions that are difficult to capture, such as color, or sound, in order to provide a way for writing to conjure a sensory experience.

Now, I'm not a Luddite, to be sure. Nor I am a sentimental apologist, mired in nostalgia for an age gone by that I don't believe really existed anyway. But while I'm not for these sorts of devices, I'm not against them either. Technology will change our experience in the relatively modest ways that it has for thousands of years. The novel didn't even exist until 250 years ago, and it was afforded by technological advances.

So I fancy that I see these sorts of changes in the long view. Some people today are worried that Google will rot our brains, making it sufficiently unnecessary to remember so many things that we will become a gelatinous mush of misapprehension. Check out Socrates in Phaedrus (you can read the short discourse on writing here: http://english.ttu.edu/Kairos/2.1/features/brent/platowri.htm).

It's not the books that are the problem. It's writing itself. 


January 31, 2010 | Permalink | Comments (1)

Talk Abstracts for Business & Technology Summit 2009 in Bangalore, India

These are the talks I'll be giving for the Business and Technology Summit on November 3 and 4 in Bangalore, India.

Talk 1: 10 Things Software Architects Should Know

The speaker contributed to the 2009 O’Reilly book 97 Things Every Software Architect Should Know. This talk continues in the spirit of that book, offering ten axioms to help guide the creation of a stable and fluid software architecture.  

The ten axioms presented in this talk address the fact that software architects must be versatile, have broad and deep technical knowledge, and be good communicators and team builders. Staying current with new and emerging technology and frameworks, communicating effectively with development teams and executives, managing the “ilities” and complexity in design, working with project managers, showing leadership, and balancing all of these competing needs can be tricky. To help light the way, axioms range from the abstract (“The Importance of Consommé”), to the practical (“Design at the Boundaries”), to the controversial and counter-intuitive (“Don’t Be a Problem Solver”).  

This talk will provide architects with innovative and accepted strategies for framing the business problem, working with developers, and outlining a solution architecture. 

The simple, clear, and fun axioms presented in this talk will help software architects develop their role successfully within their organizations and create beautiful, sustainable, workable software architectures. 

Talk 2: Succeeding with SOA: Designing and Building SOA in the Real World

SOA is alive and well, although its face may have changed somewhat in the aftermath of the economic upheaval and considerable unqualified hype. This session walks developers and architects through the speaker’s experience in designing and building SOA at a multi-billion dollar US retail company and highlights some of the conclusions outlined in his book Java SOA Cookbook. While there are many answers to the questions surrounding SOA, this talk will give you one architect’s perspective, and the tools to make architectural decisions for yourself. 

The talk delves into the many choices, trade-offs, disillusionment, setbacks, and victories in the real-world application of SOA. Specifically, we’ll look at acquiring tools, starting with open source and vendor selection processes, modernizing legacy systems, sharing services between different presentation channels, managing service rollout, versioning services, and demonstrating how ESB, BPM, and BAM fit into the architecture.  

Developers and architects will come away from this presentation armed with real-world tools, and strategies for dealing with SOA-specific challenges on a strategic and technical level. We’ll address what's hype and what's real in SOA, the use of policies, generated code, and making architectural choices to succeed with SOA.  
 

Talk 3: Designing and Implementing RESTful Web Services

Pre-Requisites: Attendees should have an understanding of web protocols and Java.
Audience Level: Intermediate
Description: 
Building RESTful web services has become a popular, lightweight way to develop applications and APIs. In this talk you’ll discover what REST is, why it’s an important alternative to SOAP-based web services, and how to build a working RESTful application. We’ll examine the foundations of RESTful principles, including HATEOS (Hypertext as the Engine of Application State), and then quickly move to the practical aspects of building and designing RESTful applications so developers can walk away ready to start building.  

To create real REST applications, you need a solid understanding of how to design RESTful URIs, designing Resources, and building Representations using HTML, XML, the Atom Publishing Protocol, and JSON—all of which this session provides.  

The session will include examples from the new JAX-RS 1.0 API for Java, which is scheduled for inclusion in Java EE 6. The talk culminates in a real-world example from Java SOA Cookbook using Google’s RESTful API for Financials, with notes on how some Web 2.0 sites such as LinkedIn are using REST. 
 

Talk 4: Up the Architecture Stack with SPEaRS Architecture: Services, Processes, Events, Rules, Spaces

Computing applications move “up the stack” by abstraction over time: low-level languages are abstracted into managed platforms, which are becoming increasingly virtualized; cloud computing is attempting to abstract the data center. With Web 2.0, we continued in this mode—instead of just writing applications with an API to create a web site, the web sites themselves have become the API. But our architectural concepts remain somewhat low-level; all too often we ignore this idea in architecture—instead of moving up the stack, we rip and replace one paradigm with another.  

This talk proposes a new kind of architecture that moves up the stack. Instead of switching out our architectural paradigms such as SOA, EDA, and Spaces, we can combine the best of each to create a more flexible, sustainable model. 

Based on his recent design and architecture work, the speaker distills these ideas into a new architectural concept called SPEaRS, combining SOA, Process-Oriented Architecture, Event-Driven Architecture, Rules, and Spaces to move up the architecture stack. What emerges is a proposed generalized architectural pattern to meet the computing challenges of tomorrow.

August 15, 2009 | Permalink | Comments (0)

97 Things Every Software Architect Should Know on Kindle, iPhone, in Japanese

The book 97 Things Every Software Architect Should Know (edited by Richard-Monson Haefel) to which I contributed 4 of the 97 axioms, is now available on Kindle.

The book will also be available in a couple of weeks as an iPhone app, and is getting translated into Japanese.

And here's a nice review from The Register in the UK, where it's the #1 selling book in Computing and Internet:

http://www.theregister.co.uk/2009/07/24/gg2_software_architect


July 24, 2009 | Permalink | Comments (1)

Using SOAP Faults and Exceptions in Java JAX-WS Web Services

Using SOAP Faults and Exceptions in Java JAX-WS Web Services

Pick up a copy of Java SOA Cookbook by Eben Hewitt for more stuff like this.

This article shows you how to avoid this error: javax.xml.ws.soap.SOAPFaultException: java.lang.NoSuchMethodException

This article shows you how to create proper throws clauses in your Java web services, and how to write JUnit 4.4 unit tests to handle the exceptions that you get, and mapping semantics with Java exceptions and SOAP Faults. It also shows you how to use the @WebFault annotation.

If you see a stack trace like this in your Java web service client, the answer is below:

javax.xml.ws.soap.SOAPFaultException: java.lang.NoSuchMethodException: com.example.MyExceptionBean.setMessage(java.lang.String)
        at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:171)
        at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:94)
        at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:240)
        at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:210)
        at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:103)
        at $Proxy33.verify(Unknown Source)

I.
Let's start with a regular Java class with an operation that throws an exception, like this:

public class CheckVerify {
    public MessageResponseType verify(CheckType check)
        throws MyException { ... }
}

Because annotations are so easy in JAX-WS, I would expect that I could turn such a class into a Web Service using annotations, have the deployment tool run wsgen and create the web service artifacts (WSDL and XML Schema) for me, which it would. I would expect that Java would handle the exception for me like it does everything else: it turns the regular method into an 'operation' in the WSDL--it should also turn the 'throws MyException' into a '<soap:fault name="MyException" use="literal"/>' in the WSDL too. It does.

So what's the problem?

The problem is that while this web service will deploy, this doesn't actually work for a generated Java client of that web service. You need to know a little more, and make use of an additional annotation and something called a fault bean. This article shows you how.

II.

When implementing a web service using Java and JAX-WS, you might want to code in a natural style that allows you to throw an exception from your service operation, and have the runtime translate that into a SOAP fault that is received on the client.

You can code exceptions in JAX-WS, but the documentation on the web for this is practically non-existent, which is strange because it's such a common thing for Java programmers to want to do. Sometimes you have no choice but to deal with a checked exception that an underlying library throws (IOException is common). We need to know how to deal with this.

Say we have the following web service--the annotated version of the class we started with above. It's called CheckVerify and it defines a single operation that makes sure that a check writing customer is not known to the bad check writer database:

@WebService(
    serviceName="CheckVerifyService",
    portName="CheckVerify",
    targetNamespace="
http://www.example.com")
public class CheckVerify {
    @WebMethod(operationName="verify")
    public @WebResult(name="checkVerifyResponse",
            partName="checkVerifyResponse",
            targetNamespace="
http://www.example.com")
            MessageResponseType
    verify(
    @WebParam(name="check",
        partName="check",
        targetNamespace="
http://www.example.com")
        CheckType check)
        throws CheckVerifyFault {
    //...
 }
}

This operation throws a CheckVerifyFault. Say that our implementation of the verify method actually calls a second, remote web service that uses HTTPS to validate the check, or goes to a database using JDBC. There might be checked Java exceptions that we want to translate into a SOAP Fault to use to return to the client.

Here's the portType snippet of the WSDL that results from these annotations:

<portType name="CheckVerify">
<operation name="verify">
<input message="tns:verify" />
<output message="tns:verifyResponse" />
<fault message="tns:MyException" name="MyException" />
</operation>
</portType>


While the above code will deploy to a container such as WebLogic, it won't have the desired result on the client.

First of all, JAX-WS will create an exception class for us, which is nice. But the exception class will be called MyException_Exception on the client side. Doing what we want is a more complicated and obscure part of the JAX-WS model, and using exceptions is not quite as easy as other things in JAX-WS.

If we run wsimport before our automated test, then compile the generated code and run the test, we'll see what effect this code has on the client view. And we'll have a good basis for undersanding the client side of this.

First we know that we want to change the name of the generated exception to something more friendly. So let's use bindings file to customize the generated code. You can read more about this in Java SOA Cookbook, but if you're using Maven to run the build that executes your wsimport, you can put a file called bindings.xml in the src/jaxws folder. Give that file the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<bindings
    xmlns="
http://java.sun.com/xml/ns/jaxws"
    xmlns:wsdl="
http://schemas.xmlsoap.org/wsdl/">
    <bindings node="wsdl:definitions/wsdl:portType[@name='CheckVerify']/wsdl:operation[@name='verify']/wsdl:fault[@name='MyException']">
        <class name="MyFault">
            <javadoc>Exception generated during any operation with the service.</javadoc>
        </class>
    </bindings>
</bindings>

This uses XPath to find the node in the generated WSDL that matches the fault with the name of "MyException" and indicates that the generated class should be named MyFault.

JAX-WS will create two classes now: MyFault, which is the JAXB customization re-name of the MyException class, and a class called MyException. That class will be a bean that holds a message.

The generated MyFault class on the client looks like this:

@WebFault(name = "MyException", targetNamespace = "http://www.example.com")
public class MyFault extends Exception {

    /**
     * Java type that goes as soapenv:Fault detail element.
     */
    private MyException faultInfo;


    public MyFault(String message, MyException faultInfo) {
        super(message);
        this.faultInfo = faultInfo;
    }

    public MyFault(String message, MyException faultInfo, Throwable cause) {
        super(message, cause);
        this.faultInfo = faultInfo;
    }

    public MyException getFaultInfo() {
        return faultInfo;
    }

}

The class is annotated with @WebFault, but indicates in its 'name' attribute that it is called MyException, which is the bean class (shown below) that we were renaming in our JAXB XML customization file.

So this is where things start getting weird. Notice that a MyFault constructor takes a MyException type. There is not a no-arg constructor in MyFault. The faultInfo (of type MyException) is expected to contain the SOAP Fault detail information. That is, there is a class (here, MyException, that holds the data element value of the <detail> element child of the <soap:fault> in the underlying SOAP envelope--the exception class is not doing that work for us.

So the first thing to understand is that MyException is not an exception type at all, but a regular bean that acts as a holder for the SOAP Fault information, to ensure it complies with that contract (because a SOAP Fault is not the same as a Java checked exception; checked exceptions don't exist in many languages). Put another way, even if you coded your exception to include a message String along with a getter and setter for it that could hold this info, JAX-WS doesn't know about it, so you need to define it explicitly.

So here is that generated 'exception' class, which is really not an exception at all, and rather a bean that your MyFault class (which actually IS the client-side exception class) accepts.

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MyException", propOrder = {
    "message"
})
public class MyException {

    protected String message;

    public String getMessage() {
        return message;
    }

    public void setMessage(String value) {
        this.message = value;
    }
} //comments deleted

Because the WSDL is valid and JAX-WS generated these classes for you, you might think that everything would work at this point. But it won't. Let's write the naive unit test we expect would work around this code on the client.

public class CheckVerifyServiceTest {

    public static final Logger LOGGER = Logger.getLogger(CheckVerifyServiceTest.class);

    private static final String WSDL_URL_KEY = "checkVerify.wsdl.url";

    private static final QName QNAME = new QName(
            "
http://www.example.com", "CheckVerifyService");

    private static CheckVerify checkVerify;

    private static final String TODAY;
    @BeforeClass
    public static void setup() throws Exception {
        LOGGER.debug("Attempting to initiate service...");
        String wsdl = System.getProperty(WSDL_URL_KEY);
       
        LOGGER.debug("Using WSDL: " + wsdl);
        final URL wsdlUrl = new URL(wsdl);

        final CheckVerifyService service = new CheckVerifyService(wsdlUrl, QNAME);
       
        checkVerify = service.getCheckVerify();
               
        if (checkVerify != null) {
            LOGGER.debug("Found service stub.");
        } else {
            fail();
        }
    }

    @Test
    public void testMe() {
        LOGGER.debug("Executing...");

        CheckType check = new CheckType();
        //....

        MessageResponseType response = null;
        try {

            response = checkVerify.verify(check);

            LOGGER.debug("Completed Exception response.");

        } catch (MyFault ex) {
            LOGGER.error("Error class: " + ex.getClass().getName());
            LOGGER.error("Caught error. Message: " + ex.getMessage());

            assertTrue(true);
        }
    }
}

In our @BeforeClass annotated method we use the generated service stub to get the port type for the service, and use that in our tests.

In the @Test method we invoke the verify method that throws the MyException exception (which we renamed to MyFault using JAXB customizations). So we put a try/catch around it and we should be able to expect that if we do something to make the method throw a fault/exception, that it would be caught here and our assertion would pass and everything would be fine, right? Wrong. The above code doesn't work.

NOTE: The proper way to positively test that your method throws an exception when it is supposed to in JUnit is with the @Test(expected=MyFault.class) annoation attribute. We want to look at the details here, so this is for illustration.

Here's what happens when you run the above test is that the test compiles but results in an ERROR (not a regular test failure):

testMe(com.dte.soa.checks.ws.CheckVerifyServiceTest)  Time elapsed: 0.094 sec  <<< ERROR!
javax.xml.ws.soap.SOAPFaultException: java.lang.NoSuchMethodException: com.dte.soa.checks.ws.jaxws.MyExceptionBean.setMessage(java.lang.String)
        at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:171)
        at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:94)
        at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:240)
        at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:210)
        at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:103)
        at $Proxy33.verify(Unknown Source)


The problematic thing here is this line:

javax.xml.ws.soap.SOAPFaultException: java.lang.NoSuchMethodException: com.example.MyExceptionBean.setMessage(java.lang.String)
      
The problem appears to be that there is no method called setMessage in the MyExceptionBean class. This seems like a bug in JAX-WS, because we didn't write any class called MyExceptionBean, and it's not listed in our classes under the Generated Sources, so how could we possibly fix this?

The answer is to do this on the service side:
1. Write a class that extends Exception.
2. Annotate it with @WebFault and point its faultBean attribute to the name of a Java class that has a no-arg constructor, a message String field, and a getter and setter for it. This will be your carrier for that soap:fault detail element.
3. Redeploy your service and regenerate your client. Now the client view will be exactly how you want it. JAX-WS will take any message you supply to your exception type on the server side and put it in the SOAP Fault detail in the SOAP envelope. It will unpack that string message into the fault bean and make it available as the message within the exception you're catching.

Below are examples of using the @WebFault annotation to deal with SOAP faults and exceptions on the web service side.


We still write the method on the service exactly as before--there's no @WebFault annotation on the method--it's a class-level annotation.

    @WebMethod(operationName="verify")
    public @WebResult(name="checkVerifyResponse",
            partName="checkVerifyResponse",
            targetNamespace="
http://www.example.com")
            MessageResponseType
    verify(
    @WebParam(name="check",
        partName="check",
        targetNamespace="
http://www.example.com")
        CheckType check)
        throws CheckVerifyFault {


Now we'll write that CheckVerifyFault class:

@WebFault(name="CheckVerifyFault",
    targetNamespace="
http://www.example.com")
public class CheckVerifyFault extends Exception {

    /**
     * Java type that goes as soapenv:Fault detail element.
     */
    private CheckFaultBean faultInfo;

    public CheckVerifyFault(String message, CheckFaultBean faultInfo) {
        super(message);
        this.faultInfo = faultInfo;
    }

    public CheckVerifyFault(String message, CheckFaultBean faultInfo, Throwable cause) {
        super(message, cause);
        this.faultInfo = faultInfo;
    }

    public CheckFaultBean getFaultInfo() {
        return faultInfo;
    }
}

This class extends Exception, and indicates that it takes a CheckFaultBean. So in Java web services we don't have the luxury of just using any checked exception that we have lying around; we'll have to annotate it, add the constructors that take our Bean info object, and then create that Bean info class. Here's what that looks like:

/**
 * The Java type that goes as soapenv:Fault detail element.
 * Used in web services exceptions, fault beans just hold the details
 * of the SOAP fault. This one is used by the
{@link CheckVerifyFault).
 *
 * @author eben hewitt
 */
public class CheckFaultBean {

    private String message;

    public CheckFaultBean() { }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}


Now you've got something that matches the SOAP semantics better, and we can recompile and redeploy the web service, then regenerate our client artifacts. Because I've renamed the exception class here, I'll need to update my bindings.xml file too, of course.

We also need to use this bean info in our service method. So instead of just throwing exception, we populate the fault bean with the data for the SOAP Fault Detail, and pass that into our exception; JAX-WS will handle the rest.

Here is our update service operation:

public MessageResponseType verify(CheckType check)
  throws CheckVerifyFault {

        LOGGER.debug("Executing verify method in Check web service.");

        if (check == null) {
                final String msg = "The Check cannot be null.";
                LOGGER.debug(msg);
                CheckFaultBean faultBean = new CheckFaultBean();
                faultBean.setMessage(msg);
                throw new CheckVerifyFault("This is the Basic Message.", faultBean);
            }
    //do work...
}

Notice that we create a bean instance, put our message for the client in that, then construct the exception and throw it. We can include two messages: the one associated with the exception string, and the more detailed message that is the string value of the FaultInfo object.

Here is the updated test case. It passes a null parameter to the verify method. That's just the condition the verify method is looking for to throw an exception:

@Test
    public void testException() {
        LOGGER.debug("Executing...");

        CheckType check = new CheckType();

        MessageResponseType response = null;
        try {

            response = checkVerify.verify(null);

            LOGGER.debug("Completed Exception response.");

        } catch (CheckVerifyFault ex) {
            LOGGER.error("Error class: " + ex.getClass().getName());
            LOGGER.error("Caught error. Message: " + ex.getMessage());
            LOGGER.error("Detailed Message: " + ex.getFaultInfo().getMessage());
           
            assertTrue(true);
        }
    }

Running this test gives us just the result that we want:

7/1/09-17:15 ERROR com.example.CheckVerifyServiceTest.testException - Error class: com.discounttire.checkverify.service.CheckVerifyFault
7/1/09-17:15 ERROR com.example.CheckVerifyServiceTest.testException - Caught error. Message: This is the Basic Message.
7/1/09-17:15 ERROR com.example.CheckVerifyServiceTest.testException - Detailed Message: The Check cannot be null.

...
BUILD SUCCESSFUL
------------------------------------------------------------------------
Total time: 10 seconds
Finished at: Wed Jul 01 17:15:54 MST 2009
Final Memory: 25M/153M

Now you can see that:
1. The test actually allows a totally natural client feel for using Java exceptions and SOAP faults.
2. The string that we populated the exception with on the service-side is readily visible to the client.
3. We get both the regular string message in the exception, and the detail in the fault info bean.

To read more about Java web services and SOAP, pick up a copy of my new  book, Java SOA Cookbook from Amazon.


 

July 01, 2009 in Tech Notes | Permalink | Comments (6)

Recipe for the Perfect Margarita

Living in the southwest, we get an opportunity to try many different kinds of margaritas. This recipe is so refreshing and light and delicious. The proportions might look unusual for a margarita, but it really has a perfect balance. The key is probably the agave nectar, which acts as a binder and gives it a note of natural sweetness.

I think you'll really love it!

Makes 2.

Fill a shaker 3/4 with big ice cubes and add the following:

5 oz reposado (barrel aged to 11 months) tequila
2 oz Patron Citronge
1 oz agave nectar (use the Milagro brand from the liquor section; the nectar sold with honey will be musky and not mix as well. If you can't find Milagro, use the lightest nectar you can find)
1 oz fresh squeezed lime juice
1 oz seltzer water

Shake for 22-25 seconds, which should be about when it's too cold to hold the shaker anymore if you have enough ice in it.

Pour into highball glasses filled with ice. No salt.

July 01, 2009 in Food and Drink | Permalink | Comments (0)

Towards a Rhizomatic Software Architecture

Some slight background:

I have been thinking about the architecture for a particular web site that
needs to be highly available. I started following Randy Shoup's work at eBay,
and the general papers at highscalability.com, which are great.

I studied Literary Theory in graduate school, which meant reading a lot of philosophy.
My favorite was Derrida and deconstruction. I also loved Deleuze and Guattari,
in particular Anti-Oedipus and A Thousand Plateaus.

So I was thinking about how my work has changed since that time, and could I not
incorporate some of this continental French theory of subjectivity to software
architecture.

Miko Matsumura asked on Twitter whether we should think about Business Assemblies rather
than SOA Governance. This made me think of Gilles Deleuze and Felix Guattari's idea
of the Assemblage.

In short, I started thinking about a new kind of software architecture.
Architecture based around the subjectivity of applications.

We build software today as if the application subject is a Cartesian dualist from 500
years ago. I understand that I'm not supporting that statement now.

We build what Deleuze would call "aborescent" software, based on "the oldest and
weariest kind of thought". (See http://www.capitalismandschizophrenia.org/index.php/Arborescence. The diagram even looks like a standard 3-tier web deployment diagram!)

But what would software look like if the subjectivity of the applications was conceived
as rhizomatic, as lines of flight, as a body without organs, following Deleuze--
instead of reflecting a classical conception of unified Man?

This needs to be worked out, of course. This is only a log of initial thoughts.
But I think it would have these properties:

* Becoming & Multiplicity: A multiplicity consists of singularities
that synthesize into a “whole” by relations of exteriority. We (applications) are an
assemblage of multiplicities which is constantly emitting particles which enter and
transform other multiplicities, and which is constantly swallowing up particles from
other multiplicities, which in turn change us (applications).

* Lines of Flight: the dynamic, creative and unpredictable (rhizomatic) connection that
is drawn between one multiplicity and another.

* Body Without Organs (BwO): "It is nonstratified, unformed, intense matter,
the matrix of intensity, intensity=0 ...
Production of the real as an intensive magnitude starting at zero." 

I think it would follow the principles of a Rhizome (http://www.capitalismandschizophrenia.org/index.php/Rhizome):

Connectivity – the capacity to aggregate by making connections at any point on and within itself

Heterogeneity – the capacity to connect anything with anything other, the linking of unlike elements

Multiplicity – consisting of multiple singularities synthesized into a “whole” by relations of exteriority

Asignifying rupture – not becoming any less of a rhizome when being severely ruptured, the ability to
allow a system to function and even flourish despite local “breakdowns”, thanks to deterritorialising
and reterritorialising processes

Cartography – described by the method of mapping for orientation from any point of entry within a
"whole", rather than by the method of tracing that re-presents an a priori path, base structure or
genetic axis

Decalcomania – forming through continuous negotiation with its context, constantly adapting by
experimentation, thus performing a non-symmetrical active resistance against rigid organization
and restriction


Diderot asks this: how is it possible to imitate the Romans if the Romans didn't
have any Romans to imitate?

More to come....

Source for definitions, see:
http://www.capitalismandschizophrenia.org

http://freespace.virgin.net/drama.land/projects/schizoanalysis/index.html

June 12, 2009 | Permalink | Comments (0)

I'm on Twitter

But only ironically.

http://www.twitter.com/ebenhewitt

June 02, 2009 | Permalink | Comments (0)

Kittens!

Alison and I were doing some weeding in our back yard this morning. When she moved a cushion, look what was there:

http://io.typepad.com/photos/found_kittens/

They're unbelievably cute. Their ears are up and they have teeth, so we think they're about three weeks old. There are two boys and two girls. We'll have to figure out what to do with them. In the meantime, they're getting warm veterinarian kitten milk from a bottle every 2-3 hours...

May 02, 2009 | Permalink | Comments (0)

Reader Review of Java SOA Cookbook

This kind gentleman, Arun Batchu, wrote a nice review of Java SOA Cookbook on his blog recently. He was most interested in the JAX-RS chapter. You can check it out here:

http://netrii.com/display/ABB/2009/03/22/Serendipitous+Discovery

Thanks for the nice words, Arun. For what it's worth, I'm not Australian. But I did own two Men at Work albums when I was eleven, so I know the story of Dr Heckle and Mr Jive...

April 07, 2009 in Books | Permalink | Comments (0)

Java SOA Cookbook in Stock Now on Amazon

Java SOA Cookbook is now in stock on Amazon.

Java SOA Cookbook will help you:

  • Construct XML vocabularies and data models appropriate to SOA applications
  • Build real-world web services using the latest Java standards, including JAX-WS 2.1 and JAX-RS 1.0 for RESTful web services
  • Integrate applications from popular service providers using SOAP, POX, and Atom
  • Create service orchestrations with complete coverage of the WS-BPEL (Business Process Execution Language) 2.0 standard
  • Improve the reliability of SOAP-based services with specifications such as WS-Reliable Messaging
  • Deal with governance, interoperability, and quality-of-service issues

You can check it out here:

http://www.amazon.com/Java-SOA-Cookbook-Eben-Hewitt/dp/0596520727/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1238082660&sr=8-1

Here is a link to the book at O'Reilly:

http://oreilly.com/catalog/9780596520724/

March 26, 2009 | Permalink | Comments (1)

97 Things Every Software Architect Should Know Released

Richard Monson-Haefel is the editor (along with Mike Loukides) of this collection of axioms that aim to guide software architects. The book includes contributions from more than 40 authors (I wrote 4 of them).

97 Things Every Software Architect Should Know represents a variety of viewpoints on software architecture, and even if you don't agree with everything, it's a fantastic conversation starter for your next software guy soiree. Sometimes parts of the axioms seem to echo and contrast one another, which turns out to be sort of fascinating, as we kind of overhear what feels like a lively conversation.

It's an easy and fun read, and represents an "open source" book, published by O'Reilly. That is, all of the content of the book is licensed under the Creative Commons Attribution 3 license.

If you're interested in the topic, pick up a copy. It's available from Amazon here:

http://www.amazon.com/Things-Every-Software-Architect-Should/dp/059652269X/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1233780733&sr=8-1

February 25, 2009 in Books | Permalink | Comments (0)

Sun Certified Developer for Java EE 5 Web Services Exam

I'm happy to report that just this weekend I found out that I am among the first people in the world to pass the Sun Certified Web Services Developer for Java EE 5 exam (311-230). I took the beta exam back in November. Because it was in beta at the time, the exam took 4 hours, and then required a few months for the certification team at Sun to normalize the questions. Once they determined which questions to throw out, they determined passing and failing scores.

Even though it's multiple choice, this is a hard test.

Inadvertantly, my upcoming book Java SOA Cookbook (O'Reilly) will serve as a good study guide for the Sun Certified Developer for Java EE 5 Web Services test. If you're planning on taking the test, I suggest picking up a copy, as it covers many of the topics you'll need to understand thoroughly. You have to know WS-I Basic Profile, Security, and you really have to know XML, XSD, the new Streaming API for XML in Java, JAX-WS, REST, and the details and variants in SOAP and WSDL. Java SOA Cookbook covers much of this to the degree you'll need to know it to pass, and focuses purely on the EE 5 stuff.

Good luck!

February 08, 2009 | Permalink | Comments (3)

Java SOA Cookbook Cover

The cover finally got decided for Java SOA Cookbook, which will be in stores March 21 or so. The animal on the cover is a Harlequin Longhorn Beetle, so named for its amazing markings. Here it is:

Java-SOA-Cookbook-Cover

January 31, 2009 | Permalink | Comments (0)

SVNKit

I think I'm going to give this a try: http://svnkit.com/

It's a Java API for interacting with Subversion repositories that gives you access to all of the features in Subversion. Looks slick.

January 19, 2009 | Permalink | Comments (0)

Using MBeans in WebLogic Server 10gR3 to Create an Alert on State Change

These instructions are for WebLogic 10gR3, which lets you do something depending on the value of an MBean attribute. For example, if you want to get notified by email that the server has changed from 'Running' to 'Overloaded' State, you can do that. You need to do a few things:

Set up the Notifier. This is what will be used to send you the notice. You can use SNMP traps, email, or drop a message on a JMS Queue.

Create a Diagnostic Module. This acts as a container for performing all the related diagnostic work you are going to set up.

Create a Collection of Metrics, in which you indicate what attributes of what MBeans you want to capture.

Create a Watch. This is basically a rule that is formed by wrapping an XPath-like comparison expression. It includes a set of simple mathematical operators with your attributes.

Create A Diagnostic Module
Under Domain Structure, go to Diagnostics > Diagnostic Modules
New > Name & Description (Make this a general Name to define multiple Watches and notifications.) In this example, mine is called DomainMonitorModule, and the description is: This module monitors the DTD domain to collect JDBC and Server Health stats.

Save and Activate Changes

Now you have an empty module ready to hold your metrics collection and watches.

Collected Metrics
In the Summary of Diagnostic Modules screen, click the name of your new Module. Click the Collected Metrics tab. Make sure the check box is enabled, and set your sampling period. Set Sampling Period (300000 = 5 minutes) This is the default.
Click New and choose choose ServerRuntime for MBean Server Location from the drop down. Click Next. You'll be taken to the MBean selection page.

Select MBean Type On this screen, you choose the MBean you want to collect metrics for. This can be a custom MBean that you have written. There are MBeans for monitoring server status, GC, classloading, and many more.

Here we'll choose weblogic.management.runtime.ServerRuntimeMBean, which is the same bean that gives the image of the System Status on the lower-left corner of the WL Console.

For a complete list of documentation of WL MBeans, see this page: http://edocs.bea.com/wls/docs100/wlsmbeanref/core/index.html

Once you've chosen your MBean, click Next.

On the Additional Metric Collection Properties page, select the attributes on this MBean that you want to collect data for. Here I'll choose State by moving it to the Chosen box. Other values include Shutting Down, Open Sockets Current Count, and others.

Leave the Attribute Expressions box empty and click Next.

On the Select Instances screen, choose the instance from within your Cluster that you want to monitor. You have to do this for each instance in your cluster.

Click Finish. You should see your ServerRuntimeMBean in the Collected Metrics in this Module section. Click Save, and Activate Changes.

Now it's time to create a Watch and Notification for the metrics you're collecting from the server.

Watches and Notifications
Click the Watches and Notifications tab. Click Lock and Edit so you can make changes. You can change the Severity in the drop down to Warning so that the messages you receive are more meaningful.

Click the Notifications tab and click the New button in the Notifications area.

Give the Notification a Name. I'll call mine DOMAIN-DEFAULT-NOTIFY because it can be used by multiple modules so I don't want to be too specific. Choose for the Type: SMTP E-Mail. You can also choose SNMP Trap, JMS, and others. Make sure Enable Notification box is checked.

Click Next, and you will need to configure the SMTP properties for your emailer.

If you do not have a Mail Session associated with the server, you'll need to set that up now. Here's now:

Create a Mail Session
A mail session allows WebLogic to send SMTP messages. Click Create a New Mail Session. If you are doing this from scratch, you can start in the Domain Structure menu at Services > Mail Sessions and the rest of the steps are the same.
First, give it a name. I'll choose AlertMailer

Then give it a JNDI name. I'll choose mail/alertMailer.

Then specify your JavaMail properties. These values are separated by a semi-colon. You can check the help on this page to see the complete set of values. These are what I'll use:

mail.host=mail.example.com;
mail.smtp.host=mail.example.com;
mail.transport.protocol=smtp;
mail.from=My-Cluster@example.com

Ckick Next, then you'll be on the Mail Session Targets Screen. Associate this Mail Session with the cluster or instances in the cluster that you want. Click Finish.

Now you'll be returned to the Create Notification Screen.

Enter a comma-separated list of email recipients. Stick with the defaults for Email Subject and Body as they will be filled in with runtime values from the MBean.

In the Email Recipients list, I'll use: notify@example.com

Now Save and Activate Changes. You should see EmailNotifier under your list of Notifications.

Now that you have a Nofication set up, it's time to make a Watch.

Watches
You now have a way to send a notice through the Notification, and you have some metrics you are collecting from the MBeans running in the server. Now you need to create a watch to put these together with an expression you want to evaluate the runtime MBean values against, and trigger a notification if necessary.
To create a new Watch, click the Watches tab. Under the Watches area, click New. Give your watch a name. I'll pick a very descriptive name that includes the MBean I'm checking and the server it's running on, because we'll need to repeat this step once for each MBean on each server we're watching. I'll choose this name: SVR-BEA1-S1-SERVER-STATE.

Click Next

Now you have to add a Watch Rule. Click Add Expressions. Choose ServerRuntime from the drop down, click next.

From the drop down, choose the same MBean type you are collecting metrics for. In this case it's weblogic.management.runtime.ServerRuntimeMBean. Click Next.

Choose the Server instance from the cluster that you want. Here we'll choose BEA1-S1. Click Next.

Set the Expression. Choose the attribute of this MBean you want to participate in the expression. Here we'll choose State for the Message Attribute.

Then choose Operator != and Value of RUNNING (it is case-sensitive and others, like the JDBC one, is 'Running').

This returns us to the Configure Watch Rule Expression screen and writes this rule into the text box:

(${ServerRuntime//weblogic.management.runtime.ServerRuntimeMBeancom.bea:Name=SVR-BEA1-S1,Type=ServerRuntime//State} != 'Running')


Click Next and 'Use an automatic reset alarm' to restart the watch. Leave the default of 60 seconds.

Now on the Configure Watch Notifications screen choose the Email Notifier by moving it to the Chosen box.

Click Save and Activate Changes.

Target The Watch
Now choose Targets, and associate it with your server instance. Click Lock and Edit and Choose your server name. Then Activate Changes.
Resulting Email Notice
You're all done. The email alert you'll get will look something like this:

SUBJECT: WatchTime: Jan 13, 2009 2:12:16 PM MSTEMAIL
BODY: WatchTime: Jan 13, 2009 2:12:16 PM MST
WatchDomainName: SVR10DOMAIN
WatchServerName: SVR-BEA3-S2
WatchSeverityLevel: Warning
WatchName: SVR-BEA3-S2-JDBC-POOL-STATE
WatchRuleType: Harvester
WatchRule: (${ServerRuntime//[weblogic.management.runtime.JDBCConnectionPoolRuntimeMBean]com.bea:Name=MyWebDataSource,ServerRuntime=SVR-BEA3-S2,Type=JDBCConnectionPoolRuntimeState} != 'Running')
WatchData: ServerRuntime//[weblogic.management.runtime.JDBCConnectionPoolRuntimeMBean]com.bea:Name=MyWebDataSource,ServerRuntime=SVR-BEA3-S2,Type=JDBCConnectionPool
RuntimeState = Overloaded
WatchAlarmType: AutomaticResetWatchAlarm
ResetPeriod: 60000
SMTPNotificationName: AlertMailer

This email notice indicates that the server was looking for a Not Running state, and found a state of Overloaded, which is a Bad Thing. So it's a Good Thing to know that's going on.

January 13, 2009 | Permalink | Comments (2)

Java SOA Cookbook on Amazon

This doesn't yet reflect the title change, but the Java SOA Cookbook is on Amazon. You can pre-order it here:

http://www.amazon.com/SOA-Cookbook-Eben-Hewitt/dp/0596520727/ref=sr_1_1?ie=UTF8&s=books&qid=1229531553&sr=8-1

Also, I'm not sure how that bio found its way there. That will change; it lists my having written the book as a qualification for writing the book. Hm.

December 17, 2008 | Permalink | Comments (0)

»
My Photo

Recent Posts

  • My Upcoming Speaking Schedule
  • Service Design Review Checklist for SOA Governance
  • 10 Ways to Beat Writer's Block
  • Moving Main Blog to Cassandra Guide
  • A Literary Life: Our Book Reorganization Project
  • Talk Abstracts for Business & Technology Summit 2009 in Bangalore, India
  • 97 Things Every Software Architect Should Know on Kindle, iPhone, in Japanese
  • Using SOAP Faults and Exceptions in Java JAX-WS Web Services
  • Recipe for the Perfect Margarita
  • Towards a Rhizomatic Software Architecture
Subscribe to this blog's feed

Reading

  • Robert Hanmer: Patterns for Fault Tolerant Software (Wiley Software Patterns Series)

    Robert Hanmer: Patterns for Fault Tolerant Software (Wiley Software Patterns Series)

  • Kerrie Holley: 100 SOA Questions: Asked and Answered

    Kerrie Holley: 100 SOA Questions: Asked and Answered

  • Haralambos Marmanis: Algorithms of the Intelligent Web

    Haralambos Marmanis: Algorithms of the Intelligent Web

  • John Hebeler: Semantic Web Programming

    John Hebeler: Semantic Web Programming

  • Steven Bird: Natural Language Processing with Python

    Steven Bird: Natural Language Processing with Python

Categories

  • Articles
  • Books
  • Food and Drink
  • Recipes
  • Tech Notes

July 2010

Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Twitter Updates

    follow me on Twitter