[Sugar-devel] [FEATURE] Create an adapter that calls the third parties/libraries for better maintainability.

Alejandro GarcĂ­a tonadevv at gmail.com
Sun Feb 10 19:19:32 EST 2019


 ***************
TLDR; Why not creating an adapter that calls the libraries/third parties
that we use creating activities (like GTK, WebKit, etc) and in the
activities we only call the adapter? For more information read below.
***************
Hi,
I was a participant at GCI 2018, I worked mostly porting to GTK3, WebKit2,
and TelepathyGLib.

Time ago I read the book "Clean Code - Robert C. Martin", there he (Uncle
Bob) talked a little about using Adapters (what I mean for adapters are
files with methods and classes that call the libraries for us. And we
instead call the adapter instead of the library/third party) when using
third parties. That way you can use the third party in all the app, but if
there is an update in the third party you only need to change one place
(the adapter).

After reading that, I thought how easy could it be if there were an adapter
for Gtk, WebKit, and TelepathyGLib instead of changing all the instances of
them in each Activity.

Basically that's the proposal. Why not creating an Adapter for the
libraries that are used in mostly all the activities like GTK and start
using it from all the sugar activities.

Advantage:
- The maintainability of the projects could be easier, as you only need to
change one place in case that the library gets an update (probably useful
in case of porting to GTK4 in a future, I think its release is going to be
at the end of this year).
- Developing new activities could be easier too, learning GTK (or any other
library) won't be necessary at all.

Probably there are more advantages that I'm ignoring.

Disadvantages:
- Creating this adapter will require time and people, and this can sound
like reinventing the wheel. But the dependency to the libraries/third
party, will be reduced.

Again there might be more disadvantages that I'm ignoring.

I think that's all. If you have something to say, don't doubt to do it. I
want to know what you think.

This is the first proposal that I do to an organization. If there is a
template that I didn't follow or the Feature tag is incorrect, please tell
me and I can rewrite this mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20190210/a59c582a/attachment.html>


More information about the Sugar-devel mailing list