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. Java
  4. Package structure best practices?

Package structure best practices?

Scheduled Pinned Locked Moved Java
javaquestiondesignsaleshelp
3 Posts 3 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.
  • N Offline
    N Offline
    Neo10101
    wrote on last edited by
    #1

    What is the best way to structure the naming of your (java) packages? By design paradigm: my.app.dao, my.app.services, my.app.util, my.app.model, etc. or by function/context name: my.app.clients, my.app.registration, my.app.production, my.app.accountancy? On a side note: I think I remember watching a keynote speech on the Spring framework where a developer advocated the structuring of packages according to the application's domain functions. The same would happen for URLs: /login /register /products/sales /products/production /accountancy/general-ledger /accountancy/analysis The problem of the classic paradigm package structure would be redundancy/visibility problems: services/userregistration services/agenda services/products model/userregistration model/agenda model/products dao/userregistration dao/agenda dao/products Each function is repeated per layer. What is the best approach?

    J T 2 Replies Last reply
    0
    • N Neo10101

      What is the best way to structure the naming of your (java) packages? By design paradigm: my.app.dao, my.app.services, my.app.util, my.app.model, etc. or by function/context name: my.app.clients, my.app.registration, my.app.production, my.app.accountancy? On a side note: I think I remember watching a keynote speech on the Spring framework where a developer advocated the structuring of packages according to the application's domain functions. The same would happen for URLs: /login /register /products/sales /products/production /accountancy/general-ledger /accountancy/analysis The problem of the classic paradigm package structure would be redundancy/visibility problems: services/userregistration services/agenda services/products model/userregistration model/agenda model/products dao/userregistration dao/agenda dao/products Each function is repeated per layer. What is the best approach?

      J Offline
      J Offline
      jschell
      wrote on last edited by
      #2

      Not exactly sure what you are suggesting but if your 'services/userregistration' is based on authorization/authentication then you have a rest call for that and nothing else. Presuming that the functionality is in fact the same. That is similar to your other areas in that either something like 'products' is different for 'model' and 'services' or it is the same. If the same then there would be a root 'product' and not the way you broke it out. If they are different then they should have two different rest methods.

      1 Reply Last reply
      0
      • N Neo10101

        What is the best way to structure the naming of your (java) packages? By design paradigm: my.app.dao, my.app.services, my.app.util, my.app.model, etc. or by function/context name: my.app.clients, my.app.registration, my.app.production, my.app.accountancy? On a side note: I think I remember watching a keynote speech on the Spring framework where a developer advocated the structuring of packages according to the application's domain functions. The same would happen for URLs: /login /register /products/sales /products/production /accountancy/general-ledger /accountancy/analysis The problem of the classic paradigm package structure would be redundancy/visibility problems: services/userregistration services/agenda services/products model/userregistration model/agenda model/products dao/userregistration dao/agenda dao/products Each function is repeated per layer. What is the best approach?

        T Offline
        T Offline
        TorstenH
        wrote on last edited by
        #3

        I keep it classic. That's what I - and more important - other programmers/colleagues are used too.

        regards Torsten I never finish anyth...

        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