Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 06-14-2006, 01:22 PM   #1 (permalink)
blackhock
Registered User
 
Join Date: Jun 2006
Posts: 1
blackhock is on a distinguished road
Creating APIs

Hi,

We are developing an application for which we want to create an API. The API should allow client applications to call functions in a daemon process. A simple scenario: A client would call a function in the API binding and pass it some objects, these objects and some control information would be transferred to the daemon process, which would then execute the appropriate function passing it the objects it received.

Note: This client-server model is local, and development is in C++.

We evaluated all the IPC methods for moving data between the client application and the daemon, and in each of them, found that they lack some features in another and impose restrictions not found in others. And thus, to achieve the scenario above, we would have to hack our way and use several IPC mechanisms together to achieve the desired behaviour.

For example, with Unix Domain Sockets, we would have to convert each object from and to a string representation, which sounds like too much overhead. Shared Memory would impose many problems, specifically in releasing the memory, and with dynamically expanding objects, and similarly, FIFOs and Pipes have their share of problems.

Now the question is, how do APIs are generally designed? We looked at D-BUS, but it doesn't have a (usable) C++ binding. Are there other libraries available? Is it really the only way to mix several IPCs together, aren't there any "prettier" ways?

So, to put it in another way, we are not looking for just any way to implement an API, we're looking for an efficient way. We can come up easily with straightforward, inefficient methods, like converting the objects to string or XML and passing them around, but we would rather use a library that is commonly used, and tested.

Thanks in advance.
blackhock is offline   Reply With Quote
Old 06-14-2006, 01:58 PM   #2 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 598
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
I think a message passing interface would work out better. Basically your API would expose a set of objects, or rather message accepters and your client programs would send either ASCII or binary string to the message accepting objects (via unix or network sockets) and recieve binary or ascii strings in return.
It's much more seperated and clean than actually serializing objects and reconstituting them in each program.
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Dynamic One Dimensional Array sde Standard C, C++ 9 03-02-2006 07:39 AM
Creating and Using a 2 dimensional Vector (vector of vectors) xytor Standard C, C++ 2 09-12-2005 02:35 AM
creating directory problem salmanjoo PHP 1 08-21-2005 08:56 AM
Help with creating surrounding tag nefiga HTML, XML, Javascript, AJAX 0 05-16-2005 02:57 PM
dotnet Data Access reader vs adapter, and MySQL APIs vs SQL2k sde MS Technologies ( ASP, VB, C#, .NET ) 3 12-04-2003 06:45 AM


All times are GMT -8. The time now is 08:15 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting