473,387 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

A question about library extensions and namespaces

Hello,

say I want to extend an official GUI library by a new widget class. And say,
this library lies in its own namespace. Should I embed my new class as well
in that particular namespace, even if it's not officially a part of the
library?
I'm talking about gtkmm. I'm implementing a file browser widget and I'm not
sure if it's a good or bad idea to put it in the Gtk namespace.

Thanks in advance,
Matthias
Jul 22 '05 #1
3 1028
> say I want to extend an official GUI library by a new widget class. And say,
this library lies in its own namespace. Should I embed my new class as well
in that particular namespace, even if it's not officially a part of the
library?


Logically, if you plan to ship your extensions with a given library (by
contacting the maintainers for example), these should go in the same
namespace. If not, it is usually better to use another namespace.

As far as the language is concerned, the use of namespaces prevents name
clashes. If, for example, one of your class extends or modifies the
original, using your own namespace will allow you to keep the same name.
Jonathan
Jul 22 '05 #2
Jonathan Mcdougall wrote:
Logically, if you plan to ship your extensions with a given library (by
contacting the maintainers for example), these should go in the same
namespace. If not, it is usually better to use another namespace.


I don't plan to ship it with gtkmm. It's more of an (optional) extension you
can easily embed in your gtkmm apps. It's a Gtk::ScrolledWindow in fact.

So I better do not put it in the Gtk namespace.

Thanks,
Matthias
Jul 22 '05 #3
>>Logically, if you plan to ship your extensions with a given library (by
contacting the maintainers for example), these should go in the same
namespace. If not, it is usually better to use another namespace.

I don't plan to ship it with gtkmm. It's more of an (optional) extension you
can easily embed in your gtkmm apps. It's a Gtk::ScrolledWindow in fact.

So I better do not put it in the Gtk namespace.


If that's not part of the gtkmm library, it does not logically belong to
its namespace.
Jonathan
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Simon | last post by:
Hello. I wanna use my dynamic shared library(built with C language) with php script. (PHP version is 4.0.6) So I making a shared library(*.so) in Solaris environment(2.7) and it is successful....
6
by: sandwich_eater | last post by:
using g++ in cygwin... sv.cpp:13: warning: passing `double' for converting 1 of `int abs(int)' extract... #include <stdlib.h> #include <Math.h> double pythag(double a, double b)
13
by: tsoukase | last post by:
Hello, two questions: 1) Why is a library a collection of compiled source-files while each header-file is a single source? Would it be more efficient if they were both either compiled or not?...
4
by: BCC | last post by:
Hi, I have a need to read in a very simple xml file and initialized some objects from the data. I was reading on the ms website that .net contains its own XML parser, and it sounds pretty good...
3
by: =?Utf-8?B?TWljaGFlbA==?= | last post by:
Hi, I have been upgrading to AJAX 1.0. I removed this line from my config file: <add assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>...
6
by: Juha Nieminen | last post by:
Whenever one sees example C++ code basically anywhere, be it in a book, in a tutorial in the internet, in an online forum or whatever, I would estimate that at least in 99% of cases one sees the...
1
by: bb | last post by:
Hi, Is there any specific reason(s) that there is only one namespace 'std' in the standard library? e.g. namespaces are not really independent, name collisions etc. Should one consider not...
1
by: Yan | last post by:
Hi, I'm apparently far from being the 1st one to meet this error... My asp.net ajax page requires ScriptManager.axd but gets a 404. following a lot of "This is how I solved it" posts, I : -...
6
by: Curious | last post by:
I was asked to create a C#.NET Console Library project that contains two sub-libraries. And each sub-library contains multiple utilties. As an experiment, I've created a Console Library project...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.