473,623 Members | 3,366 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Strategy to Refresh Multiple Forms Simultaneously

I plan to write a Windows Forms MDI application for a medical office. Users
must be able to select a patient and view related information on multiple
forms; with1-4 forms opened at the same time for the same patient; each form
showing a different type of patient-related information.

After viewing information for one patient (say on 3 forms opened
simultaneously) , users want the ability to select another patient. Upon
selection of another patient all currently opened forms should show their
respective data for the new patient. Also, when a form is opened, it must
show its data for the currently selected patient. Each form will present
data that is editable.

I tentatively plan to implement the "patient search" feature in a modal
dialog.

My question is for a high-level strategy for managing this UI (e.g.,
updating any/all currently opened forms with data for the newly selected
patient, etc). What I would appreciate are suggestions for the various
high-level building blocks that you think would work well for this scenario;
e.g,. the logical layers and/or classes to create and the role each would
play.

FWIW: The data will reside in a SQL Server db. The system will have
approximately 150 users all on a high-speed LAN, with no need for remote
access.

Thank you for your time and consideration!
Jan 26 '06 #1
7 2731
Hi Jeff,
you probably want to start looking into the "Model View Controller"
pattern for your interface design. This design allows you to seperate the
data you want to view from the view of the data. You can then have multiple
views looking at the same data and updating syncronously.

Also Microsoft have their own take on this approach called the "User
Interface Process Application Block" which is similar to the MVC.

Mark.

"Jeff" wrote:
I plan to write a Windows Forms MDI application for a medical office. Users
must be able to select a patient and view related information on multiple
forms; with1-4 forms opened at the same time for the same patient; each form
showing a different type of patient-related information.

After viewing information for one patient (say on 3 forms opened
simultaneously) , users want the ability to select another patient. Upon
selection of another patient all currently opened forms should show their
respective data for the new patient. Also, when a form is opened, it must
show its data for the currently selected patient. Each form will present
data that is editable.

I tentatively plan to implement the "patient search" feature in a modal
dialog.

My question is for a high-level strategy for managing this UI (e.g.,
updating any/all currently opened forms with data for the newly selected
patient, etc). What I would appreciate are suggestions for the various
high-level building blocks that you think would work well for this scenario;
e.g,. the logical layers and/or classes to create and the role each would
play.

FWIW: The data will reside in a SQL Server db. The system will have
approximately 150 users all on a high-speed LAN, with no need for remote
access.

Thank you for your time and consideration!

Jan 26 '06 #2
You want to look into the Model-View-Presenter pattern. I don't use it
exactly as written. I'll give you an outline of what I'm doing, but
I'll talk in terms of a "Patient" group of objects so it's more
applicable to what you're doing.

In my system, I would have the following classes:

Patient
PatientCollecti on
PatientData
PatientValidato r

and then all of my forms. The uses of these classes are as follows.

Patient represents a validly constructed patient, either one from the
database, or a newly constructed or edited one ready to be written back
to the database. Patient always contains self-consistent, valid
information, and provides operations for getting information about the
patient, etc.

PatientCollecti on is a collection of patients, along with any useful
methods for searching / fetching / etc. collections of patients.

PatientData is the data layer that mediates between the SQL
representation and the Patient object. How you want to do that is up to
you. (A Patient, for example, could internally store its information as
a DataRow, or as individual private members. It's up to you.)

PatientValidato r is needed only if you're modifying patient
information. Whereas a Patient always contains valid patient
information, a PatientValidato r acts a the Model portion of the UI, so
it's capable of holding partially-modified patient information in a
(temporarily) "bad" state. It knows how to check whether the patient
information it's holding is OK, and knows how to issue helpful error
messages if some patient information is invalid. PatientValidato r has a
property or method that the UI can call to check if the patient info is
OK, and another to build a new Patient object if the patient info is
OK.

Now here's the cool part. PatientValidato r exposes most of the
properties that a Patient does, but each property has a ...Changed
event associated with it. So, for example, you might have a FirstName
property, which would have a corresponding FirstNameChange d event.
Every public property has a corresponding Changed event.

Now, each form you write to display patient information doesn't
actually store any patient information. All it does is subscribe to the
PatientValidato r's ...Changed events. When a ...Changed event is
raised, the form reads the new information from the validator and
displays it on the screen. When the user changes something in a
control, the form sets the corresponding property in the validator.

To this I added ...Relevant and ...Changeable properties and
corresponding ...RelevantChan ged and ...ChangeableCh anged events. This
allows the validator to tell the display when particular fields should
appear / disappear, and when they should be enabled / disabled.

The beauty of this (which is sort of a bastardized form of MVP) is that
all of the business logic about how fields interact is in the
PatientValidato r, the model. The forms are just views into that
information that react to changes in the model and make changes to the
model.

In fact, if you do things this way, _as soon as_ the user modifies
something on one form, the other forms will change what they display to
stay in synch.

Of course, if you're not editing patient information, just displaying
it, then you can cut down the complexity quite a bit, but the same
approach applies: one model object that raises events when things
change, and every form is just a dumb view into that data.

How you handle the data layer beneath this is really up to you and
doesn't impact the UI design at all.

Jan 26 '06 #3
Oh, that's good! very good! I can see it in action now.

Thank you.
"Bruce Wood" <br*******@cana da.com> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
You want to look into the Model-View-Presenter pattern. I don't use it
exactly as written. I'll give you an outline of what I'm doing, but
I'll talk in terms of a "Patient" group of objects so it's more
applicable to what you're doing.

In my system, I would have the following classes:

Patient
PatientCollecti on
PatientData
PatientValidato r

and then all of my forms. The uses of these classes are as follows.

Patient represents a validly constructed patient, either one from the
database, or a newly constructed or edited one ready to be written back
to the database. Patient always contains self-consistent, valid
information, and provides operations for getting information about the
patient, etc.

PatientCollecti on is a collection of patients, along with any useful
methods for searching / fetching / etc. collections of patients.

PatientData is the data layer that mediates between the SQL
representation and the Patient object. How you want to do that is up to
you. (A Patient, for example, could internally store its information as
a DataRow, or as individual private members. It's up to you.)

PatientValidato r is needed only if you're modifying patient
information. Whereas a Patient always contains valid patient
information, a PatientValidato r acts a the Model portion of the UI, so
it's capable of holding partially-modified patient information in a
(temporarily) "bad" state. It knows how to check whether the patient
information it's holding is OK, and knows how to issue helpful error
messages if some patient information is invalid. PatientValidato r has a
property or method that the UI can call to check if the patient info is
OK, and another to build a new Patient object if the patient info is
OK.

Now here's the cool part. PatientValidato r exposes most of the
properties that a Patient does, but each property has a ...Changed
event associated with it. So, for example, you might have a FirstName
property, which would have a corresponding FirstNameChange d event.
Every public property has a corresponding Changed event.

Now, each form you write to display patient information doesn't
actually store any patient information. All it does is subscribe to the
PatientValidato r's ...Changed events. When a ...Changed event is
raised, the form reads the new information from the validator and
displays it on the screen. When the user changes something in a
control, the form sets the corresponding property in the validator.

To this I added ...Relevant and ...Changeable properties and
corresponding ...RelevantChan ged and ...ChangeableCh anged events. This
allows the validator to tell the display when particular fields should
appear / disappear, and when they should be enabled / disabled.

The beauty of this (which is sort of a bastardized form of MVP) is that
all of the business logic about how fields interact is in the
PatientValidato r, the model. The forms are just views into that
information that react to changes in the model and make changes to the
model.

In fact, if you do things this way, _as soon as_ the user modifies
something on one form, the other forms will change what they display to
stay in synch.

Of course, if you're not editing patient information, just displaying
it, then you can cut down the complexity quite a bit, but the same
approach applies: one model object that raises events when things
change, and every form is just a dumb view into that data.

How you handle the data layer beneath this is really up to you and
doesn't impact the UI design at all.

Jan 26 '06 #4

"Jeff" <A@B.COM> wrote in message
news:Ov******** ******@TK2MSFTN GP15.phx.gbl...
I plan to write a Windows Forms MDI application for a medical office. Users
must be able to select a patient and view related information on multiple
forms; with1-4 forms opened at the same time for the same patient; each
form showing a different type of patient-related information.

After viewing information for one patient (say on 3 forms opened
simultaneously) , users want the ability to select another patient. Upon
selection of another patient all currently opened forms should show their
respective data for the new patient. Also, when a form is opened, it must
show its data for the currently selected patient. Each form will present
data that is editable.

I tentatively plan to implement the "patient search" feature in a modal
dialog.

My question is for a high-level strategy for managing this UI (e.g.,
updating any/all currently opened forms with data for the newly selected
patient, etc). What I would appreciate are suggestions for the various
high-level building blocks that you think would work well for this
scenario; e.g,. the logical layers and/or classes to create and the role
each would play.

FWIW: The data will reside in a SQL Server db. The system will have
approximately 150 users all on a high-speed LAN, with no need for remote
access.

Thank you for your time and consideration!


You could just use a strongly typed DataSet since you will probably be using
one to get the data anyway.

Of course you run into the problem with the designer where it wants to use a
new instance of the dataset for each form but it is easy to write a method
to "copy" all of the delegates attached to dataset in the design onto a
similarly typed dataset supplied as a property.

This will give you updates,undo,li sts and easy database integration.

It is much simpler and easier to implement than the other suggestion with
Patient etc as explicit classes however it really depends on how big the
application is - the bigger and more complicated it gets the more you should
tend towards explicit custom modelling
Jan 26 '06 #5
On Wed, 25 Jan 2006 20:42:41 -0800, "Jeff" <A@B.COM> wrote:
I plan to write a Windows Forms MDI application for a medical office. Users
must be able to select a patient and view related information on multiple
forms; with1-4 forms opened at the same time for the same patient; each form
showing a different type of patient-related information.

After viewing information for one patient (say on 3 forms opened
simultaneously ), users want the ability to select another patient. Upon
selection of another patient all currently opened forms should show their
respective data for the new patient. Also, when a form is opened, it must
show its data for the currently selected patient. Each form will present
data that is editable.

I tentatively plan to implement the "patient search" feature in a modal
dialog.

My question is for a high-level strategy for managing this UI (e.g.,
updating any/all currently opened forms with data for the newly selected
patient, etc). What I would appreciate are suggestions for the various
high-level building blocks that you think would work well for this scenario;
e.g,. the logical layers and/or classes to create and the role each would
play.

FWIW: The data will reside in a SQL Server db. The system will have
approximatel y 150 users all on a high-speed LAN, with no need for remote
access.

Thank you for your time and consideration!


A thought. Would it simplify the problem if you used tabbed forms
rather than MDI? That way only one form is visible at a time and each
form/tab can be updated as it is selected. Obviously your users would
have to be happy with this. You will probably need to put more data
on each page as they will not be able to have different pages visible
at the same time.

rossum

--

The ultimate truth is that there is no ultimate truth
Jan 26 '06 #6
Other suggestions have been good but I have something to add here: use
a public static instance of whatever object you're storing data in. I
am doing this with an application similar to yours and have found it to
work well. I just declare a public static DataSet in my main form and
instantiate it immediately in the constructor. Then, I refer to it
everywhere as MainForm.dataMo del. Other forms that use it are signed
up to be notified via an event when it changes.

Jan 27 '06 #7
I do something similar: I use a Singleton here. I started with a static
but then found that I needed to take advantage of inheritance (I had a
data handler for each type of business object, and they had
functionality in common). Of course, static and inheritance don't mix,
so I cooked up a Singleton solution, instead, which is still going
strong.

Jan 27 '06 #8

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

Similar topics

3
4039
by: Dave | last post by:
Hey, I'm running a localhost web server...W2K with IIS 5.0, and I'm trying to use ASP/ADO to access my Access database. When I first load the page, everything works, but if i hit refresh (F5 or even Ctrl-F5), I get "page cannot be displayed" with the problem line of code being the database Open command (the starred line in the snippet below). If I press Refresh repeatedly, that doesn't help. After a minute or two, refreshing the page...
3
1668
by: Jorge | last post by:
We have an application with Access 2000 and normally there are three designers working simultaneously. But forms or report modifications requires exclusive use. That force to all others users must get out of database when a modification is required. Somebody knows how to solve that. Is possible for example keep tables in other better database and share to access as link? Somebody can recommend us other database that work as access 97...
6
539
by: mark | last post by:
I have an asp.net ecommerce web application on a remote web server. I'm using an Access database on the back end. I've notice a few strange things. When I mimic an multiple user environment by surfin it in multiple browsers simultaneously the site generates a generic runtime error after awhile. I'm thinking this has something to do with my access database and multiple connections. I'm using forms authentication with a login page. Is...
1
3491
by: Rob | last post by:
I have an ASP.NET application that uses forms-based authentication. A user wishes to be able to run multiple sessions of this application simultaneously from the user's client machine. The web.config file is configured as such: <authentication mode="Forms"> <forms loginUrl="Login.aspx" protection="All" name="myApplication"/> </authentication>
0
1441
by: sherlockweb | last post by:
Hi there, I am trying to simultaneously run multiple Windows Forms (in this case 3 windows) each with a WebBrowser object. Each of the WebBrowser objects is running a PowerPoint presentation (set to cycle through automatically). The problem I have run into is that when there is more than one window only the last created window allows the PowerPoint presentation to cycle. The other presentations appear to pause - until I click on their
1
4136
by: cookdw60 | last post by:
I am looking for a way to have an access form update for multiple users. I have a form where certain fields will be updated on individual computers, and there may be 3 or 4 users that have the form open at a time. Is there a way to have all users forms simultaneously refresh when a field is updated by one of the clients??? ex. Multiple users have same form open, one makes a change to the data and is critical for other users to see that...
17
2740
by: Cramer | last post by:
I plan to implement an exception logging feature in an ASP.NET Web application that writes encountered exceptions to disk. The exception data will be stored as XML. I am planning on having each exception written to its own XML file. I plan to NOT append exceptions to a single XML file because I don't want for the exception logging component to have to deal with contention for access to the file. This is possible when, for example,...
1
3485
by: =?Utf-8?B?U2FyYWggTWFycmlvdHQ=?= | last post by:
Hi all, I hope this is the correct forum for my VB.NET forms based question. I have written an application which uses my own user controls which the user can position dynamically on a form. The user control has several standard controls on it (labels/comboboxes etc) but there is space at the top allowing the user to click on the control itself. The code I use at the moment to allow the user to move the control is fairly
1
3560
by: Mohit | last post by:
Hi all, I am working on a windows based client server application with multiple forms. All forms are having custom title bars with no default bars. There is one main form. Some forms are opened up as modal while others are opened up as modeless on this main form. Whenever some error occurs in client server communication we show it in modal message box. Now I ran into a case: a modal form is opened up on the main form. And some error...
0
8162
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8603
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8317
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8463
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4067
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2593
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 we have to send another system
1
1769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1468
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.