Comments (6)
At the time it seemed like a good idea. There are only a few alternatives to this approach, each with their pros and cons:
-
You could take the API classes and turn them into interfaces. All API functions are made virtual, and then the impl class inherits from the API class. Cost is that you can't have the shared_ptr as a member of the class with this approach. Take a look at the UICore library on my github page to see how such a solution looks like.
-
You could take all the private functions in the impl class and make them private in the API class. This has the disadvantage that the API header may have to include implementation specific headers, which may slow down compile time for programs using the library.
-
You could remove the impl completely. Same disadvantage as #2, but slightly faster as it won't have to access the impl to access private data. Now everything is in the open, for better or worse.
I generally write my libraries nowadays using method 1 listed here, as that still allows me to hide the implementation. ClanLib hasn't been moved over this approach as it would mean every program using it would have to be heavily refactored.
from clanlib.
Thanks for information.
So, ClanLib is built using two techniques:
- Using
imp->
to hide the full interface (effects - acceleration of compilation and deceleration of execution and debug). - Different paths for headers and sources #101.
I may be mistaken, but it seems that this approach is inherited from closed source systems. If this is so, and it makes no sense for an open source project, can we go on to method 3 (not everywhere, but only where implementation is trivial)?
from clanlib.
I didn't have close source systems in mind when I designed it this way. Rather, it was an attempt to leave implementation specific details out of the public header files.
Personally, I'm not going to try change this part of ClanLib's design. I'll be perfectly honest with you, at this point ClanLib only interests me historically as an illustration how I did library design in the 00's. It was great fun to code, especially my interactions with Rombust, Sphair and Mrfun, but I've since then moved on.
I wouldn't mind creating a "ClanLib Next", but the general attitude in the indie gaming world seems to be that you either need to use Unreal Engine or Unity and any other approach is folly. As long as that prevails there's little point as far as I'm concerned. I do play around with some game related stuff on a personal level, but it isn't based directly on ClanLib and it isn't at a level where I want to make it an open source project - at least not yet.
So basically what I'm saying here is that you're more than welcome to improve ClanLib with what you think it needs, but I won't be assisting in it. If you send PR's I'll evaluate them and merge if I don't see anything technically wrong with them. For larger fundamental changes it might be better to create a fork as I can't guarantee I'll approve of it and it would suck if you spent the work just to see me reject the pull request.
from clanlib.
Historically, the main reason the implementation is hidden was to assist with library binary compatibility when it was dynamically linked (e.g. dll's). We could patch the implementation, without the requirement of recompiling each application.
from clanlib.
My thoughts are the same as dpjudas.
I use ClanLib at work, however the code base has now diverged from github containing my specific requirements.
from clanlib.
I do not want to make a fork and lose your experience for advices as long as I can keep backward compatibility. Thanks :)
There is awaiting PR #100 and then continue.
from clanlib.
Related Issues (20)
- Too complicated build system HOT 2
- Border style unfinished HOT 1
- clan::GameTime fault HOT 1
- Webpage error HOT 2
- Property DisplayWindowDescription.is_topmost() does not work on Mac OS HOT 2
- clan::PathHelp::get_basepath win32 drive names HOT 1
- ClanLib 2.2 for super methane brothers HOT 4
- Linux Audio HOT 2
- Clanlib fails to build on aarch64 HOT 2
- Old versions HOT 2
- /usr/share/doc/clanlib-4.1/Reference/html/Core.html is not formatted HOT 3
- Setup/Unix/pkgconfig/clanXML.pc.in: Name false HOT 3
- can't compile Examples/Display_Render/MapMode HOT 1
- sidebar points to old domain that is now taken over by spam HOT 2
- Assessment of the difficulty in porting CPU architecture for clanlib HOT 1
- Dynamic library configuration HOT 4
- ClanLib dedicated server is being removed at end of January HOT 4
- License HOT 1
- Remake `IODevice` from `int` to `size_t` HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clanlib.