473,406 Members | 2,281 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,406 software developers and data experts.

Relating an object to a window in an MDI application

I'm writing some business software, so I have a customer object that
holds customer data and all the logic to deal with that customer. The
problem is one of concept - I don't know how to tie the customer object
to a specific window. Since this app is MDI, it is possible for the user
to have more than one customer open at a time.

What is the "correct" way to tie a data/logic object to a window?

I realize that is an open ended question but I'm still trying to wrap my
head around Visual Studio.NET and this MDI stuff!

Thanks!

--
- Mitchell
Jul 21 '05 #1
3 1333
Hi,

I would recommend you take a look at the Model View Controller (MVC) design
pattern.

To give you a quick answer, why not let the Form class hold a reference to
the object that it is presenting the data for? When the Window is created it
is passed a reference to the object it is representing, this information can
either be passed in the constructor or set via property.

Hope this helps

--
Chris Taylor
http://dotnetjunkies.com/weblog/chris.taylor

"Mitchell Vincent" <mv******@newsgroup.nospam> wrote in message
news:#m*************@TK2MSFTNGP15.phx.gbl...
I'm writing some business software, so I have a customer object that
holds customer data and all the logic to deal with that customer. The
problem is one of concept - I don't know how to tie the customer object
to a specific window. Since this app is MDI, it is possible for the user
to have more than one customer open at a time.

What is the "correct" way to tie a data/logic object to a window?

I realize that is an open ended question but I'm still trying to wrap my
head around Visual Studio.NET and this MDI stuff!

Thanks!

--
- Mitchell

Jul 21 '05 #2
Chris Taylor wrote:
Hi,

I would recommend you take a look at the Model View Controller (MVC) design
pattern.

To give you a quick answer, why not let the Form class hold a reference to
the object that it is presenting the data for? When the Window is created it
is passed a reference to the object it is representing, this information can
either be passed in the constructor or set via property.

Hope this helps

Thanks Chris. Sometimes the answer is so simple I can't wrap my head
around it!

I read your response and gave myself a big "Duuuuh!" slap!

Thanks again!!

--
- Mitchell
Jul 21 '05 #3
Chris Taylor wrote:
Hi,

I would recommend you take a look at the Model View Controller (MVC) design
pattern.

To give you a quick answer, why not let the Form class hold a reference to
the object that it is presenting the data for? When the Window is created it
is passed a reference to the object it is representing, this information can
either be passed in the constructor or set via property.

Hope this helps

Thanks Chris. Sometimes the answer is so simple I can't wrap my head
around it!

I read your response and gave myself a big "Duuuuh!" slap!

Thanks again!!

--
- Mitchell
Jul 21 '05 #4

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

Similar topics

28
by: Daniel | last post by:
Hello =) I have an object which contains a method that should execute every x ms. I can use setInterval inside the object construct like this - self.setInterval('ObjectName.methodName()',...
2
by: Davide Bruzzone | last post by:
Greetings all... Here's a description of the problem that I'm trying to solve: - I have a Web page from which users can open one or more other windows. - From that web page, the user can then...
1
by: Mitchell Vincent | last post by:
I'm writing some business software, so I have a customer object that holds customer data and all the logic to deal with that customer. The problem is one of concept - I don't know how to tie the...
3
by: BlackFireNova | last post by:
I have an existing database, and I need to add another table to it. The database tracks equipment, however I have a need to track ancillary items which are purchased or added to some of the...
3
by: qwerty | last post by:
I´m new to ASP.Net. My workmate has some experience with it. He claimed that in ASP.Net working with frames is much simpler than it was ASP. I asked explanation but he couldn't give me such. (a...
2
by: Julia | last post by:
Hi, Can a Remote object be a WebService as well? i want to able to connect to a remote object either using .NET remoting and HTTP\SOAP so I wonder if I can create a singleton(statefull)...
1
by: Mitchell Vincent | last post by:
I'm writing some business software, so I have a customer object that holds customer data and all the logic to deal with that customer. The problem is one of concept - I don't know how to tie the...
2
by: avanhalen | last post by:
To embed flash objects in my pages, I read them from a database. A script file (Filedownload.aspx) reads it from the database, and streams it to the browser. Here are two example flash objects...
4
by: nishi57 | last post by:
I hope I can get some help regarding this issue, which has been going on for a while. I have a desktop user who is having problem running "Stored Procedures". The DB2 Connect application works fine...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.