Results 1 to 2 of 2

Thread: View,Document abd frame

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2001
    Posts
    163

    View,Document abd frame

    What are the difference between view,document and frame,
    what are the uses of these object.
    I think we and draw into frame as well as document too.
    Purushottam

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    If you mean the MFC paradigms:
    The frame is the outer part of your applications window. It contains the title bar, status bar, tool bars, menu bar etc. It is represented by the class CFrameWnd.
    The view is the client area, the area you see data. The part of MSWord where text is displayed is the client area, as is the part of IE where you see the web pages displayed. It is represented by the class CView and it's children.
    The document is part of the document/view philosophy. This idea says that you should seperate the data and the method you display it. The document is the data, while the view displays the data. The document is represented by CDocument and derivates. (COleDocument etc.). It is responsible for holding the data (e.g. the text in a text editor) and saving and loading it to/from disk (usually via the serialization mechanism and CArchive). The document should not contain any information on HOW to display it - that's what the view should do.
    The idea behind the whole thing is that with seperated data and view, you can have more than one type of displaying mechanism for the same data - like showing excel data either in the usual grid or in a diagram. With a document/view architecture, this should be easy to accomplish (although I still haven't found out how to create a different view for the same data).
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width