Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Apr 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Coding Best Practices - Presentation or Data Layer?

    We are trying to build a web application that would facilitate the display of workstation availability in a computer lab environment. This requires us to create a map of the labs and place availability status icons on a map of the physical space. In order to represent the real world position of the computers in a given lab, we need to specify it's x, y coordinates for placement. The question I have is whether these coordinates would be part of the Presentation Layer of the application or the Data Layer. All of the examples I've seen place these bits in the database with the rest of the information that defines each workstation. My programmer friend believes that these bits belong in the Presentation Layer and as such insists that they should be defined in the CSS file. I am not a programmer so I don't know which way would be the best way to do it. All I know is that everyone does it one way and he's telling me it should be done another. Can someone please shed some light on this and give me some explanation as to why it should be one way or the other. I would reference the following site to understand more specifically what it is we're trying to do.

    http://journal.code4lib.org/articles/4067

  • #2
    New Coder
    Join Date
    Jan 2009
    Posts
    58
    Thanks
    4
    Thanked 3 Times in 3 Posts
    they dont belong in the css
    They are a variable, independent, and specifically connected to each console.
    Therefore they belong in the database

    Im not really sure defining the XY co-ords is the best way to go about it, but I cant think of a better way of the top of my head, so why not eh!

  • #3
    New Coder
    Join Date
    Jan 2009
    Posts
    58
    Thanks
    4
    Thanked 3 Times in 3 Posts
    If you read the link you provided it actually specifically tells you how to do it.

    top_pos(int)
    left_pos(int)

    for the X and Y database vars

    and then later it tells you how to implement it.

  • #4
    New to the CF scene
    Join Date
    Apr 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thank You

    Thank you for your reply.

    I agree with you completely. As I stated earlier, all of the examples I've looked at place the coordinates in the database as part of the definition of the individual "Computer" object including the one I referenced. To me this makes the most sense. I just want to be able to make an informed argument for this case to my developer who believes otherwise. He is insistent that those bits are a design element and as such belong in the Presentation layer of the application. I've shown him the example I've posted but he doesn't agree with the implementation. Your points are good though. I'll see how far they get me with this guy.

    Once again, Thanks.


  •  

    Posting Permissions

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