Pages: [1]   Go Down
Author Topic: Developer Request: Baseclasses and Interfaces  (Read 1204 times)
0 Members and 1 Guest are viewing this topic.
Norway@Oslo
Offline Offline
Edison Member
*
Karma: 13
Posts: 2033
loveArduino(true);
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I would love it if there was some way that all library writers could easily inherit predefined baseclasses when implementing a library for something.

This way we would ensure a intuitive, consistent and clean API for the end user.


There has already been talk about a baseclass for streams/serial objects.

Why not define an API for things like Motors, Temperature Sensors, Range Sensors, things that needs to be polled [like update() or such], things that can be on() or off(), thigs that has a begin() [init() start() construct() setup()] and an end() [stop() destruct() cleanup()] etc etc ?

I have many ideas on this subject, and I have a lot of interface suggestions ready. I'd love a discussion on the matter.
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think it makes sense to define base classes for things that have implementions in the core, like streams.  For other things, it's hard to know what a good API is without concrete use cases.
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

P.S. issue for a serial base class is here: http://code.google.com/p/arduino/issues/detail?id=60
Logged

Pages: [1]   Go Up
Jump to: