[haiku-development] Re: [GSoC 2010] Services Kit API draft

  • From: Stephan Assmus <superstippi@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 14 Apr 2010 23:03:20 +0200

Hi,

On 2010-04-14 at 19:07:43 [+0200], Christophe Huriaux <c.huriaux@xxxxxxxxx> 
wrote:
> I published a rough draft of how I imagine the "Services Kit API" to
> be, in order to offer simplicity and flexibility to developers using
> the Kit. I would like to have some reviews to refine this draft if
> possible.
> 
> Link to the Google doc : http://docs.google.com/View?id=dfc49mzx_7gq8fbgfw

My first reaction is that you put too much functionality into too few 
classes. Why should BURL handle requests and have filters attached and so 
on? I would rather see one class per specific function. BURL is to store a 
URL string and parse its various sections and give access to it. Like 
BURL::Protocol(), which could return "http:" or "file:". It should also be 
easy to compose URLs. BURL should be a class similar to BString and BPath, 
IMHO. Sending requests should be handled via dedicated classes, like 
BNetworkRequest and BNetworkResponse and so on. Different protocols should 
be implemented in BNetworkProtocol derived classes. The smaller you keep 
the building blocks, the more flexible will be the framework. I would 
highly recommend to look at the Qt "network kit" and maybe also the 
Chromium network backend for inspiration. Java is also always good to be 
inspired by. When you have to design a framework, it is very beneficial to 
first look at what's already out there.

It turns out that the Service Kit and the C++ network framework project 
really depend a whole lot on each other. My comments of course relate only 
the network layer, and not even the service layer, but I guess the same 
general advice to use more composition instead of inheritance also applies.

Best regards,
-Stephan

Other related posts: