473,513 Members | 2,595 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Design Question

Hi I have a Architecture question.
(Put the text on courier new font to understand the graphic)

Imagine that you have the next objects:

A = Form
B = Panel
C = ButtonEx inherit from Button
D = BUtton

Then when the program start the objects are allocated on the next Way
------- ------- ------- -------
| ----->| ------>| <====>| |
| A | | B | | C | | D |
| | | | | | | |
------- ------- ------- -------
When the application start:

Load form A
Form A add the Panel B
Panel B add Button C
D Functionality is "close" the panel B.
D Can't be added to Form A has to be part of B

Case 1)
Application is Stable and working.

Case 2)
When you press the Button D send a signal (event) to A.
A Dispose B and B is remove from Controls A
Here is the problem:
Some times, may be once a day, the application HANGS.
Debugging I could see that A Dispose B but after the signal,
the program has to come back to D to finish the method.
And I guess D is invalid because is already Disposed.

Case 3)
When you press the Button D send a signal (event) to A.
A DON'T Dispose B and B is remove from Controls A
Here is the problem:
Some times, may be once a day, the application HANGS.
Debugging I could see that A DON'T dispose B but after the signal,
the program has to come back to D to finish the method.
And I guess D is already take by the GC because the
reference A <-> B was deleted.

So, the question is how D can inform to A that A has to
remove B in a secure way?.

1) D when signal (push button) set a Flag on A, A has a timer
and check for this flag, if this flag is ON then remove B
(Too tricky and I don't like the idea)

2) A has another thread running on low priority.
and it is waitingForSignalObject.
D Signal A and the thread Dispose and Remove B object from A.
This can work and I had many B object of different king,
then I can have a justification to add another thread to do this, because is
going to check for multiples Signals.
The only cons is the signal from D has to be last last sentence
on the complete cycle (B, C, D).

Then the question is, somebody knows how to do this king of
things with out add a thread only for checking and disposing?

Thanks.
Gustavo.


Jul 21 '05 #1
0 1915

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

Similar topics

5
674
by: Don Vaillancourt | last post by:
Hello all, Over the years as I design more database schemas the more I come up with patterns in database design. The more patterns I recognize the more I want to try to design some kind of...
9
2913
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with...
2
2431
by: Test User | last post by:
Hi all, (please excuse the crosspost as I'm trying to reach as many people as possible) I am somewhat familiar with Access 2000, but my latest project has me stumped. So, I defer to you...
6
2107
by: rodchar | last post by:
Hey all, I'm trying to understand Master/Detail concepts in VB.NET. If I do a data adapter fill for both customer and orders from Northwind where should that dataset live? What client is...
17
2674
by: tshad | last post by:
Many (if not most) have said that code-behind is best if working in teams - which does seem logical. How do you deal with the flow of the work? I have someone who is good at designing, but...
17
4824
by: roN | last post by:
Hi, I'm creating a Website with divs and i do have some troubles, to make it looking the same way in Firefox and IE (tested with IE7). I checked it with the e3c validator and it says: " This...
6
2122
by: JoeC | last post by:
I have a question about designing objects and programming. What is the best way to design objects? Create objects debug them and later if you need some new features just use inhereitance. Often...
0
2065
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
19
3134
by: neelsmail | last post by:
Hi, I have been working on C++ for some time now, and I think I have a flair for design (which just might be only my imagination over- stretched.. :) ). So, I tried to find a design...
8
2207
by: indrawati.yahya | last post by:
In a recent job interview, the interviewer asked me how I'd design classes for the following problem: let's consider a hypothetical firewall, which filters network packets by either IP address,...
0
7260
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
7537
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...
0
7525
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5685
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3233
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1594
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.