SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Addict bronze trophy
    Join Date
    Apr 2013
    Location
    Ithaca
    Posts
    351
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)

    About Domain/Business logic and Application logic

    Well I do know what the definitions are for the two different logic, and each applies to a different software layer(domain/business and application layer). Nonetheless, real life is not as simple as in theory, its sometimes quite difficult to figure out what methods/behaviors should belong to which layer, at least the difference is not as evident as between business logic and presentation logic, which you can easily identify.

    Considering a User Authentification system? Lets say I have a domain model called User for the domain/business layer(it may come with a mapper or DAO, but do not worry about this for now), and a controller object called UserController or RegistrationController/LoginController. What behaviors are domain-specific, and what are application-specific? Anyone mind elaborating with this example? Id appreciate this very much, as it will help me better identify what are domain responsibilities and what are application logic for more complex system.

  2. #2
    SitePoint Wizard bronze trophy Jeff Mott's Avatar
    Join Date
    Jul 2009
    Posts
    1,268
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    What helps me sometimes is to pretend that I'm writing code for more than just a web app, that I'm also building a CLI app. I ask myself if the code I'm writing would be just as applicable to the CLI as to the web. If yes, then it's part of the domain logic. If no, then it's specific to the web application.
    "First make it work. Then make it better."

  3. #3
    SitePoint Addict bronze trophy
    Join Date
    Apr 2013
    Location
    Ithaca
    Posts
    351
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Jeff Mott View Post
    What helps me sometimes is to pretend that I'm writing code for more than just a web app, that I'm also building a CLI app. I ask myself if the code I'm writing would be just as applicable to the CLI as to the web. If yes, then it's part of the domain logic. If no, then it's specific to the web application.
    Wow this is kinda tough for me, I know what CLI is but never developed any application for CLI so I dont know how to judge whether the logic is applicable for CLI at all... *sigh* Thanks for your answer though.

  4. #4
    SitePoint Addict
    Join Date
    Aug 2013
    Location
    New Zealand
    Posts
    277
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    What are you finding tough? Have you used a linux shell before? On linux you can accomplish pretty much anything in the shell you can accomplish on the graphical desktop. If you've only used windows I understand it might be confusing.

    If the same task can be accomplished in a linux shell as on a graphical desktop then the task is most likely domain logic.

  5. #5
    SitePoint Addict bronze trophy
    Join Date
    Apr 2013
    Location
    Ithaca
    Posts
    351
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    Nope, I have essentially zero knowledge about Linux Shell(have to say for my web application development its not quite useful to me anyway), although I did use shell at rare occasions on my webhost to execute some commands I mostly got through them with the aid of the support staff of my webhost. I mostly use Windows, while I do have a Mac for developing ios applications at times.


Bookmarks

Posting Permissions

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