Document/View -- where to keep the data in FTP app

Posted on 2000-01-10
Medium Priority
Last Modified: 2013-11-20
Another basic question about MFC.  In my application, I allow users to connect to an FTP site, display a list of files available, then have them either transfer or edit these files.

To establish the FTP connection, I just have a simple dialog where users can enter such things as username, password, sitename, port, etc.  My questoin is:  To keep with the doc/view model, where should I handle displaying the dialog?  In the document?  Where should I store the information the user enters?  Again, should this go in the document?  

I have 2 views in a split window:  1 for files, 1 for editing text.  I have also created a class for storing the FTP info described above
Question by:kmurphy99

Expert Comment

ID: 2339265
Since you want to stick to the Doc-View Arch. , the best place for you to display the Dialog will be View Class and storing of Information into a file in the Document class.

LVL 11

Accepted Solution

mikeblas earned 150 total points
ID: 2339495

The architecture you choose is really gated on the dependencies the dialog has. Try to think of the minimum number of compoenents the dialog refers to. You mention you have two view windows--one for files, one for text. Are those two different view classes?

If so, can you imagine the file list view and this dialog existing by themesleves? If so, that is, if the dialog doesn't need anything from the other view, then I think you'd be best served by providing the dialog in reaction to a command handled by the file list view.

If the file list changes, the view should communicate those changes back to the document. Even if the dialog tells the view to tell the document what to do.

If you need both view windows to support the dialog, then I think the dialog should be presented in reaction to a command reflected from the views to the document--and then the document would directly own the dialog.

..B ekiM

Expert Comment

ID: 2341799
Microsoft way of designing the system using Document View is not the best way to go unless you are doing a realy simple app, look an the pattern Model View Controller so you can understand better how data can be kept sparate from the view representation and control scheem.

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question