Architectural decision; deriving classes from a common parent doc and view class or not

Hello,
my name is Rainer and I�m currently doing my diploma thesis in a small
company in my home town in programming an
MDI/Doc-View/MFC-application.
To make it short:
My task is to design and implement a system, that visualizes (i.e. to
draw objects in a coordinate system and show internal information
about them in menus, or directly in the co. system ) Data generated by
different signal processing approaches programmed in C. For each
approach in a differnt window.

The signal processing approaches produce all the same basic data, but
each one of them delivers special information, that should be
visualized, too.
I�m new to MFC-programming; therefore I�ve problems to decide me due
to lacking experience.

My idea was to createte a basic DOC- and View-Class that contains the
data and the logic to visualize the basic stuff and to derive for each
different signal processing approach one Doc- and View- class for the
special behavior.
Then I would registrate each approach as CMultiDocTemplate.
If I do so, I�ve to do things like calling from the OnDraw-method of
my derived class the parent method OnDraw and hand over the device
context.
I�m going to use different Threads for each type of signal processing
and maybe
DirectDraw for Visualization.
Is this "clean programming" or do you see any problems in my
architectural decisions?
Thanks a lot,
Rainer Bye
0
braegen (4)
11/23/2004 3:58:27 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
481 Views

Similar Articles

[PageSpeed] 35

"Rainer" <braegen@web.de> wrote in message
news:cb73e7bf.0411230758.129a97c4@posting.google.com...
> Hello,
> my name is Rainer and I�m currently doing my diploma thesis in a small
> company in my home town in programming an
> MDI/Doc-View/MFC-application.
> To make it short:
> My task is to design and implement a system, that visualizes (i.e. to
> draw objects in a coordinate system and show internal information
> about them in menus, or directly in the co. system ) Data generated by
> different signal processing approaches programmed in C. For each
> approach in a differnt window.
>
> The signal processing approaches produce all the same basic data, but
> each one of them delivers special information, that should be
> visualized, too.
> I�m new to MFC-programming; therefore I�ve problems to decide me due
> to lacking experience.
>
> My idea was to createte a basic DOC- and View-Class that contains the
> data and the logic to visualize the basic stuff and to derive for each
> different signal processing approach one Doc- and View- class for the
> special behavior.
> Then I would registrate each approach as CMultiDocTemplate.
> If I do so, I�ve to do things like calling from the OnDraw-method of
> my derived class the parent method OnDraw and hand over the device
> context.
> I�m going to use different Threads for each type of signal processing
> and maybe
> DirectDraw for Visualization.
> Is this "clean programming" or do you see any problems in my
> architectural decisions?
> Thanks a lot,
> Rainer Bye

if i understand you correctly you will have one set of data and then each of
the 'signal processing approaches' will process it a different way to show
information about it.  if that is correct that would really fit into the
doc/view architecture best like this:

1. define a single document type that has the data.  it would have the
methods to acquire the data and save it (like file open/save) and methods to
allow views to access it as needed.  think of the raw data as your document.

2. each different dsp approach would be a separate view.  this makes sense
if they are all just different renderings of the same data, as you can have
multiple views into a document to render it in different ways.  look at how
word processors can present an outline and the text of the document, each
one is a different way to view the same data.

it may make sense to create one parent view class then derive your specific
ones from it.  this would work if there were common methods that could be
used to do things like reading a buffer full of data from the document,
common gui items like start/pause/stop, common renderings of things like
sample time, etc.  then each child of that parent could do its own
processing and screen rendering.

you might want to think about multiple document types if you have different
sources of data.  like if you have one set of data that you read from a file
and a different one that you read from a live source.  this would make sense
because the basic method needed to open or save the data source is
different, which is something associated with the mfc document concept.  if
this is the case you could design a parent document type that had the common
methods that were needed for the view interfaces and raw data storage, then
derive the specific document types that each acquired the data in a
different way.


0
noone1 (387)
11/23/2004 4:40:31 PM
Thank you very much for the answer, but I think I haven't made myself
clear enough. It�s s a bit different.
I will define my task more accurate:
I have data about "objects" that are delivered by an input file.
Each signal algorithm processes this data in a different way and
produces an outcome in the same format like the others but with
different results, i.e. for each approach the data is a bit different
but has the same format(this is the data for the Doc-classes).
Then I have to visualize this data in seperate windows to compare the
calculation of the different approaches.
Visualization means that there are calculated objects that have to be
drawn in the coordinate system.

The additional data, that I mentioned, is about inner states of the
calculation;
a kind of debug data. But because of the structure of the signal
algorithms,   the inner states, the logic and the variables are
different.

My system will be constantly under development. Therefore it�s very
important that it�s flexible in it�s architecture.
Because of this I had thought about using the parental class that 
is responsible for containing and visualizing the output,
because the format of the basic data is the same for each approach and
the visualization is the same for this basic data, too.
Using this parental class gives the developer a chance to change
format of the data and visualization only one time, unlike doing it
for each Doc/View Class of the approaches.
In the derived classes I would put the special data of each approach 
and the visualization of it, that is different for each type, too.

/*This is the important part about the problems:*/

Therefore I had asked if it would be possible to let my parental class
do the basic visualization of the data and my derived class the
special.
Because I do not know if it�s O.K. to handle the device contexts like
this, i.e.
to write on it with OnDraw in the derived class and then  call the
OnDraw parental method, especially when I`m going to use threads
(because the approaches are running simultaneously )and DirectDraw for
the visualization.

But another problem has arised for me:
Normally I want to compare the output of the differnt approaches in
different windows. But now my tutor asked me, if i could program a
solution that allows to switch the visualization from seperate windows
to one window and back at runtime and to draw all the resulting
objects in one coordinate plane (different colors for each approach).
But that is against the Doc/View concept. Because I`ll have three
types of data
but only one view. 
My ideas are the following:
a)
 Adapt the parental classes, that they are capable of containing and
visualizinging not only the results of one approach, register it as
new MultiDocTemplate and intantiate it.
Advantage: 
1.not very difficult
 Disadvantage:
1.loose of flexibility because changes due to the format or
visualization have to be done twice
2.only the basic data can be shown
b)
Make an view transparent and swap the views.
I hope, someone can help me relating to my problems.
And thank you "unknown guy" for your fast answer. 
 

> 
> if i understand you correctly you will have one set of data and then each of
> the 'signal processing approaches' will process it a different way to show
> information about it.  if that is correct that would really fit into the
> doc/view architecture best like this:
> 
> 1. define a single document type that has the data.  it would have the
> methods to acquire the data and save it (like file open/save) and methods to
> allow views to access it as needed.  think of the raw data as your document.
> 
> 2. each different dsp approach would be a separate view.  this makes sense
> if they are all just different renderings of the same data, as you can have
> multiple views into a document to render it in different ways.  look at how
> word processors can present an outline and the text of the document, each
> one is a different way to view the same data.
> 
> it may make sense to create one parent view class then derive your specific
> ones from it.  this would work if there were common methods that could be
> used to do things like reading a buffer full of data from the document,
> common gui items like start/pause/stop, common renderings of things like
> sample time, etc.  then each child of that parent could do its own
> processing and screen rendering.
> 
> you might want to think about multiple document types if you have different
> sources of data.  like if you have one set of data that you read from a file
> and a different one that you read from a live source.  this would make sense
> because the basic method needed to open or save the data source is
> different, which is something associated with the mfc document concept.  if
> this is the case you could design a parent document type that had the common
> methods that were needed for the view interfaces and raw data storage, then
> derive the specific document types that each acquired the data in a
> different way.
0
braegen (4)
11/23/2004 10:52:52 PM
Reply:

Similar Artilces:

Font changes when pasting into another doc
I have two docs created originally in Word 2000, and I am using Office 2007. The docs are in compatibility mode. When I copy a selection that has two different fonts from one doc to the other doc, the whole selection changes to the font/style that is in the selection point. (I have a list of paragraphs, each preceded by some symbols in a proprietary font, i.e.  Your car has ...;  Try toothpaste ...;  This flower is ...; etc. Each paragraph has a line following with a series of ******** which are center aligned for looks) In trying to copy a selection from...

how do I view an archived file? #2
How can I view an archived file and print info from it? Does the archived file have archive in the name? I am using publisher 2005 martyman2 wrote: > How can I view an archived file and print info from it? > Does the archived file have archive in the name? > I am using publisher 2005 ================================= Microsoft Publisher 2005? That's pretty cool considering that the most current version is 2003. What is the complete name and version number of the program you are using? -- John Inzer return e-mail disabled WOW!! I missed that! I'm jealous! -- JoAnn P...

Common signature files
does anyone know how to create a corportate signature file that can be deployed thoughout a network without having to copy it onto individual machines thanks alan Since Outlook itself only uses local signature files, what you describe = isn't possible, at least not in the way you envision it. See = http://www.slipstick.com/addins/content_control.htm for various methods = and tools for controlling disclaimers and other signatures from the = Exchange server.=20 --=20 Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for=20 Administrators, Power U...

disable views
Hi, I have created some new views with filters to use in the accounts page. I want to disable the use of the Active Accounts, My Active Accounts and Inactive Accounts for everyone. I read you can not remove these but have to disable them. Does anyone know where abouts i can do that from? thanks Disabling of Views is not supported in CRM and deleting System Views is not recommended. The good news is that sharing of system views is. Try this work around: - Create a Team that nobody is a member of - Load the View Editor for the View you want to "Hide" - Select Actions | Sha...

MDI App new Doc/View window: support from Developer?
Hello NG, I want to add a new Doc/View Window with menu in my MDI app. I use MS Developer 2003, Version 7.1. Up to now, I wrote all classes and resources alone, i.e. CNewDoc, CNewFrame, CNewView, IDR_NEW_VIEW_TMPL, IDD_NEWVIEW, ... And in CMyApp::InitInstance AddDocTemplate(...). Is this the only way? Or can the developer studio add all that stuff the same way as it does when I start a new MDI project? Thanks for hints, Guido You just need to do it manually like you are doing: http://msdn.microsoft.com/en-us/library/0dyc0e53(VS.80).aspx Tom "Guido Franz...

Decision Tree Template or Plug In
Does Excel 2003 have a way to do decision trees? I remember in Grad-school downloading a free plug in for doing decision trees but don't remember what it was. Has anyone done decision trees in Excel? The software should be able to compare various paths based on financial impact and associated confidence levels. Holly Hi Holly. I typed in decision trees in help in Excel 2003 and it appears that there is a third party ad-in that you can purchase. You might also try Microsoft's home page and search for decision trees to see if they have anything you can use. -- Sincerely, Mich...

App Architecture ?
I am creating two services. One downloads XML streams from WebSphere MQ into a SQL2K database, the other uploads XML Streams into Websphere MQ from SQL2K. The upload service polls SQL2K every couple of minutes for uploads. If there are uploads I create an ADO Dataset that I must convert to an XML stream. The Dataset and the XML stream have different schemas, just to clarify my dilema. I'm seeking input on the best way to convert ADO Datasets to XML streams and vice versa, baring in mind their schemas are different. I did a POC and "hard coded" each field to it's elemen...

Training word docs for Manufacturing/Inventory/Sales modules
I need to prepare some standard Great Plains training word documents for my users in the modules of Manufacturing (MO entry and processing, BOM entry, Routing, cost rollup), Inventory and Sales Orders. If anyone has any of these documents prepared for their own company, can you please email them to me at staceyleelee@hotmail.com I will take them as the starting point and modify them instead of starting from scratch. Thank you. ...

XmlSerializer: Dealing with an evolving class
We have an app that currently uses SOAP for a data file format. It works well enuogh but I would prefer an XML format that's a little friendlier to the human eye. I had started looking at converting over to using the XmlSerializer but quickly ran into a problem. One thing that is nice about the SOAP formatter's deserialization is that it can easily deal with different versions of the data file. The class we're serializing includes a version field and when deserializing we can examine what version file we're reading and easily deal with missing or changed fields. For...

Sales report for Matrix Parent
I have not been able to find a report in RMS that will give me total sales over a period for the Matrix Parent item. For example, we sell shoes, I would like to see the total sales for the Nike Pegasus over a given period and compare it's sales to other Parent Items. For this report I'm not interested in the individual sales for each of the sizes of the shoe, I want to see the total sales for all sales for this particular style of shoe. I would like to see this number for all of my styles of shoes, so I could see which is my best selling shoe, not my best selling shoe size. ...

Item Class ID
Hello, I am currently using GP10 SP1. I am having a problem when I change an item class. Instead of keeping the Quantity Decimal Places at 2 and Unit of Measure at Each it changes the Quantity Decimal Places to zero and clears out the Unit of Measure field. If I try to select a unit of measure I get the following message "Decimal places for the U of M schedule and the item must match." What is causing this? Thanks, Jocelyn First, be careful changing class IDs. Classes often carry account numbers. If the Inventory Asset Account changes and there is a quantity on hand, ...

Setting up the Viewing Area
How do I set up the main viewing panes so that I show Mail but where the reading pane is, I show a calendar and a tasks pane instead. The online help talks about docking and undocking panes but the handle isn't visible to grab. Use the folders view and select to view the calendar. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After searching google.groups.com and finding no answer, Geoff Schaller asked: | How do I...

--> Exchange 2003 Architecture Primer <--
Can someone clarify the following, please... (1) If I have 3 locations and each location have Exchange 2003 with LOCAL users mailbox hosted for each location - does this mean I will NOT have FE/BE design? (2) Based on #1 above, is the setup of Exchange 2003 location #2 and #3 nothing more than an additional Exchange 2003 installation - no special configuration - just hold mailboxes for the location? (3) If I wanted, is this setup primed for a FE Exchange so it can centralize request to all the other Exchange 2003? Do I install a 4th Exchange box, then enable BE on the 3 Exchange, ...

Enable/Disable Menu item from CMenuBar derived from CControlBar
I hav a problem wrt Disabling Menu items from my menu done form CMenuBar derived from CControlBar /*----------------------------------------------------------------------------------*/ CFrameWnd* pMiniFrame = GetParentFrame(); ASSERT_KINDOF(CMiniFrameWnd, pMiniFrame); CMenu* pSysMenu = pMiniFrame->GetSystemMenu(FALSE); ASSERT_VALID(pSysMenu); pSysMenu->EnableMenuItem(SC_CLOSE, MF_BYCOMMAND | MF_GRAYED) /*----------------------------------------------------------------------------------*/ This piece of code works and disables the CLOSE cross. But when i tried with my menu items, nothi...

Design View Failure
On some reports when I click the Design button nothing happens. The report does not come up. On other reports it does come up. I've tried compact and repair. I've tried rebooting my computer. I first notice the problem when I tried to create a snap report, thru VBA. It complained it could not find the object. When I tried to go into design view for the report nothing happened. Literally nothing happened. No error message. No design view. Its like the button has no effect. Trying other reports some come up, other don't. Has anyone seen this problem before? Regard...

A question about Cstring class !
I am a new learner of vc++ Please help me! When I see somebody create a variate of Cstring and then init it like this: m_DepID=L"" ,what is the L means; Thanks! That makes it a UNICODE string. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "yc0188" <yc0188@hotmail.com> wrote in message news:#0BkvuMLEHA.2400@tk2msftngp13.phx.gbl... > I am a new learner of vc++ > Please help me! > When I see somebody create a variate of Cstring and then init it like this: > m_DepID=L"" ,what is the L means; > > Thanks! > > Note, that there a...

Advanced Find View NEVERMIND
I found it ...

derive data from masterlist to another worksheet in same workbook
I have a master list on one worksheet with 8 columns of data. One of these columns (the 4th one) has a name entry. (there are only 4 names that would be used in all) I would like to have a macro or an excel formula to derive on separate worksheets ( which means 4 additional sheet, named for each of the 4 named entries in masterlist, as an entry is being made on the masterlist. the end result would be so that I can sort be each name on a separate worksheet. I dont wish to use filters on the masterlist, something which I could have used otherwise. Any advice ?? thanks in advance. Sor...

changes in resource usage view
Hi, I am trying to make MS Project to automatically increase the duration of the project when manually changing the work time in a particular day on the project, for a resource. For example, let's say that a resource must work on a project for 3 hours a day and as such the project completes in one week. What I want is to mark that in a day the resource dis not work on that project (by entering 0h as time allocated for the project for the day), and MS Project to see that and automatically increase the duration of the project with one extra day, because the work allocated...

Sales for Outlook views return "Cannot find server or DNS Error" 02-27-04
I know I saw a thread from a while ago of someone else experiencing this - anyone know of what to do? When I right-click, choose Properties, and go to the Home Page tab, I see the URL as something like this: http://localhost:2525/stage.aspx?page=Home&area=nav_home When I telnet to localhost 2525, I get no response. I checked in the registry under HKLM\Software\Microsoft\MSCRM, and saw that the DWORD entry CassiniPort (value 2525) exists now, and I also checked it after installing (it was also there). Any ideas? ...

File I/O in Document/View architecture
Hello. I'm trying to make a program that reads from a large file as needed, putting data into structs then displaying the struct contents. When I look at examples of File I/O, I have a problem. Where should the I/O go? To me, it makes sense to have the document handle anything relating to file input, including a call to a CFileDialog class. This works fine for me, but is it good practice to do that in the document rather than the view? I would not put File I/O(which changes the document) in a view. What issues do you see if this is in the document? Document seems to be the correct place...

Keyboard Shorts for Common Operations
I spend a lot of time needing to highlight certain cells. Is there anyway I can assign a keyboard shortcut to the 'fill color' tool and 'font colour' tool so I don't have to take my hands off the keyboard (using a mouse slow me down) They are not predefined Excel keyboards shortcuts (using Excel 2000) and I can't see how to define them Regards Sam Hi try recording a macro while doing this manually and assign this macro to a shortcut -- Regards Frank Kabel Frankfurt, Germany "Sam Benson" <Sam@abacusdx.com> schrieb im Newsbeitrag news:40b57d9d$1@...

view old messages from another email account
I have just set up a new account in Outlook 2003 and it only shows me email from today. I want to view old mail too. On Tue, 28 Feb 2006 07:42:28 -0800, jennifermonica wrote: > I have just set up a new account in Outlook 2003 and it only shows me email > from today. I want to view old mail too. When you say "I have just set up a new account in Outlook 2003" what EXACTLY do you mean? Do you mean you have set up a new Outlook profile, in which case you need to copy the emails from your old profile to your new, or, do you mean you have set up a new POP account? In which c...

Last viewed keboard shortcut
Hi Is there a keyboard shortcut to go to the "last viewed" slide in presentation mode? Thanks Michal There isn't but you could try this: Add an action button to a slide with an action of last slide viewed. Drag it off slide and copy paste to all slides. As long as this is the only action button alt then enter will do this. -- john ATSIGN PPTAlchemy.co.uk Free PPT Hints, Tips and Tutorials http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html "מיכל" wrote: > Hi > Is there a keyboard shortcut to go to the "la...

How to disable auto download when view in preview pane in Outlook 2003???
Hi All, Outlook express has a great feature not to open/download the IMAP message, when I click on a message the email list pane. This greatly used to delete unwanted emails without downloading the whole email and to prevent opening junk/virus emails. Now I switched to Outlook 2003 and I cannot find that feature any more. It automatically downloads/open the email, when I click on an email in the list. How can I stop that happening?? Please help. Thanks in advance! Rgds, Eranga File, Work offline -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coautho...