[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-edu-devel
Subject: Re: [kde-edu]: Templates or not ?
From: Benoît_Jacob <jacob () math ! jussieu ! fr>
Date: 2007-11-20 19:05:36
Message-ID: 200711202005.41251.jacob () math ! jussieu ! fr
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
On Tuesday 20 November 2007 18:43:18 Vladimir wrote:
> On Monday 19 November 2007 22:21:16 Benoit Jacob wrote:
> > It will be in *internal* headers and that code will be specialized and
> > compiled into your library's binary. Afterwards, the user only sees the
> > binary. The public headers don't have to contain any templated code, they
> > only need to contain declarations of the types (like Vector3d) which may
> > be templates, but that's not an issue, the bigger part of the code is in
> > your shared binary library, only a lightweight part remains in your
> > headers.
>
> Yes, but in my case the library has only a small number of internal
> classes that can be moved to private headers. Basically there is a World
> class which acts as a container for many (public) classes that represents
> physical entities such as bodies or forces or some utilities such as
> solvers and that should be created and inserted into World by the user. And
> almost all logic is implemented as public or private members of
> user-visible classes. Now I want to have World2d and World3d containers
> that can contain 2d or 3d versions of objects respectively.
If you have the logic in user-visible classes, that means that changing the
logic will typically break binary compatibility. The usual trick to work
around that is to defer the logic to non-user-visible classes. This is
actually part of the general idea of d-pointers -- the logic of a class is
deferred to the d-pointer class. So if you eventually make a binary library,
you will anyway have to make deep changes, putting much more stuff in
non-user-visible classes.
See this regarding binary compatibilty:
http://techbase.kde.org/Policies/Library_Code_Policy
> Ok, so lets postpone this discussion till the meeting. You have already
> helped me a lot, now the problem looks quite clearer for me. Thanks a lot !
Good idea, thanks :) Just correcting a pile of 60 student tests, /me is going
crazy :D
Cheers,
Benoit
["signature.asc" (application/pgp-signature)]
_______________________________________________
kde-edu mailing list
kde-edu@mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-edu
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic