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

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 2718
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
PatientCollection
PatientData
PatientValidator

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.

PatientCollection 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.)

PatientValidator is needed only if you're modifying patient
information. Whereas a Patient always contains valid patient
information, a PatientValidator 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. PatientValidator 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. PatientValidator 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 FirstNameChanged 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
PatientValidator'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 ...RelevantChanged and ...ChangeableChanged 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
PatientValidator, 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*******@canada.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.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
PatientCollection
PatientData
PatientValidator

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.

PatientCollection 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.)

PatientValidator is needed only if you're modifying patient
information. Whereas a Patient always contains valid patient
information, a PatientValidator 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. PatientValidator 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. PatientValidator 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 FirstNameChanged 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
PatientValidator'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 ...RelevantChanged and ...ChangeableChanged 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
PatientValidator, 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**************@TK2MSFTNGP15.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,lists 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
approximately 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.dataModel. 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
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...
3
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...
6
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...
1
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...
0
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...
1
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...
17
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...
1
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....
1
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...
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
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
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
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
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...
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
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...

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.