Sunday, 13 April 2008
RESTful Service Descriptions
- Where the URI "entry points" are. Where do you start? If you have resources representing a customer, where EXACTLY are they. If I want to look up customers, do I start at http://myco.com/customers or at http://myco.com/accounts? If you think this is silly because somebody could just tell you, then I say two things: first, even a small company probably has 2000 different entities of interest. URI's are never supposed to change in a perfect world. In the real world, they change all the time, especially for dev and test environments inside the firewall. On the internet you probably use a search engine, read blogs, or get emailed a link. Google doesn't typically index inside the firewall, so this doesn't help. The other options don't scale.
- Metadata about parameters OK, so you know where to go to ask for a filtered set of your favorite entity. What parameters can you put into the URL, which are mandatory, what are their datatypes, and what are the allowable values? Once you know the entry point above, you can do a GET request and get back some nice document with links galore to things of interest (as in "hypermedia as the engine of application state"). Great, how do you specify the start date and end date? Do you have to specify the account name? If so, what's the parameter called? Can you specify the maximum record size to return? etc...
- What media types are used Can I get purchase orders in JSON? XML? as an ATOM feed? Pretty simple question. You can get this via HTTP HEAD and/or by setting the accepts request header. Sounds like we don't need this in the service description, right. Well, you often have to do gap analysis before you have physical access to a service. You need to figure out things like: When they come on line with purchase orders next month, will they support JSON or do we need to submit a change request? If you have their latest service description, you know the answer. If that document changes, you can ask questions about why things where added or removed because you have something tangible to compare to.
- Which HTTP operations can you access In theory, this is what HTTP OPTIONS should answer. In reality, who knows what the answer to HTTP OPTIONS looks like. It should probably be the relevent service description document. So rather than replacing it, HTTP OPTIONS becomes a way of retrieving it.
- What validity constraints exist on the media types If you are using XML, what schema, DTD, relax-NG description applies? This is a big open issue. For the same reasons as above telling me to "get one and look" doesn't work. More fundamentally, you cannot infer a global constraint by looking at instances that happen to obey it. This problem has been mentioned by several people: stu, Stefan Tilkov, James Strachan, and Dan Diephouse
Technorati Tags: rest wadl jersey jsr-311 soa
Monday, 24 March 2008
Tilkov on Doubts About REST
- REST may be usable for CRUD, but not for “real” business logic I agree with Tilkov, that REST actually doesn't map cleanly to CRUD, and I agree that if your only goal is to wrap resource access with business rules, REST can work just fine. I think Tilkov would have made a stronger point if he discussed the paradigm of "hypertext as the engine of application state" as part of workflow business rules. This highlights the fact that security often needs to be a maintained statefully, but this is another question.
- There is no formal contract/no description language Tilkov gives three answers. First that you can RESTfully access constrained XML documents. That's a weak answer because there's no way to know or discover beforehand what the XML schema at a given URL will be. And if it changes, there's nothing to confront the service provider with to say "look, you don't comply with your contract". Second, he says you don't need contracts as you'd have to read documentation anyway. That's laughable. All those WSDLs we use daily for SOAP, we don't need. OK. The third answer is WADL and WSDL 2.0. This, of course, disproves the previous two answers, except that they are both extremely young and need to mature. You can't answer the first two ways and the third way simultaneously! The problem with WADL and WSDL2 is that most REST advocates believe the other two answers and aren't creating tooling around these standards. They have this unreasonable fear that embracing contracts will take them on the path towards WS-* hell.
- Who would actually want to expose so much of their application’s implementation internals This one is batted down pretty handily. With REST you still control what is exposed and what is not.
- REST works with HTTP only, it’s not transport protocol independent I don't buy this answer. The talk about HTTP vs TCP is downright strawman-ish. You actually are starting to see things like SOAP over JMS occasionally, and when AMQP delivers true platform independence, I expect messaging based SOAP will take off.
- There is no practical, clear & consistent guidance on how to design RESTful applications This is a cultural thing with the REST community. Somebody should write a REST Cookbook. There are too many arguments about how this or that is not RESTful with no base of examples that are RESTful. Atom is not enough. Tilkov's strawman comparison to WSDL/SOAP is weak. There are plenty of books that take you step-by-step on how to design a SOAP service. They don't have to agree: "best" practices can be written in stone when the space stops evolving.
- REST does not support transactions It's agreed that distributed transactions often (even usually) aren't needed. But I shouldn't have my web services architecture decide this for me. There ARE cases where architects want to use these. Global consistent data is very important is many inventory or financial systems. It's also often needed for reliable messaging as discussed in the next bullet. That said, if I need transactions, I usually switch from SOAP to JMS to avoid the WS-* yuckies.
- REST is unreliable Well, I actually think WS-ReliableMessaging is weak. It's support by various SOAP stacks is spotty. When I want reliability, I usually move to JMS, often dumping SOAP in the process. WS-Death-* is SOAP's weakness. That said, idempotency is not a solution, come on. These require the client to rely on behavior from the server to verify the message is received. You need contracts to do that in an automatic way. The other solutions are an attempt to start creating WS-* equivalents. Technically it could work, but these are curiosities, not standards with widespread adoption. Really, the moment you have contracts (see #2) you have a mechanism where you don't need human intervention at design time.
- No pub/sub support This one is bunk. He gives Atom as proof. With some standards, there could easily be ways to POST or PUT a callback url, too, for peer to peer interactions. Also see the next question. Contracts to allow discovery would be nice (see #2).
- No asynchronous interactions He should mention Comet. But POST or PUT of a callback URL could work for peer-to-peer interactions, or simply hand the client of the URL to poll. His idea to use response code 202 is a little weird. Contracts to simply declare support for a particular standard would be nice.
- Lack of tools He's right that if you use XML formats, you have all the same tools. HTTP is otherwise pretty universally embraced. However, full access to all the HTTP methods besides GET and POST is occasionally problematic. REST lags far behind when it comes to service contracts, of course. In fact, I predict it will be the SOAP stacks that first close this gap for REST when they embrace WSDL 2.0. There need to be better client side tools for operating on particular contract standards, too. For example pub/sub is easy if your client knows how to post its callback URL because it sees a standard pub/sub mechanism is declared. Tooling means making these standards and making clients that use them transparently. REST can hopefully skip some of the WS-* hell, but it can't skip all of it. In summary, I still think REST contracts need to mature (but it looks like progress is starting). Once this happens, standards and tooling can deal with the rest. It's not clear how REST can avoid the WS-* debacle that SOAP went through. But many of the ten doubts really have been dispelled.
Technorati Tags: rest soap
What is Software Architecture?
Technorati Tags: architecture rest roa soa
Thursday, 20 March 2008
ROA vs SOA: The Uniform Interface
Technorati Tags: rest soap roa soa web-services uniform-interface
Tuesday, 12 February 2008
The Need for Distributed Version Control in the Enterprise
Monday, 21 January 2008
Java on the Decline? Think Again
- Java is the most popular language, capturing 20.8% of the popularity
- That lead increased over second place C (now at 13.9%) by 3.6% over a year ago
- Java's absolute popularity increased from a year ago by 1.7%
- Ruby's popularity is 2.3% ranking it 11th
- Python was the biggest gainer over the last year, growing 2.0%, giving it 6th place
- Python overtook long time rival Perl for the first time this year
- Visual Basic (now 3rd) was the second biggest gainer, Java was 3rd
- Ruby's popularity actually fell 0.17% over the last year
- Perl, ranking 7th, is still more than twice as popular that Ruby
- C lost the most ground at -1.89%
- C++ lost the second most ground at -1.7%
- C++ fell to 5th, as it was overtaken by both Visual Basic and PHP
- PHP gained 1.25% in popularity over the year
- Java is more popular than VB and C# combined (aka .net) which total 15.7%
- Delphi at 3.3% surged ahead of both Javascript and Ruby.
- Lua ranks 16th, up from 46th
- Groovy ranks 31st
Technorati Tags: java ruby python C C++ PHP VB C# programming
Thursday, 15 November 2007
GCal & Lightning/Thunderbird
I'm the kind of guy who adopted linux as my primary desktop years ago. I've been lucky enough to use it at work exclusively for almost two years, and I've used it at home exclusively for five or six years. Windows actually feels really strange to me now. One issue that has been a big pain at work was calendar support. Finally I think I've found something that makes me happy: I'm using Thunderbird with Lightning and the Provider for Google Calendar. A good write up on setting this up is here.
Finally I think I have a good setup that meets all my needs. First of all, my Calendar has to live in my email program, so I can get meeting invitations and hit "accept" and it's on my calendar. There are a lot of email programs for linux that I don't like, so this was a limiting factor for a while. I need one with good support for multiple mailboxes and lots of features. I also want to be able to get to my calendar from anywhere. I use a VPN at home a lot to read my email as I somewhat dislike webmail. I want to not care which box I'm "accepting" the meeting message on. Also, I want to have a browser bookmark to my calendar or be able to navigate to it from somebody else's browser if I don't have my computer.
I actually think this combination has advantages over Outlook (besides being open source and working on any operating system). GCal and Lighning finally solve my calendar issue, so I can cross one of my biggest annoyances off my list. Now if I could just get an open source driver for my ATI graphics card, I'd be very happy.
Technorati Tags: gcal lightning thunderbird
Sunday, 11 November 2007
Yes you do need a Product Road Map
You've got to love David Heinemeier Hansson. He may be the new Mark Fleury: always ready to give you his opinion on why everything you know and do is wrong. His latest: a little essay on why product road maps are harmful.
While it's good to question the sacred cows, I'm not so sure that 37signals has really sustained growth over a long enough period of time to deserve any special credibility in this arena. There is an arrogance that often comes to upstarts who produce some innovations and get market success and I suspect DHH is surfing in the wake of his own big head on this one. You would think that if it actually worked to ignore customer input and just innovate, that it wouldn't have taken until 2007 to discover it. Certainly there has been no shortage of really smart people who tried to ignore their customers (I just can't remember any who were successful over the long laul). Yet it seems like the old rich guys all say the same thing: listen to your customers like they are God, because they are.
The problem with DHH's argument is that it is a cynical straw man. He assumes that having a road map and peddling vaporware are the same thing. They are not. The fact that road maps can be and are often abused by "bullet point" management only proves that the abuse is bad, not tool used by the abuse. Good companies almost by definition execute well on their road maps.
I suspect "most people can make do without [a road map]" is the kind of idea that only occurs to small companies who are growing really fast. While you have the big growth, you tend to take customers for granted, though most don't have the nerve to celebrate it like DHH. If you lose a few customers in that situation, who cares: you can't grow fast enough to accommodate them all anyway. Unfortunately, the problem with this is that it never lasts and sooner or later you'll wake up and find you aren't the hot thing anymore, and you'll realize that your customers have no loyalty because you've treated them like crap for years in terms of discussing their needs, desires, and goals. Once the market buzz has died, it's a whole lot better to be eBay than AOL.
DHH compares software product road maps to big upfront software design in the derided waterfall software development methodology. By the way, I recently saw Dan Pritchett of eBay say that they use waterfall. He was almost apologetic about it, during a talk about how they solve their insane scalability problems, but I digress. Even assuming that big design up front is bad for software design, I disagree with the point. Product management and software design are not at all similar. Examine java: it's hardly developed waterfall style. Most of the agile principles out there originated or found early homes in the java community. Yet java has a roadmap created by the Java Community Process and Sun's (and IBM's and BEA's and Oracle's) business strategies. The road map serves as a direction to unify cooperation. It makes the strategy tangible.
Want to know what's going to be in Java 7? It's there in detail. Want to know what's going to be in Java 8? It's there too. See something you like and want to help, click the link. For example, coming is JVM support for for dynamically typing for scripting language support, which will make groovy and jruby substantially faster. Did Sun have a road map when they hired the jruby team? Yes, you bet they did. And jruby is already at par performance-wise with ruby, and Glassfish will leverage this to be the most scalable app server for rails. Did they have a road map when they added ruby support to the Netbeans IDE? Yes, you bet they did. Did Java have a road map when they created groovy? Yes, it's called JSR-241. If DHH really believes that road maps are harmful, I suspect he's happy that there seems to be a road map within the java community of equaling or bettering all of the purported innovations of RoR within the java stack. Sooner or later, no matter who you are and how gifted, one of your competitors will innovate and jump ahead of you in some area. What do you do then? If you are smart and humble, you put closing the gap on your road map and rally your people on how to do it. If you want to lead, you have to tell people generally where you are going, unless you want to attract sheep. Maybe you do, but sheep aren't that lucrative.
Nobody can sustain their business on ground breaking innovation year after year. Do companies that innovate more do better, yes. Can innovation jump start you from where you are? Yes. Is innovation the only thing that matters, long term? No. Once you've innovated, you've got to get and keep customers. Tivo is a great example of an IT company that missed this point. The jury is still out on whether Rails has any long term staying power. I predict Rails is more like Tivo than like the Macintosh, but we'll see.
The simple fact is that people don't spend money on non-commoditized things unless they have confidence in the road map. That includes both customers and investors. I have personally been part of several large dollar purchases of software (the kind will more than one comma in the price), and you can be damn sure we asked vendors about and factored into our decisions the vendor's road map. The road map tells you whether they understand you or not. If you don't want me as a customer, don't have a road map.
Technorati Tags: product road-map
Thursday, 6 September 2007
ROA and SOA and Service Contracts
- Contractual vs Not - SOA offers contractually, discoverable interfaces, while and ROA expects designers to solve problems as they see fit.
- Rich vs Uniform Behavior - ROA has the uniform interface applied with minimally overloading, while SOA provides rich, discoverable behavior
- Differentiation vs Equivalence of Data and Metadata - SOA relies on metadata to inform behavior, while ROA uses connectedness and design time conventions for representations and URI's to blur data and metadata together.
- The server that hosts the service
- The URL path structure to the resource you want
- The required and allowable query parameters after "?" in the URL
- What values are allowable for each parameter
- What type of response you will get back
Technorati Tags: roa soa web-services REST SOAP WSDL interfaces
Wednesday, 5 September 2007
Comparing ROA and SOA
- Open Standards - HTTP, XML, XML Schema, SOAP, WSDL, various WS-*
- Loose Coupling - Service consumers do not couple to implementation platform, but instead rely on open standards or metadata.
- Reusability - Services are intended to be highly reused. The goal is a single authoritative service, meeting the needs of all consumers.
- Contractual - Services adhere to an interface agreement artifact (a service description) that is functionally definitive of the interface.
- Discoverability - The service contract is an outwardly descriptive and externalizable metadata artifact suitable for forwarding by 3rd parties to potential service consumers
- Autonomy - Services have control over the implementation of logic and technical machinery they encapsulate.
- Statelessness - Services generally do not maintain conversational state, Every call is self contained.
- Rich Behavior - The service contract exposes many kinds of method invocations and associates them logically with the data structures described in the service description.
- Metadata - Both requests and responses have a clear delination between metadata and payload.
- Open Standards - HTTP, often XML, possibly XML Schema or DTD
- Loose Coupling - Service consumers do not couple to implementation platform, but instead rely on open standards.
- Universal Addressability - Resources have a URI which serves as a single global name that defines their identity.
- Uniform Interface - All resources support a small and standard set of behavior methods (GET, POST, PUT, DELETE). Often only GET and POST are used.
- Behavior Conventions - GET never has side-effects, and anything without side-effects should use GET. PUT and DELETE should be idempotent (repeating them has no additional affect).
- Statelessness - Services generally do not maintain conversational state, Every call is self contained.
- Representations - A resources can have tangible representations as bits in various MIME types, but the resource is different than the representations. Representations of a resource may vary with time, and the set of available representations can also grow and shrink over time.
- Connectedness - A resource can (and should) reference other resources by name (URI) in the representation.
- Autonomy - Resource providers have control over the implementation of logic and technical machinery they encapsulate, subject only to the uniform interface behavior conventions.
- Minimal Overloading - parameters to state changing operations should not be used solely to select different behaviors. Heuristically, if an operation parameter could be converted to part of the URI, then it should be.
- Contractual vs Not - SOA offers contractually, discoverable interfaces, while and ROA expects designers to solve problems as they set fit.
- Rich vs Uniform Behavior - ROA has the uniform interface applied with minimally overloading, while SOA provides rich, discoverable behavior
- Differentiation vs Equivalence of Data and Metadata - SOA relies on metadata to inform behavior, while ROA uses universal addressability, connectedness and design time conventions for representations and URI's to blur data and metadata together.
Technorati Tags: roa soa web-services REST SOAP
Saturday, 1 September 2007
Architectural Paradigms 2007
- Service Oriented Architecture (SOA), typically using SOAP as the dominant web service. This is probably the leading architecture motivating IT spending these days.
- Event Driven Architecture (EDA), typified by asynchronous message notifications and message buses. Messages are often XML or serialized objects.
- Resource Oriented Architecture (ROA), typically using REST based web services, often with XML payloads. This is a relative newcomer and represents a mesh of a backlash against SOA and a progressive fundamentalism over the symmantic web.
- Event Stream Processing (ESP), stateful analysis of streaming messages turning SQL on its head by storing queries and issuing data. This is just too new, but it's definitely an exciting area to watch. Maybe in 2008 the big debate will be over stateful vs stateless bus architectures.
- Enterprise Service Buses (ESB), Many see EDA and web services as complimentary and wrap Enterprise Service Buses around both to handle routing, transformation, and encapsulation of providers and consumers. I see an ESB as an enabling ingredient, but not an architectural paradigm that stands alone. Bobby Woolf, co-author of Enterprise Integration Patterns agrees. That said, a good question is: "When should I mix in an ESB to my enterprise architecture?". I may blog on that separately.
Technorati Tags: soa soap rest roa WebServices architecture
Thursday, 30 August 2007
ISO: Standards For Sale - No Standards for Standards
Technorati Tags: iso ooxml fraud sham
Sunday, 26 August 2007
MS OOXML and ECMA 376 are a Sham
- The standard is impossible in practice to implement from scratch
- The standard appears to specify the MS Office document format
- The standard fails to specify MS Office document format
- Proprietary floating point operations. Excel stores numbers in it's file format that differs from what was typed into the cell, and is transformed by unspecified proprietary floating point operations. For example, the proper way to express "12345.12345" in MS Office file formats can be verified to be <v>12345.123449999999</v> which is not based on an open standard. If you enter <v>12345.12344</v> Excel will not treat this as if you had entered "12345.12345" in the formula.
- VML. VML is a proprietary format for drawings. It is not specified by OOXML and is required by MS Office as it is pervasive in Word, Excel and Powerpoint documents. MS calls it "deprecated" but uses it extensively.
- Proprietary Date formats. When you enter a date literal into a cell in Excel, a string representation of that date is serialized into the XML. Much like the case with floating point operations, the meaning of this string is defined by a proprietary, undisclosed standard.
Technorati Tags: microsoft ooxml open-standards sham
Friday, 24 August 2007
The Case Against Software Patents
- Foundations. Software is an expression of ideas, not an invention. Patents should not apply.
- Utility. A software patent grant does not, cannot, and will never be capable of achieving the public benefit necessary to justify it. In the arena of software, patents stifle innovation more than they reward it.
- Practicality. The patent process cannot make proper determinations with regard to the standards for patentability within the arena of software patents, nor is it likely to be able to within reasonable budgetary bounds.
Technorati Tags: software-patents patents