Understanding the Service Oriented Architecture (SOA)

It’s a pretty old term this SOA. A software engineer (or systems integrator) normally associates it to the interface based software design. Just take a bunch of components, define interfaces between them and implement those interfaces. Then each component suddenly can be called a “service”.

Intuitively a service is something that you have an interface to and something that you don’t care about how it’s implemented.

There is a trend on the Web that websites expose their APIs to the outside world. E.g. YouTube, GCalendar, Twitter, etc. So suddenly those webapps become “services”.

Consequently the Internet is a platform for running a huge application called “Web” that is designed in SOA way, where each site is (should be) a service.

Unfortunately we are still not building our webapps to support this. We’re stuck with our software engineering mentality while we actually need to switch to Web engineering.

I think every feature of any webapp should be a service. Why coding and implementing your own contact form, your own blog, your own newsletter subscription module, your own user profile pages, etc.? Even if you have those features in your software package out of the box…

Looks like I’m trying to promote mashups, but that’s only the tip of an iceberg. Imagine that you have a website that you properly Web-engineered. Say you built the contact form feature as a service and it’s hosted on the cloud. And this feature is integrated into your CMS. There is a cool outcome at this point: you provide yourself with a SaaS solution. So you can actually start renting it to others as well. Ok maybe renting SaaS contact forms is not your core business… so what about doing it with the core business features? E.g. social graph, status updates, shopping cart, etc.?

Probably not everyone will go this way but just look at the beauty of this all, we’ve got services like getsatisfaction.com for feedback collection, discuss.com for comments, gravatar for a personal picture, openID for login, etc. etc. etc. The more a service is specialized the more useful it is.

For instance, a business model for Twitter could be renting their status updating feature to various social networks. Anyway every one of them are reimplementing it: LinkedIn, Facebook, MySpace, etc. Such a waste of time.


Posted from my Android

You Know, “running a business…”

As soon as I tell somebody that I’m starting a business with several friends – I get a question: “what kind of business”. And here a difficult part starts… At this early stage of 101senses it’s pretty difficult to explain what we’re trying to do, what we’ll be in 1-3 years, what motivates us, etc. In fact, when I take a moment and think about it then things become quite straightforward and clear. So let me describe what 101senses is all about.

We are currently 5 guys in the team and we want to do fun stuff. The current job is a bit disappointing: you get on a project, you talk to clients, you start building a solution hoping that the client will have guts to go with something fancy and innovative. But then you end up in this quality vs. time vs. money triangle, and you just do what you have to do, not always what you want to. Well, that’s IT consulting.

From several e-commerce projects I learned one thing: e-commerce is a good business. It’s much better than building e-commerce solutions for others. For instance, a private sales module for Magento community edition costs 110$, and guess what’s the revenue of a private sales e-shop…

But doing commerce is tough, and it’s totally different from what me (and most of the 101senses team) is used to, because a big part of the business (at least in the beginning) is not virtual. One has to look for products that sell, people that buy, models that generate cash. All in all, totally new challenges from the ones in the IT world. So now we have the saying “IT part is easy”. It’s a lot of fun to observe how five guys are struggling with product sourcing and otaku searching – the two things that people have been doing for ages.

As a start we decided to sell stockings for girls. Besides the fact that for guys it’s very exciting to deal with this kind of a product on a daily basis, there is real business rationale behind: stockings have a nice margin, take little space, and are easy to ship. So why not? Also if you look around the Web it’s crammed ugly and difficult to use e-shops. In the times of the person-centric Internet this does not make sense and is an area for healthy competition. It’s obvious that an e-shop that provides great user experience but the same products will win. We set an objective for 101senses to strive for the best customer experience in our e-shops. Prettify is going to be our first attempt.

Nowadays it’s quite easy to implement an e-commerce solution we decided to work on 2 shops in parallel. We call them ShopA and ShopB. Prettify is currently our ShopA. The goal of it is to be able to test our process, i.e. get a product, sell it, and deliver it to the customer – no other requirements. ShopB is going to be based on a concept. It could happen that it will be an evolution of the ShopA but it’s not excluded that it can become a totally different shop from Prettify. We’re working on that by reading about exciting commerce and following various twitterers. We’re also running from one conference to another, from one meet-up to another (check our calendar) and we’re keeping an eye on fashion in general. It’s getting more and more interesting everyday.

Most importantly we’ve got culture of openness and sharing at 101senses. There’s no point in hiding what we do and how we do it. I believe it builds trust in the virtual reality – the Internet – the same way honesty does it in real life.

To summarize:

  • we’re 101senses and we want to learn and do fun stuff
  • our first product is stockings on Prettify
  • at the core we’ve got the culture of openness and sharing
  • we like to engage into a public conversation online
  • we strive for technological innovation and great user experience on our e-shop

Some Experience With Google Wave

For my personal projects I’ve got Trac setup (OForge to be more precise). Recently with several friends we started working on a new project – 101senses.ch – and for it we adopted Google Wave as a collaboration tool.

Actually we started with the wiki on Trac. But after jumping on the wave wiki naturally became obsolete, old fashioned, inconvenient.

Some observations about GWave:

It reminds a wiki in some sense, just that collaboration happens real-time. You don’t have to browse through versions and diffs just to see recent updates.

The functionality of folders is ua bit cumbersome or sometimes even useless. At least I was not able to find any good use for them. The only thing I do is to apply a label “Meeting” with the saved search feature.

I start to fear that as the number of waves increases it will be quite a mess. Even now with 20 waves we already have duplicates. And there is no way to unshare a wave or delete it for everyone.

I really need workspaces. I’m working with different teams on different projects and mixing all the waves in the same pile just makes me loose an overview.

Widgets are cool but where do I find them? Would be great to have some kind of an app market on the web.

It’s really great that GWave is open. Because I can extend it with my apps or change it with my own UI. I think it makes a lot of sense. If eventually GWave is adopted as a collaboration platform then we can expect many nice SaaS solutions showing up on the web. The competitive advantage will be determined by a set of features and the user experience, and we won’t need to care about data portability.

- posted from my Android

“Liepsnojantis ledas” (“HotIce”) ir Šiaip Pamąstymai

Šiauliai, 2009-12-27, “Liepsnojantis ledas” – renginys, kurio džiaugiuosi nepraleidęs. Ir ne vien dėl to, kad ant jo neįtikėtinas figūras raitė įvairiausi čempionai, bet ir todėl, kad kažkuriuo momentu supratau, kaip visa tai yra gražu.

Grožis yra sudėtingas dalykas ir man, savamoksliškai besigilinant į meną, jis ne visuomet apsireiškia. Pavyzdžiui, galiu klausytis Mocarto ausis pastatęs, bet kažkaip nepasiekia jis manęs, o va išgirdus Debussy, iš karto užlieja gerumo banga.

O kas ten dėjosi! Moterys sukdamosi skraidė. Vyrai jas kilnojo ir mėtė į viršų. Broliai mindė viens kitą su pačiūžomis ir vartėsi kūlvirsčia. Vieni krito, po to kėlėsi, po to greitai, kaip vilkelis, sukosi. Kiti ne tik kojų, bet rankų ir net kaklo vikrumu vertė publiką aikčioti. Stuburo lankstumas, špagatai, salto… Jergutėliau, ir tai ant ledo, su pačiūžomis!

Ačiū Povilui Vanagui ir Margaritai Drobiazko už jų Dailųjį Čiuožimą! Už tą romantišką plaukiantį šokį, kuris nuteikia taip pat gerai, kaip atlikus ar bent susiruošus atlikti kokį nors gerą darbą. Tai taurina, moko pajusti, gerbti ir didžiuotis vertybėmis.

Turi žmogus, matyt, kažin kokį receptorių, apie kurį per biologijos pamokas nemokina, nes jį nelengva įsprausti į trijų eilučių apibrėžimą. Pas kiekvieną jis sudirginamas vis kitaip ir pasireiškia savaip. Pavyzdžiui, jeigu nugara nubėga šiurpuliukas, reiškia kažkas buvo pasakyta, sušokta, pamatyta, perskaityta, patirta… negi ne? F. Dostojevskis sakė, kad Grožis išgelbės pasaulį. Aš juo tikiu.

Linkiu daug šiurpuliukų ir užliejančių bangų ateinančiais metais.

Šiauliai, 2009-12-27, “Liepsnojantis ledas” – renginys, kurio džiaugiuosi nepraleidęs. Ir ne vien dėl to, kad ant jo neįtikėtinas figūras raitė įvairiausi čempionai, bet ir todėl, kad kažkuriuo momentu supratau, kaip visa tai yra gražu.

Grožis yra sudėtingas dalykas ir man, savamoksliškai besigilinant į meną, jis ne visuomet apsireiškia. Pavyzdžiui, galiu klausytis Mocarto ausis pastatęs, bet kažkaip nepasiekia jis manęs, o va išgirdus De Bussy, iš karto užlieja gerumo banga.

O kas ten dėjosi! Moterys sukdamosi skraidė. Vyrai jas kilnojo ir mėtė į viršų. Broliai mindė viens kitą su pačiūžomis ir vartėsi kūlvirsčia. Vieni krito, po to kėlėsi, po to greitai, kaip vilkelis, sukosi. Kiti ne tik kojų, bet rankų ir net kaklo vikrumu vertė publiką aikčioti. Stuburo lankstumas, špagatai, salto… Jergutėliau, ir tai ant ledo, su pačiūžomis!

Ačiū Povilui Vanagui ir Margaritai Drobiasko už jų Dailųjį Čiuožimą! Už tą romantišką plaukiantį šokį, kuris nuteikia taip pat gerai, kaip atlikus ar bent susiruošus atlikti kokį nors gerą darbą. Tai taurina, moko pajusti, gerbti ir didžiuotis vertybėmis.

Turi žmogus, matyt, kažin kokį receptorių, apie kurį per biologijos pamokas nemokina, nes jį nelengva įsprausti į trijų eilučių apibrėžimą. Pas kiekvieną jis sudirginamas vis kitaip ir pasireiškia savaip. Pavyzdžiui, jeigu nugara nubėga šiurpuliukas, reiškia kažkas buvo pasakyta, sušokta, pamatyta, perskaityta, patirta… negi ne? F. Dostojevskis sakė, kad Grožis išgelbės pasaulį. Aš juo tikiu.

Linkiu daug šiurpuliukų ir užliejančių bangų ateinančiais metais.

Arrange Fields in Trac Tickets

I was struggling one day to organize fields in the order I want when I create tickets in Trac.

  1. Copy templates/ticket.html into trac/myproject/templates/ticket.html
  2. Insert the following code snippet to the beginning of the template:
  3. <?python
      # define the order
      field_types = ["type", "priority", "milestone",  "keywords", "cc",  "component"]
    
      # Sorting function
      def sort_nicely(field1, field2):
        try:
            idx1 = field_types.index(field1['name'])
        except ValueError:
            idx1 = 1000 # no match, push to the end
    
        try:
            idx2 = field_types.index(field2['name'])
        except ValueError:
            idx2 = 1000 # no match, push to the end
    
        return cmp(idx1, idx2)
    
      fields.sort(cmp=sort_nicely)
    ?>
    

That’s it, if you have any custom fields and you want them ordered, put them into the field_types list.

Magento and Drupal Integration

There are numerous ways to integrate Magento with Drupal. Here I will share my experiences while working on that with very smart people at Optaros. I don’t take credit for all the points in this post, because they are the product of the whole team.

The motivation for this kind of integration is the innovative look into where e-commerce is moving. To get a grasp of it look at OCentric. To keep it short, content is free advertisement for products. It allows customers to get more input about products and provides the meat for search engines to index.

Briefly, there are several main approaches to integrate Drupal and Magento:

  1. let Magento be the main component, while leaving Drupal just as a subcomponent
  2. let Drupal be the main component, and have Magento as an e-commerce  module
  3. let  both Magento and Drupal be main components

These are general approaches and each of them have different pros and cons. They will be further detailed by usecases, complexity, technicalities, etc. in the following sections.

Moreover, we will release much of the code as open source, so it’s not only a theoretical discussion here:)

Magento as the Main Component

This is probably the most acceptable approach in terms of implementation complexity. Moreover you can choose different level of complexity to implement.

The straightforward solution is to integrate on the service layer. Meaning that whenever we are on the e-shop product page we have to call a Drupal service to bring related content, for instance blog posts. The same holds for category pages. How to do that:

  • Create a Drupal module that allows you assigning categories and products  to a content node in Drupal
  • Implement XML-RPC client on Magento side and use it to talk to services on Drupal in order to pull the content (e.g. using view.get or node.get funuctions)
  • Rewrite the category and product controllers on Magento to take the content from Drupal into account

There are some challenges in taking this way. They are mainly for those who want to implement features in a generic way. Specifically, whenever you add a CCK field or a feature like rating to a content type, you have some work to do on the Magento side. Namely, you need to modify layout and write templates to handle this additional data coming from Drupal. Hence it’s pretty cumbersome to use Drupal community contributed modules as you need to do some coding on Magento side for every new Drupal feature. This is quite easy when the content from Drupal is read-only, but as soon as you want commenting, rating, flagging, etc. it becomes an issue, because you need to not only redo rendering on Magento but also map the functionality.

A more complex path to take  is to integrate the whole Drupal rendering engine into Magento, however, this means a very tightly coupled architecture… Still, if you plan to use many many many of the Drupal features it may make sense. This will require writing a Drupal module for Magento that will adapt every Drupal core function to Magento. Could end up as a very complicated solution.

We chose the XML-RPC because of the given time frame and specific requirements. Normally a product or a category will be associated with a very specific set of content types, and therefore the fully generic solution may not pay off.

By the way there is already a CMS module for Magento as part of the core. And the question is why would one want to struggle integrating Drupal instead of using that CMS module? Moreover, with enterprise 1.6 version of Magento the module offers quite cool features. Some things from the top of my head to consider:

  • Drupal has a solid community, and it is more stable and feature-rich than the Magento CMS module will ever be (of course it’s good as soon as you make the Drupal-Magento integration reasonably flexible)
  • There is the CCK module that allows to very quickly add additional fields to a content type and make it available to the content producing team
  • Content versioning, workflow, etc. is easy in Drupal
  • …more ?

Drupal as the Main Component

This approach has been already taken by others and you can start digging for it here. We’ve tried out the available modules but didn’t stick with them… Basically there the implementation is based on the notion of synchronizing Magento products, categories, orders, etc.  into Drupal using a cron job.

In general, although Drupal-as-the-main-component approach in the end may give a lot of  flexibility, it may be too complex to implement. Imagine that the whole Magento frontend functionality needs to be rewritten for Drupal. Magento would then only be an e-commerce backend (the admin part) accessible via Web services. Of course you’d be able to use plenty of Drupal modules as well as flexible templating without any hassle, have better performance, and many other goodies but it just looks too expensive to implement.

Still, bringing only a part of Magento into Drupal makes a lot of sense (as in that module that synchronizes products and orders into Drupal using cron job). In this case it’s a decision to make whether the site is more about content or about commerce. When it’s about content, then you don’t really care about SEO for products, fancy business logic, etc.

Both Mangento and Drupal as the main Components

This is reasonable when the content will be displayed on the Drupal site and e-shop on the Magento site. Meaning that no proxying for content happens behind the scenes. So if a product has a blog post attached, then on the product page you’ll have a link (maybe even the post itself loaded using Ajax call) and clicking it will open a Drupal page with that blog post.

One of the challenges here is to maintain two different themes in order not to harm user experience. So that when the customer clicks on the blog link inside the product page the blog is displayed with the same look and feel as the shop. For that you can’t avoid coding on two different frameworks. Apart from theming SEO will have to be also maintained on both components.

Another challenge would be the ability to mix content with product information on the same page. Some kind of communication on the service layer will be necessary for that, which means that it’s not really reasonable to use this dual approach with such a usecase present.

It may make sense, however, to take this path when there are only some of the things to be shared between both components, e.g. users, and everything else is completely separate. For example, when a company has an e-commerce site, a customer community site, and a corporate site.

Additional Points for Integration

The end user display is only one part of the story. When you integrate this kind of monster systems to work seamlessly you get trapped with other things besides templating.

One of them is single sign on. A good thing to do here is to use CAS. Drupal already has the CAS module. Magento, however, needs one (we’ve been writing one). The good news that all the low level protocol implementation is available for PHP as open source.

Another thing is search. Independently of the integration approach chosen eventually you want to search for products and content in the same search box. This may become pretty challenging but it’s not impossible. We’ve got a proof of concept for the store front in Magento, where we leverage Solr search. It performs really well for our suggest box functionality.


There are numerous ways to integrate Magento with Drupal. And here I will share my experiences while working on that with very smart people at Optaros. asdfa sfd

asdf adsfasdf asdfasdf

Interactive Projection

I wonder if there is a technology that allows interaction with a projection. I was looking around the Web but all I could find was fancy and expensive (multi)touch screens.

I think it should be somehow possible to track hand movements from the outside only by means of a little camera and software; similar to the way eye tracking software works.

Imagine you put a little device that is watching how you are doing a presentation by projecting slides on a wall. As soon as you wipe the wall the next slide eases in; you zoom in/out with two hands the same way you achieve that with two fingers on iPhone; when you want to fast forward a movie you wipe with the faster movement; etc.

Probably the challenge would be not to stand in the way of the tracking device and, of course, to clean the wall you’ve been touching after lounch:)

Is HTC Hero for the left handed?

Recently I obtained an HTC Hero and I really like it. I’ve never had an iPhone but my friends say it’s pretty much the same. I say that it’s the same but better. I always prove that with the Google Sky app.

One drawback though is that the “back” button (used very often) is on the bottom right of the device panel. So when you hold it in your right hand it’s physically very uncomfortable to click that button. I mean very.

Content Maganement with the Delegated Features as Services

As a friend of mine pointed out:  there used to be a server and many terminals, currently we have a bit more sophisticated terminals – PCs – and our big server is the Internet, where the apps are “on the cloud”. Nice analogy, and for me it makes a lot of sense. Are we really coming back to the terminal-server age but in a more advanced, i.e. distributed version?

Anyway I think that every feature in a Web application should be a service. Not a service in a sense of a mashup or SOA, but in a bit different sense.

Let’s take a simple example – Drupal. It’s a content management system. The power of it is that it’s extensible with new modules that are normally contributed by the community. These modules implement different features, such as rate the content, comment, spam filter. One of the nice ones that I really like is made by the Drupal inventor Dries Buytaert, called Mollom. In fact it’s a gluing module for the Mollom service, the service does spam filtering for your site. Specifically, when a person presses the “Save” button, the post first travels to the Mollom service, and then is checked if it’s spam, in case it looks suspicious the user has to fill in a CAPTCHA in order to save the post.

Now consider that all the modules in Drupal had the Mollom nature. That is the module would just be the glue for the service which lives somewhere on the cloud.

A simple content driven site based on Drupal could be quite easily implemented with what’s available out there. Consider a site for video sharing, kind of YouTube but maybe not so generic. At the core is Node – the most primitive content type made of title and body. And now let’s add features as services:

  • Comment the node – Disquss.
  • Control the spam – Mollom.
  • Let users send the feedback about your video sharing service – Zendesk.
  • Rate the content – Outbrain.
  • Share the content – AddThis.
  • Video upload and related features – Kaltura.

What else? Well there is one more piece that I think is very important:

  • Social graph management. There are many services available out there starting with Facebook and finishing with QQ. These services expose APIs so there are also gluing modules for Drupal available. There is one caveat with social graph management. What features one wants to map, is it only friending or also status updates, picture sharing, etc. The purest approach would probably be to have a gluing module in Drupal that only uses authentication and friending features of the social service.

All in all, I strongly believe that paying for a feature as a service is better than paying for (re)implementing and maintenance of that feature. So it’s like SaaS but on a feature level, not the whole application (feature set).

Audiobooks Social Network

I like books.  Recently I got attracted by audiobooks. This looks like cheating a bit, because it’s not pure reading, however, I must say it’s far from cheating. Listening requires (at least for me) even more attention than reading.

Anyway, I am now keen on audiobooks, and as it usually happens, my experience with the Web comes into play. So I started thinking whether it is a valid idea to build a social site fully dedicated to audiobooks – or more generally reading text aloud and listening to recordings.

Let me analyze the idea of this social site in several axes.

Social object

Clearly the social object would be a piece of read aloud material. For simplicity we can think of a chapter of a book. When all the chapters are available the whole audiobook is there. Interestingly, an audiobook can be assembled into one even if each chapter is read by different people.

Social activities

We’ve got chapters of audiobooks as downloadable files on the site. There will be two kinds of people visiting the site: those who submit their readings to the site and those who will want to download audiobooks. Besides all the usual features like sharing, bookmarking, chatting, reviewing, flagging, rating etc. audiobookers will need some special tools and features, such as: audioconferencing for real time multicharacter recordings, a friendly avatar that impersonates the reader, rankings of the best (popular) readers, transcription of audio into text for search engine optimization, and so on.

Technicalities

Software-wise everything looks solvable. It’s just a Web site maybe with AIR desktop applications for reading aloud, saving, organizing, listening, etc. to books. The greatest challenge is how to ensure that the reader is reading the book the way it was written. And then, how to ensure that the readers will correctly name the pieces they read so that they (semi-)automatically could become one audiobook. Probably this is only achievable by croudsourcing and social filtering.

Business case

All the materials on the site should be available for free because it’s community generated content. Still there are plenty of opportunities for paid services. For instance:

  • assemble audiobooks out of separate chapters for those who don’t have time to do that by themselves;
  • sell professionally read audiobooks; allow the readers selling their recordings and take a percentage from each transaction;
  • provide additional tools for readers to promote themselves and get statistics;
  • organize paid events where book authors read aloud a chapter or two of their books;
  • use the audiobooking infrastructure for voice recordings management system as a service;
  • etc.