How to structure my package hierarchy?

As an inexperienced Java programmer, I am having a hard time understanding how to structure packages hierarchically.
Let's say that I am developing a client/server AddressBook application. So automatically, the following package hierarchy comes to my mind:
(company/org name is ACME for example)
com.acme.addressbook
com.acme.addressbook.protocol
The above two packages form the reusable core of the AddressBook system and include classes such as AddressBook, AddressBookEntry, etc. and related helper classes. Additionally, the protocol sub-package contains classes that pertain to the C/S network protocol. And both of these two packages are packaged up in a jar: AcmeAddressbook.jar
com.acme.addressbook.client
The above is the package for the Client application: AcmeAddressBookClient.jar
com.acme.addressbook.server
The above is the package for the Server application: AcmeAddressBookServer.jar
My questions are: does such a package structure and hierarchy make sense? Or are there any glaring mistakes that I have made?
Is it acceptable to keep the client and server applications into their own separate packages?
Also, is there any recommended limit for nested packages i.e. how deep should packages be nested within the top-level AddressBook package?
I am struggling to understand good package design and package structuring conventions.
Thanks any for any info, critique, advice, etc.

Lets the two client and server packages are respectively :
com.acme.addressbook.client
com.acme.addressbook.server
Yes, such a package structure and hierarchy make sense!
If you are having common utility classes and many library jars inside the package addressbook.library, you can just refer in client as well as in the server package.
If you are going to create separate project for client and for server, you want to maintain multiple copies, which further results in the problems due to redundant code. ie., whenever you changed any library files, you want to update in both places.
You can create two jars as you mentioned as,
AcmeAddressBookClient.jar
AcmeAddressBookServer.jar
Before building jars you just want to set the executable Main class appropriate for Client and Server before making the client and server jars respectively.
There is no limit for the nested package, if you need to group meaningfully, you can make as many nested package as you want!
For your reference :
http://articles.techrepublic.com.com/5100-22-1046677.html

Similar Messages

  • How to load HR Organizational Structure to BW Hierarchy

    In R/3 organization and staffing transaction (PPOME), each position or person is assigned to a organization unit. I want to load this entire organizational structure to BW Hierarchy. Currently i'm using the standard extractor 0ORGUNIT_HR01_HIER, i suppose this extractor will load the entire org structure to BW hierarchy. But in fact, only org units are loaded.
    Any idea how to  bring the position and person along to the hierarchy too?

    Hi Anders,
    Not really, i give up on the 0ORGUNIT_HR01_HIER standard data source. =D
    But i able to upload the entire structure using flat file. The idea is to create an ABAP program to download the Org Structure to flat file with internal characteristic, external characteristic, parent ID, child ID, next ID, etc important fields mapped. Then upload this flat structure back to BW.
    Regards,
    Boon Chen

  • How to remove a package from package structure?

    Hello profs,
    i have a problem. I add a package 'A' to another package 'B' in the package builder.
    Now i don't know how to remove package 'A' from the list of package 'B'.
    I have not found in the docu of package builder how to remove a package from the included list.
    Has somebody an idea how to do it?
    Thanks a lot.

    I found out that the relation between the packages saved in table TDEVC.
    Field PARENTCL contains the surrounding package 'B' of the package 'A' field DEVCLASS.
    At the moment the only way to remove the package is to modify the table.
    But i look for another possibility for this issue.
    Best regards
    Waldemar

  • Including packages in package hierarchy

    Hi,
    What is the purpose of including packages in package hierarchy?
    How can I define use access for them? what is the use?
    Please help me out in this.
    Thanks and regards,
    Lakshmi Reghuvaran

    Hello Lakshmi
    The <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/fd/f39de8ae6f11d596c000a0c94260a5/content.htm">SAP Online Help</a> says the following to this topic:
    <b>Goals of the Package Concept</b>
    When SAP created the package architecture in R/3 Enterprise, its goals were:
    To improve the structure of the software
    To encapsulate software functions more strictly
    To make well-defined interfaces available to all applications
    To clarify responsibilities
    The very same goals can be applied to your own packages, either if you are a professional software supplier for SAP or a customer.
    Regards
      Uwe

  • Custom KM UI Command -- ClassNotFoundException. How to structure project?

    Hi,
    I'm tired of trying around, so I'm coming here, in hopes that someone can help me (I'm sure there is) :). I'm trying to create two commands (Archive and Push to topnews). The first command will put a resource to a predefined location, whils the second will take an existing document from one folder and replace it with the currently selected resource. The code for doing this is ok, but I cannot display the commands on the context menu!
    I've created a separate layout set with a custom ResourceRenderer with a custom resource command group where my commands are defined in addition to several other, standard ones. The commands have been defined as:
    <package>.<classname> for both "Java class" and "Bundle file" attributes of the UICommand in addition to the properties file with my label and tooltip.
    I'm getting a ClassDefNotFound error no matter what I do. Even if I put it in the src.api or src.core folder I get this error in the trace. I was wondering if anyone could tell me how to structure the PAR file as I think I maybe missing something here...
    In advance, thanks
    Hans Petter

    Hi Hans,
       In order to isolate this problem, you can use this example: "Implementing Flexible UI One-Step-Screenflow".
    from:
    Guide to examples:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/kmc/Knowledge%20Management%20and%20Collaboration%20Developers%20Guide.html
    You can download this project, deploy and test this command. I have created commands using this example.
    Patricio.

  • How to Create and External Hierarchy and group values of IO in node

    Good morning
    BI 7:
    Please give me guidance on the following?
    I need to either to restrict a characteristic in a query to more than 800 values OR exclude values where it contains the pattern 'Z7' and 'Z8'. There are thousands of values which contains the pattern and they are not listed in such a way that I can exclude them as a value range, thus I would have to include all the values I want into the restriction, which is more than 800. An error displays when I check the query:
    ""In the structural component Warranty Damage Code, characteristic ZWR_DMGC is restricted to 838 values. This number is very large and will probably meet with technical limitations""
    The proposed solution is:
    ""Create an external hierarchy for characteristic ZWR_DMGC and group the 838 values in a hierarchy node. You can then work with the node instead of the 838 individual values.
    Alternatively, you can define a corresponding navigation attribute for ZWR_DMGC""
    I know where to create the hierarchy, but I am confused how to only include the values of the applicable IO where pattern contains 'Z7' and 'Z8'.......??
    The following are some of the steps proposed in a related thread, but I am loosing it at step 7.
    5. Confirm your entries. The Maintain Hierarchy screen appears. You can define the structure of a hierarchy here. ok
    6. To create a hierarchy node, you first need to choose an insertion mode: Insert as First Child or Insert As Next Neighbor (see Hierarchy Editing Functions). I selected first child
    7. Choose the type of node you want to create: Text Node, Characteristic Node, <Hierarchy Basic Characteristic Node> or Interval (see Hierarchy Nodes) *this is where I am lost, which should I select to list values with pattern ' *Z7' and ' Z8' in a node or two
    8. Repeat this procedure until the hierarchy structure has been set. For more information, see Modeling Nodes and Leaves.
    A hierarchy can contain 50,000-100,000 leaves at most. If your hierarchy is larger, you should insert a level that is used as a navigation attribute or preferably as a separate characteristic in the dimension table.
    9. You can use Level Maintenance and Hierarchy Attributes to set how the hierarchy is to be displayed and processed in reporting (see Level Maintenance and Hierarchy Attributes).
    10. Save the hierarchy.
    Your assistance will be appreciated.

    Hierarchy not used in this case. Could not fnd an answer.

  • How to install/add packages to org.apache

    hi everyone!
    i'm pretty new with Java and i wanted to know how to install a package i downloaded from "http://www.apache.org/dist/jakarta/". the package name is poi and i have no clue how to do it so i'll be able to import some classes from it in my code... (i tried to just paste it the file src.zip at the location org/apache but it didn't worked)
    thanks for you help,
    shimon ;)

    "install" isn't really the right word. You'll have to learn to think differently about JARs in Java. because you don't "install" them and your apps don't get access to them via the operating system. They're more like dynamic link libraries or DLLs in Windows parlance.
    What you should do is figure out what a standard directory structure for all your applications will be, maybe something like this:
    application
    +
    +------source (put your .java source files in their package structure under here)
    +------lib (put your 3rd party JAF files under here)
    +------classes (compile your .class files to this directory)
    So in this case you'd put the POI JAR under /lib for your project. Tell Eclipse that /source is where it should expect to find all the .java file, that /class is the output directory for all compilations. Right click on the project folder, select "Properties", and add all the JARs to the build class path. Then you'll be all set with Eclipse.
    Tell Eclipse that application is the root of your project. Tell

  • Urgent:::how to get the employee hierarchy

    hi all.
    let me know how to get the employee hierarchy in HR organizational management.
    like when we give emp id it shows developer name---superior( team lead name)-superior(project lead name)---
    points will be rewarded for valuable answer.

    Hi,
    1) You can use the relation '002' in the table HRP1001, between the position of developer (objid) and get the position of team lead (sobid field). With the position of the team lead got in SOBID field... with the relation '008' get the person name.
    2) You can use the transaction PPOM_OLD to view the reporting structure...
    Regards,
    Meera

  • Appl.  Hierarchy and Package Hierarchy - what is the Best practice ?

    Hi!
    We plan to create a Package Hierarchy in our system, but then come to think of the Application Hierachy is built the way we think of building the Package Hierarchy.  We planned to build a Main package called fex. HR and below a structure package called HR-PA and below that ordinary packages within that area. But should we rather create our own application hierarchy for this?
    Or should we assign the packages to Sap standard application Hierarchy in the HR area ?
    What is the Best practice in this area ? Have any tried to create their own hierarchies ?
    Regards, Tine

    Hi!
    You can create your own Application Hierarchy as well .
    From ABAP Workbench select Overview->Applic. hierarchy->SAP or Customer
    This is what SAP says about this :
    <i>The application component hierarchy is a method of splitting up the SAP System from a logical or <b>business</b> point of view. Packages are a method of modularizing the system from a <b>technical</b> point of view. This technical modularization can, but need not, match the logical division of the system. Assignments should be made however between these two views.</i>
    Regards, Tine

  • JDeveloper 10g CVS package hierarchy gone after check out?

    Hello!
    We are using JDeveloper 9.0.5.2 (Build 1618) together with WinCvs 1.3.17.2.
    We successfully imported with JDev a project structure as
    client/moduleA/ui;
    client/moduleA/db;
    client/moduleA/ctr;
    client/moduleB/ui;
    client/moduleB/db;
    client/moduleB/ctr;
    into my repository - connecting with a pserver.
    If an other pserver-User tries to check out the module CVSRoot, the package hierarchy - as described above - is gone.
    All files are mixed up in flat packages ,,Miscellaneous Packages'' and ,,Miscellaneous Files''.
    The created file structure is ok (the package hierarchy remained). But as mentioned, the Application Navigator just shows the flat Miscellaneous file structure.
    For check out with the ,,Check Out from CVS Wizard'', in step 4 of 4, the options
    ,,prune empty folders'' ,
    ,,checkout into Target Folder'' ,
    ,,Do Not Shorten Pathnames'',
    were checked.
    What do we have to do, to see in the Application navigator - after a check-out - the imported tree of packages, instead of a flat structure?
    Thank you in advance for your answer!

    Hi,
    Was the project imported to CVS at the same time as the package structure?
    Do the project source paths match the filesystem? For example, does the java source path match the root of the java source? Jdev normally puts files in a flat structure if the files are not in the right file system folder for their java package.
    If changing the project path does not fix this can you tell me what technologies your using, such as BC4J, struts, Tag libs, etc.. Then I can try and reproduce this here.
    Many thanks,
    Geoff
    JDev SCM Team
    -------------

  • When and how to create a package

    I have a doubt about how Oracle loads a package.
    Let's suppose I have a package PACK1 with N procedures inside. When I execute a statement such an EXEC PACK1.PROC3(), does Oracle load all the N procedures of the package PACK1 into the SGA? I ask for that for a simple reason. I usually create a package according to the fact that all the procedures inside that package are "connected" among them in some way. A collegue of mine said me that he would like to put in a same package some more procedures even if they aren't all called among them, but because in some way thay deal with the same topic. Since I think Oracle loads all the package in SGA, I believe it would make sense to put inside a package only the procedures called among them.
    Can you help me?
    Thanks!

    Mark1970 wrote:
    I have a doubt about how Oracle loads a package.
    Let's suppose I have a package PACK1 with N procedures inside. When I execute a statement such an EXEC PACK1.PROC3(), does Oracle load all the N procedures of the package PACK1 into the SGA?Whenever any element of the package is referenced, the whole package is loaded into memory and (assuming it is not aged out) remains in memory for future use.
    I ask for that for a simple reason. I usually create a package according to the fact that all the procedures inside that package are "connected" among them in some way. A collegue of mine said me that he would like to put in a same package some more procedures even if they aren't all called among them, but because in some way thay deal with the same topic. Since I think Oracle loads all the package in SGA, I believe it would make sense to put inside a package only the procedures called among them.You are right. Also if other elements in the package are needed the overhead of calling them is very small, because they are in the same memory area. This means that you can and should group related program units together so that they can share data structures when needed and call each other with minimal overhead

  • How to call a package from the Report in Oracle Application Express

    How to call a package from the Report in Oracle Application Express

    Hello,
    What do you mean? Something like SELECT mypackage.function( par1, par2) from dual?
    Or do you want to execute a procedure when something happens on the page, like clicking a button?
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • How to structure several scenes (in symbols) on the main stage timeline

    Hi,
    I'm new to edge animate but have a Flash background and I'm working in Edge Animate on a game which is structured in several scenes. Each scene I did put in a symbol. Now I wonder how to build the main timeline or the "story - controller" so to speak. I have all the scenes but I do not know how to connect them.
    In Flash it was possible to add keyframes of scenes one after another (like stairs) and jump forward or backward if needed to load the movie clips. In Edge Animate all scenes (or symbols) are in place from the beginning of the timeline and I cannot move the symbol to a later keyframe. Of course I can move animations in the timeline. The only way I think is to hide the symbols first and make them visible if needed. But this does not seem to be the right way and I don't understand the concept of structuring complex animations yet.
    I would like to know how to structure several scenes in Edge Animate properly. Something like a scene loader or unloader would be useful. Highly appriciate any hints to a solution.
    Thank you,
    JP

    resdesign wrote:
    You can also use edgecommons to load edge composition into another edge composition.
    Thank you to your tipp so I try to organize my scenes into compositions. I can successfully load a composition (scene2) into the main container :
    EC.loadComposition("scene2.html", sym.getSymbol("mainContainer"));
    Now I'm facing another situation. At the end of the loaded composition scene2 is a "Next Scene" button suppose to load scene3.html composition into the main container. "Next Scene" is a nested button inside the loaded composition screen2 symbol. How do I load the next compostion from the current one? This code for On Click of course does not work:
    EC.loadComposition("scene3.html", sym.getSymbol("mainContainer"));
    I think the refer to the mainContainer is wrong. Is it just a targeting issue or is it the wrong approach in general?

  • How to open a package body in Oracle sql developer

    How to open a package body in Oracle sql developer..any shortcut for that

    I need another way to get to my package body. I'm on a locked down system, so the only way I can reference anything is if I already know the name of it. I accidentally overwrote my text document that I was using to work on it and I closed out of the package body in sqldeveloper. There must be a command, like an alter or some such. Anyone know the old fashioned way of looking at a package?

  • How to create a package in ECC 6.0.

    Hi,
    Can you tell me how to create a package in ECC 6.0 system?
    Thanks in advance,
    Regards,
    Arnab.

    Hi,
    Thank you for your replies.
    Can you tell me the difference and uses of the two types of package I can create from SE21.
    i.e. : Package and package interface. any sap link would also be helpful. I need to know where i can use what and what would be helpful for my case.
    Regards,
    Arnab.

Maybe you are looking for