Hi Joep,

I agree with all the arguments you give. Where I disagree, it's the way it's 
implemented. Yes, serial software and hardware should have the same API if 
you plan to switch between them, and no they shouldn't have the same API if 
they can be used both at the same time. Since they *are* used at the same 
time, API are different. But you should have the choice...

The problem I see here, is we need another layer on top on this, and this 
layer can't be implemented because we lack features within the compiler. 
Mainly conditional include I'd say, but I see more (I don't want to say more 
here, but that's mainly about functional programming and "real" namespaces, 
and I don't even know if it's reasonable to think about this whereas we're 
talking about PIC...).

So what can we do right now ? Compromises. Serial hw and sw are used both at 
the same time, so API are different. i2c not, so same API (i2c not, mainly 
because it's adressable, so doesn't make sens to have hardware and software 
at the same -- though I'm sure I can find a funny example :)). LCD not, 
because... we decide not (though I don't agree 100%, but that's ok, that's a 
compromise).

Maybe the last jalv2 2.4h features could help to build higher layers, I'm 
thinking about "pragma nostack" (and even old "pragma inline" feature). I 
don't know, we need to try, but I think this is for a (the) next release. For 
now, and IMHO, we need to deliver what we've got, what we've integrated to 
the repos, with advantages, drawbacks and compromises... We need to meet 
users, I think they'll help us having another point of view, and feed the 
discussion.


Cheers,
Seb


Le Saturday 11 October 2008 14:08:14 Joep Suijs, vous avez écrit :
> Hi,
>
> I can't deliver my 2 cents, so I'll pay 1 cent interest below ;-)
>
> Or to put it in other words: I don't have an consistend view on this
> topic. There is however one thing that I concider important, and I
> want to share with you (again):
>
> Some libaries provide similar functionality in different ways, like in
> hardware + software (or for serial, even hardware implementations with
> and without flow control).
> And both examples have something else in common: chuncks of code are
> build on top of it are often reusable that call the libs from many
> point within that chunck. For example a menu on a serial port or a
> procedure that writes a block to an eeprom (and deals with blocks size
> and address).
>
> Of course can't have those libraries (that provide similar
> functionality in different ways) exact the same interface because this
> would limit all future enhancements. But they do at least share a set
> of basic interfaces.
> It is valueble to keep the name of this common interface the same, so
> adaption of the code chunck mentioned is reduced to the minimum.
>
> For i2c hardware and software I implemented it this way. Consequence
> is that it's not so easy to use them both at the same time, but this
> disadvantage is much less then the possibility to change the
> underlaying lib with litte adaption.
>
> Similar, I want to have the same interface on all serial libs. And
> probably als on lcd libs.
> 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.
>
> Joep
>
> 


-- 
Sébastien LELONG
http://www.sirloon.net
http://sirbot.org

--~--~---------~--~----~------------~-------~--~----~
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