On 13 Oct 2008, at 22:41 , Sebastien LELONG wrote:

>>> I can imagine this is less relevant for temperature sensors, because
>>> the interaction is less complex: each sensor is read at one place in
>>> the program and the result is taken for processing. So switching
>>> library only requires limited changes in the main program.
>>
>> These are the limited changes I mean: a search-n-replace for
>> "hd44780", to replace with "serial", for instance.
>> This way the namespaces do not collide, everything is clear and still
>> easy to change.
>> And yes, you can use both at the same time.
>
> I'm not sure to understand this "search-n-replace" thing, I assume  
> this is
> about program, not libraries. What is sure is, if you build a  
> library on top
> of another one, you can't  "search-n-replace" anymore...

You can, by replacing the device names and saving is as a different  
file. I'm not too sure one should build libraries on specific device  
libraries, though. format.jal and print.jal do this, but in very  
general terms.

>> With the function first, the purpose is also clear, to newbies as
>> well. It goes a long way to defining a common API for all libs, like:
>>
>> read_temperature_celsius_device()
>> read_temperature_fahrenheit_device()
>> send_status_byte_device()
>> read_status_byte_device()
>
> That is ? You want function_device() instead of device_function() ?

It is a compromise between device-specific libs and a common API.  I  
like it, because it also sets some rules for the general API as well.
Things like:

read instead of get/pull/receive/etc
send instead of set/write/etc

These are only examples! Serial libs should use send/recieve, EEPROM  
libs read/write, etc.

And yes, I want function_device(). This already holds for the file  
name too.


>> There are already things about namespaces I've added a few days ago
> (see "Filenames, variables, procedures naming convention"). I think  
> what you
> say here is already in it.

It is. I missed it.

---
ir EE van Andel [EMAIL PROTECTED]  http://www.fiwihex.nl
Fiwihex B.V. Wierdensestraat 74, NL7604BK Almelo, Netherlands
tel+31-546-491106 fax+31-546-491107



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to