473,322 Members | 1,522 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,322 software developers and data experts.

Reference to base namespace in a class.

Hi,
I'm working on a project where we're juggling with two potential
implementations.
In the two scenarios, we create objects in the base namespace. These
objects are interdependent, in the sense that to compute something,
they have to look up the value of the other objects (their parents).
The objects are functions, by the way, with some additional attributes.
In the first scenario, as the objects are created, they immediately
share references and can call each other's value. All these objects are
then referenced in a class that defines some methods accessing those
objects. The advantage is that you can call the functions from the base
namespace and they'll know where to look to make the computations. The
downsize is that if you delete one object by mistake, nothing works
anymore, that is, the methods from the class will no longer reference
the right objects.

In the second scenario, as the objects are created, they only know the
name of their parents, and don't have their actual reference. To
compute something, we have to pass the values of the other objects
explicitely. A class is then instantiated, where we look up the
__main__ dictionary for the names of the parents given by each
function, copy the objects inside the class, create an attribute for
each object on the fly and link the objects together using the parents
names. The advantage is that even if an object in the base namespace
is destroyed, the class methods will still work since the references
are all internal to the class instance. The disadvantage is that the
objects in the base namespace are dummy objects, ie they don't speak to
each other.

I guess it's hard to understand the context from this quick
description, but the code would look equally opaque.

Here is an attempt to put that into a simple question:

Are there counter indications to reference objects in the base
namespace from a class ?

Thanks for your help.

David Huard

Dec 12 '06 #1
0 884

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

Similar topics

10
by: Tony Johansson | last post by:
Hello Experts!! This class template and main works perfectly fine. I have this class template called Handle that has a pointer declared as T* body; As you can see I have a reference counter in...
4
by: .pd. | last post by:
Hello, I have a control derived from a 3rd party control. My control sits in a class library. I have an app referencing my class library. When I compile the app, I'm told: ...
3
by: Poewood | last post by:
Okay here are four classes for a pocket pc program: Input, fpositional, ComboBoxArray and TextBoxArray. The "input" class is the form. I use the fpositional class to handle most of the functions...
2
by: FredC | last post by:
OS Name Microsoft Windows XP Professional Version 5.1.2600 Service Pack 2 Build 2600 Total Physical Memory 1,024.00 MB MDE 2003 Version 7.1.3008 ..NET Framework 1.1 Version 1.1.4322 SP1...
3
by: Adam | last post by:
We have a web site that uses .vb for the web pages and .cs for a class module. We are getting the error in .NET 2.0 and VS 2005 beta 2. It does work with .NET 1.1. When trying to access a page...
9
by: MSDNAndi | last post by:
Hi, I have the following problem with VS 2005 (Professional) and C# 2.0 I will use assembly and namespace synonymously here. I have a class in namespace InheritClass inherit from a baseclass...
0
by: Richard Gregory | last post by:
Hi, I have the wsdl below, for an Axis web service, and when I select Add Web Refernce in Visual Studio the proxy is missing a class representing the returnedElementsType (see reference.cs below...
2
by: Paul | last post by:
I have a class that references/consumes a webservice, and I would like to split that class into a base class to be used as a based for classes in each of two class libraries/DLLs. I have...
0
by: =?ISO-8859-1?Q?Jan_Thom=E4?= | last post by:
Hi, I've been trying like a madman to make my WSDL work with .net, but it seems I am out of luck. Whenever I add a service reference to Visual C#, the code gets generated fine, however all...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.