Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. OOD Question: Data / GUI boundary

OOD Question: Data / GUI boundary

Scheduled Pinned Locked Moved C / C++ / MFC
questiondesigntutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JennyP
    wrote on last edited by
    #1

    Hello, I'm writing a program that displays a list of tasks on a CListView report. The report view will have varying text color/font & item background colors depending on the context of each specific task (list item). Where should I put the functions to determine these GUI parameters? In the document class or the CListView derived class? Should the document have functions that return the color of each specific list item? Or should the ListView make the determination based on gathering information about the Document tasks/items? I suppose I could throw out the idea of modularity and just treat the GUI and the document as mutually dependent, but I believe that this would be poor design. Does anyone have any pertinent wisdom about how to lay this out? thanks! JennyP

    E 1 Reply Last reply
    0
    • J JennyP

      Hello, I'm writing a program that displays a list of tasks on a CListView report. The report view will have varying text color/font & item background colors depending on the context of each specific task (list item). Where should I put the functions to determine these GUI parameters? In the document class or the CListView derived class? Should the document have functions that return the color of each specific list item? Or should the ListView make the determination based on gathering information about the Document tasks/items? I suppose I could throw out the idea of modularity and just treat the GUI and the document as mutually dependent, but I believe that this would be poor design. Does anyone have any pertinent wisdom about how to lay this out? thanks! JennyP

      E Offline
      E Offline
      Ed Gadziemski
      wrote on last edited by
      #2

      I would place the functions in the listview class since they alter listview behavior. If you place them in the document, you'll have to redesign (or replicate code) if you find you need additional document types in the future. Even if you don't need additional documents, you're more likely to find listview code samples on CodeProject, and that may save you some coding time.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups