Tag Archives: rest

Shoot for simplicity

I really loved a couple of phrases from the Ted’s blog post “Agile is treating the symptoms, not the disease“: the title and the last sentence: “We are in desperate need of simplicity in this industry.”.

Complexity

Writing software it is still way to complex in these days.
I can recall few attempts to make it easier, they all failed: Java Enterprise & EJBs, Web Services, Enterprise Service Bus.
Rather than making things simple they forced you to write more code, to use lots of xml, tons of libraries, implementing unnecessary interfaces.
How many days do you waste every time you start a project, just in infrastructure & build files?

REST seems so simple, but implementing REST in the right way seems always so damn complicated, so everybody writes RESTish services, a good progress compared to old style web services but still…

What about web applications?
I like the simplicity that can be achieved with Sinatra, Scala , WebLocks and Seaside.
But still, the impression is that nobody is trying hard enough to make all these things even simpler.

The Twitter example

I’ve started using Twitter only few months ago (even if I’ve the account since 2006…), it started to make sense when I’ve linked it to my Facebook account. Facebook is like software in these days: way too complex.
Too much stuff, too much noise, too difficult to get what you really want.
Then I’ve started to use TwitterFeed as well, I’ve my flickr, google reader and tripit profiles feeding the twitter account.
So we have three content providers, one content consumer and forwarder and one content receiver, it’s a fairly complex architecture and it never failed so far, it’s quite stable, it just works.
I didn’t had to write a line of code, I’ve pressed just few links, it all works using RSS in a RESTish way.

Simplicity

How do you imagine software development in ten years?
I do imagine it like in the twitter example, an aggregation and collaboration of few simple services working together.

The role of the Agile movement

Agile is treating the symptoms, it’s true, I’ve seen many times agilists (including me) preaching for the old good principles (don’t reinvent the weel, keep it simple, etc) but how many times do we have to rewrite the same software?
For how long will we have to rewrite the same objects, the same business logic?

Why are we still writing web applications like ten years ago? Why are we still using Spring, Hibernate, Databases, Layered Architectures?

I think it’s time for laziness, simplicity and more real reuse, somebody told me that it’s an utopia, but even only trying will make the IT world a better place to be.

Agile can cure the disease

The Agile developer community, being so open minded and always embracing chance has a great chance to change the way software is written.

There’s not so much new from a process point of view in these days (at least, that’s a complaint that I’ve heard from many people, especially coming back from big Agile gigs), but there’s so much work to do on the technical side of things.

The NoSQL movement is one of the signs that something new is just born and growing, don’t miss the opportunity.

Database Options

I’ve been an ignorant for years, I’ve used hibernate, I’ve listened to DBAs, clients, architects and I’ve ignored all the persistence options available.

My previous post was arguing the need of an RDMS, there are another two DB types missing from that list:

Hadoop and MonetDB are two “popular” Column Oriented Databases, the first one is modelled on the Google BigTable whitepaper, the second one claims to be the fastest opensource RDMS, I found throught its website a link to the Transaction Processing Performance Council page.

With not that much surprise on almost all the test of the TCP Oracle performs quite badly!

The more interesting database at the moment IMO is CouchDB, quoting from the home page:

Apache CouchDB is a distributed, fault-tolerant and schema-free document-oriented database accessible via a RESTful HTTP/JSON API. Among other features, it provides robust, incremental replication with bi-directional conflict detection and resolution, and is queryable and indexable using a table-oriented view engine with JavaScript acting as the default view definition language.

CouchDB is written in Erlang, but can be easily accessed from any environment that provides means to make HTTP requests. There are a multitude of third-party client libraries that make this even easier for a variety of programming languages and environments.

Spring Facts

  1. Spring Java Configuration is the answer of Rod Johnson to all xml haters, with javaconfig you can configure the whole Spring IOC in pure Java
  2. Spring Autowiring with Annotations will lead you to a more readable and smaller xml configuration file
  3. Spring Transactions with Annotations will let you fine-grained configuration of your service layer transactionality
  4. Spring and Terracotta play together very well, if you’re worried about HA/Clustering have a go
  5. Spring and REST: the version 3 of Spring will let you write RESTful service with just a couple of annotations
  6. Spring Testability is unbeaten: there’s nothing as easy to test as a POJO, in addition to that Spring offers autowiring and transaction managment inside the tests
  7. Spring OSGi: assuming that OSGi is a good idea Spring is already there
  8. Spring is not a silver bullet but you’ll have to point me a gun in order to consider EJB3 as an alternative

You might want to keep an eye on these four opensource project…

  • Apache ODE (Orchestration Director Engine) executes business processes written following the WS-BPEL standard. It talks to web services, sending and receiving messages, handling data manipulation and error recovery as described by your process definition. It supports both long and short living process executions to orchestrate all the services that are part of your application.
  • JBoss DNA is a new unified repository system that is JCR-compliant and capable of federating information from a variety of systems. To client applications, JBoss DNA looks and behaves like a regular JCR repository that they search, navigate, version, and listen for changes. But under the covers, JBoss DNA gets its content by federating multiple external systems (like databases, services, other repositories, etc). This way, the unified repository content stays up-to-date and in sync, even though the external systems still own the information and existing applications still work. Plus, JBoss DNA sequences the content in the repository, extracting patterns and structured content that makes the repository more useful and effective.
  • Convergence is a project aimed at integrating Computational Grids with In-Memory Data Grids (IMDG)

Data repository

  • repository for storing flexible records in Amazon SimpleDB manner
  • CRUD
  • underlying storage is HBase – distributed storage for massive data hosting – Learn more…

Logs repository

  • Collecting logs from many sources/interfaces like (remote) files, JMS, HTTP and dedicated API

API/interface

GUI/Console interface

  • GUI interface with many capabilities
  • Trace/control Core module in real time

Tracing events (CEP/ESP)

  • Registering logical events that can be identified and used in rules
  • Rules can trigger specifing events to alert/trigger another events on some specific circumstances

Metrics

  • Measuring time of invocations – record time/context before service is invoked and after
  • Collect metrics reports for specific services

Processing (data)

  • Collected data can be processed by scheduled, automatic tasks
  • Unification of models can be done using adaptive processing
  • Aggregating, normalizing,…

Session management

  • Providing session token based authentication/authorization across multiple applications
  • Authenticate once and be logged to entire federation of applications, SSO

Application monitoring

  • Monitoring services
  • Report failures

OSGI integration

  • The application is supposed to be an OSGI bundle