Centralizable configured compile-time class instantiation

Jesse Phillips jessekphillips+D at gmail.com
Wed Jul 13 09:35:05 PDT 2011


shd Wrote:

> 2011/7/13 Jesse Phillips <jessekphillips+D at gmail.com>:
> > You say no to libraries
> 
> That's not true! I'm not sure how did you came up to this conclusions,
> but i love libraries for applications same as command-line programs
> (like ffmpeg) for GUI apps.

It comes from, "and APIs are not what i'd love to work with[...]"

A good library provides a good API. You build reusable code by creating a library that defines interfaces and routines that can be used by many applications.

You make a library replaceable by providing defined interfaces and routines that another library can mimic.

You generally don't provide a project that allows swapping out an implementation detail from a compiler switch, such as which Associative Array library to use. If you are doing graphical display you might want to support rendering to Cairo or QT or Windows Forms, but this means you will have to write the code that works with them. Or you'll have to define the API for which your library expects of a graphics rendering library and the person wanting to use one will need to write a wrapper for one of these libraries to conform to your API. This means they will have to write some code and will be using their own build setup and not one you have provided.

I hope I'm being a little helpful, or at least you can see where I'm getting confused. Anyway it seems you got something workable (I was hoping someone else would pick this up if I asked the initial questions and it worked).


More information about the Digitalmars-d-learn mailing list