rb_cdio: subclass or module?

  • Thread starter Claudio Bustos Navarrete
  • Start date
C

Claudio Bustos Navarrete

Hi:
I'm the developer of rb_cdio, a library to create bindings for libcdio.
I'm currently implementing the audio related functions of the library. CdIo=
::Cd is the base class and there are 5 methods related to CDDA: play, stop,=
pause, resume and subchannels(retrieve current information, like state of =
device, time and others).
I have to methods to create a Cd object: CdIo::eek:pen (a la File::eek:pen) and C=
d.new
Now, the question: is not very correct implement the audio functions on the=
Cd object by default. So, I have two options:
- subclass: create a CdIo::Cdda class, subclass of CdIo::Cd. So, CdIo::eek:pen=
could instance the correct class according to the disc type. The positive =
consequence is that is easy to verify that the new object is a cdda type
- extending: create a CdIo::Cdda module. In CdIo::Cd, if the disc is cdda t=
ype, I extends the class with the audio methods. To me, is the best, becau=
se I easy to handle cd with mixed contents.

Can you give some advice? Thank you in advancec.
=20
Excuse me for my poor english (spanish is my native language)

--=20
Claudio Bustos Navarrete
Psic=F3logo
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,172
Messages
2,570,934
Members
47,477
Latest member
ColumbusMa

Latest Threads

Top