Question about Separating Presentation Layer from Business Logic

This is a discussion on Question about Separating Presentation Layer from Business Logic within the Windows Programming forums, part of the Platform Specific Boards category; In my programming class, my teacher said that often in production code, there is a layer of abstraction that sits ...

  1. #1
    Set Apart -- jrahhali's Avatar
    Join Date
    Nov 2002
    Posts
    256

    Question about Separating Presentation Layer from Business Logic

    In my programming class, my teacher said that often in production code, there is a layer of abstraction that sits between the presentation layer and the business logic layer. Is this true? If so, why would you want to do this? To me it seems redundant. For example, to access methods from your business logic layer, you would have to go through a middle layer when you just could have accessed them directly. In either scenario, the business logic layer doesn't need to know anything about my GUI.

    So it's either GUI -> middle -> business logic OR
    GUI -> business logic

    To give a real example, my assignment is to develop a game similar in concept to D&D. I have my business logic classes which i instantiate in my GUI, and use as necessary. They return information I need to update the GUI. My teacher said it would be better to have my GUI classes, and a 'Game' class which sits between my GUI and business logic classes.

    Thanks in advance.
    Clear the mines from our Shazbot!
    Get the enemy Shazbot!

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,531
    Model

    For your game for example, you could write separate "Windows" and "Linux" GUI components, and leave the bulk of the game alone.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Set Apart -- jrahhali's Avatar
    Join Date
    Nov 2002
    Posts
    256
    Thanks Salem, that helped.
    Clear the mines from our Shazbot!
    Get the enemy Shazbot!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Boundary layer.
    By sunish5 in forum C Programming
    Replies: 3
    Last Post: 10-28-2010, 09:41 PM
  2. neural nets input layer question
    By jianna in forum General AI Programming
    Replies: 3
    Last Post: 04-29-2009, 11:11 AM
  3. Design layer question
    By mdoland in forum C# Programming
    Replies: 0
    Last Post: 10-19-2007, 04:22 AM
  4. logic question
    By Roy01 in forum C++ Programming
    Replies: 5
    Last Post: 12-09-2006, 08:02 AM
  5. logic question...
    By rox in forum C++ Programming
    Replies: 1
    Last Post: 04-01-2004, 09:03 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21