Best practices for package directory structure?

I've only compiled a few java programs & while I find the language itself very easy to adapt to from C++ and Javascript, I get confused about the directory structure and classpaths & such.
My main method of operation is to build small tools and test projects, and I would like to follow good practices for organizing my directory structure, so it will (a) work well with java, and (b) work well with my source control software.
Let's say I am developing packages named "com.example.test.test1", "com.example.test.test2", "com.example.tools.flapper", and "com.example.tools.spinner".
I know I can use this structure:
/java/test/test1/com/example/test/test1/* (files for com.example.test.test1 including test1.java)
/java/test/test2/com/example/test/test2/* (files for com.example.test.test2 including test2.java)
/java/tools/flapper/com/example/tools/flapper/* (files for com.example.tools.flapper including flapper.java)
/java/tools/spinner/com/example/tools/spinner/* (files for com.example.tools.spinner including spinner.java)
But the directories seem unnecessarily deep & lead to a hassle in source control that makes it difficult to browse.
Can I use this? and if so, how do I run "javac" and "jar" properly to compile/jar-ify each package?
/java/com/example/test/test1/* (files for com.example.test.test1)
/java/com/example/test/test2/* (files for com.example.test.test2)
/java/com/example/tools/flapper/* (files for com.example.tools.flapper)
/java/com/example/tools/spinner/* (files for com.example.tools.spinner)
also is it recommended to leave the .class files in the same dirs as the .java files, or better to have a separate tree for compiled .class files?

hmm, there's a lot to absorb here...
I found these articles online that seem good:
http://www.onjava.com/pub/a/onjava/2003/12/17/ant_bestpractices.html
http://www.kevinboone.com/classpath.html
I'd like to use ant if possible & understand it; I've had troubles with IDEs in the past and would like to just stick with basic build mechanisms.
I guess as a practical example let's say I have two different applications that use the serial port, that I want to release separately, each in separate .jar files. One is called com.example.applications.serial1 and the other is com.example.applications.serial2. They both use rxtx.org's gnu.io.* libraries. Serial1 uses some packages that I have developed: com.example.tools.spinner and com.example.tools.flapper, whereas Serial2 uses com.example.tools.spinner and com.example.tools.flopper
I think I want to organize things this way: (everything below under /java/src/)
com
example
applications
serial1
serial1.java
serial2
serial2.java
tools
spinner
spinner.java
flapper
flapper.java
flopper
flopper.java
and I think I want to compile to /java/classes/:
com
example
applications
serial1
serial1.class
serial2
serial2.class
tools
spinner
spinner.class
flapper
flapper.class
flopper
flopper.class
but I'm sort of lost on where to put the ant buildfiles, which directories to be in to run javac, and how to get the jar files right. From what I've searched for online, the external libraries (RXTX's jar files & .dlls for windows) are "interesting", and the easiest thing is to tell users of my .jar files to put the rxtx libs in the same library as the .jar files so I can set the Class-Path: in the .jar manifest to point to them.

Similar Messages

  • What are best practice for packaging and deploying j2EE apps to iAS?

    We've been running a set of J2EE applications on a pair of iAS SP1b for about a year and it has been quite stable.
    Recently however we have had a number of LDAP issues, particularly when registering and unregistering applications (registering ear files sometimes fails 1st time but may work 2nd time). Also We've noticed very occasionally that old versions of classes sometimes find their way onto our machines.
    What is considered to be best practice in terms of packaging and deployment, specifically:
    1) Packaging - using the deployTool that comes with iAS6 SP1b to package is a big manual task, especially when you have 200+ jsp files. Are people out there using this or are they scripting it with a build tool such as Ant?
    2) Deploying an existing application to multiple iAS's. Are you guys unregistering old application then reregistering new application? Are you shutting down iAS whilst doing the deployment?
    3) Deploying ear files can take 5 to 10 mins, is this normal?
    4) In a clustered scenario where HTTPSession is shared what are the consequences of doing deployments to data stored in session?
    thanks in asvance for your replies
    Owen

    You may want to consider upgrading your application server environment to a newer service pack. There are numerous enhancements involving the deployment tool and run time layout of your application that make clear where you're application is loading its files from.
    If you've at a long running application server environment, with lots of deployments under your belt, you might start to notice slow downs in deployment and kjs start time. Generally this is due to garbage collecting in your iAS registry.
    You can do several things to resolve this. The most complete solution is to reinstall the application server. This will guarantee a clean ldap registry. Of course you've got to restablish your configurations and redeploy your applications. When done, backup your application server install space with the application server and directory server off. You can use this backup to return to a known configuation at some future time.
    For the second method: <B>BE CAREFUL - BACKUP FIRST</B>
    There is a more exhaustive solution that involves examining your deployed components to determine the active GUIDS. You then search the NameTrans section of the registry searching for Applogic Servlet *, and Bean * entries that represent your previously deployed components but are represented in the set of deployed GUIDs. Record these older GUIDs, remove them from ClassImp and ClassDef. Finally remove the older entries from NameTrans.
    Best practices for deployment depend on your particular environmental needs. Many people utilize ANT as a build tool. In later versions of the application server, complete ANT scripts are included that address compiling, assembly and deployment. Ant 1.4 includes iAS specific targets and general J2EE targets. There are iAS specific targets that can be utilized with the 1.3 version. Specialized build targets are not required however to deploy to iAS.
    Newer versions of the deployment tool allow you to specify that JSPs are not to be registered automatically. This can be significant if deployment times lag. Registered JSP's however benefit more fully from the services that iAS offers.
    2) In general it is better to undeploy then redeploy. However, if you know that you're not changing GUIDs, recreating an existing application with new GUIDs, or removing registered components, you may avoid the undeploy phase.
    If you shut down the KJS processes during deployment you can eliminate some addition workload on the LDAP server which really gets pounded during deployment. This is because the KJS processes detect changes and do registry loads to repopulate their caches. This can happen many times during a deployment and does not provide any benefit.
    3) Deploying can be a lengthy process. There have been improvements in that performance from service pack to service pack but unfortunately you wont see dramatic drops in deployment times.
    One thing you can do to reduce deployment times is to understand the type of deployment. If you have not manipulated your deployment descriptors in any way, then there is no need to deploy. Simply drop your newer bits in to the run time space of the application server. In later service packs this means exploding the package (ear,war, or jar) in to the appropriate subdirectory of the APPS directory.
    4) If you've changed the classes of objects that have been placed in HTTPSession, you may find that you can no longer utilize those objects. For that reason, it is suggested that objects placed in session be kept as simple as possible in order to minimize this effect. In general however, is not a good idea to change a web application during the life span of a session.

  • Best practices for Refreshing Unv Structure for SAP based universes

    This may sound basic and I apologize for asking this, but the refresh structure in SAP based universes is somewhat different from noraml universes.
    Here is what i'd like to do:
    - Hide all the L00 objects.
    - Rename all the L01 objects and move them to a new Class.
    - Change some of the detail (attribute) objects to dimension objects.
    - Hide the format and Unit for key figures.
    - Hide all of the classes/subclasses  that get automatically generated when a SAP based universe is created.
    I have noticed that when I do the above and refresh the universe, it assumes that all these objects have gone missing from the original classes and adds them back to the universe.
    I also want to make sure that if the select of an object gets updated and the object is re-named, then it should automatically pick up the change.
    Lastly, I have some reports which were built prior to this renaming. I want to make sure that the reports do not break.
    Thanks,
    Kashif

    Hi,
    This thread is really old. 
    Yes it was a common problem back in the earlier XI 3.x days . a lot of bugs in this area were eliminated by the time of XI 3.1 SP03 FP3.x   -  you don't quote your version.
    Actually, you need to be aware that a refresh structure is often not needed, and can corrupt the olap universe . Pls check out Note 1278216 - What are the best practices for OLAP Universe Change Management when using SAP Integration Kit?
    in essence :
    Only use 'Refresh Structure' functionality If: 
    - A new Object (Dimension/Characteristic) has been added to the BEx query (Rows/Columns/Free Characteristics)
    - A new Variable Restriction has been added to the Bex query Filters
    Do not use 'Refresh Structure' functionality after:
    - Having modified a STRUCTURE in BEx. i.e. 'Detail view of Formula' or 'Details of Selection', or changing the General Description of structure members.
    - Doing manual actions on objects/classes in the OLAP Universe like:  Move ; Cut/Paste ; Drag/Drop ; Hide ; Delete.
    (because these workflow can lead to corruption)
    regards,
    H

  • What is the best practice for package source locations?

    I have several remote servers (about 16) that are being utilized as file servers that have many binaries on them to be used by users and remote site admins for content. Can I have SCCM just use these pre-existing locations as package sources, or is this
    not considered best practice? 
    Or
    Should I create just one package source within close proximity to the Site Server, or on the Site Server itself?
    Thanks

    The primary site server is responsible for grabbing the source data and turning it into packages for Distribution points.  so while you can use ANY UNC to be a source location for content, you should be aware of where that content exists in regards
    to your primary site server.  If your source content is in Montana but your primary server is in California ... there's going to be a WAN hit ... even if the DP it's destined for is also in Montana.
    Second, I strongly recommend locking down your source UNC path so that only the servers and SCCM admins can access it.  This will prevent side-loading of content  as well as any "accidental changing" of folder structure that could cause
    your applications/packages to go crazy.
    Put the two together and I typically recommend you create a DSL (distributed source library) share and slowly migrate all your content into it as you create your packages/applications.  You can then safely create batch installers, manage content versions,
    and other things without fear of someone running something out of context.

  • Best Practice for Software Update Structure?

    Is there a best practice guide for Software Update Structure?  Thanks.  I would like to keep this neat and organized.  I would also like to have a test folder for updates with test group.  Thanks.

    Hi,
    Meanwhile, please refer to the following blog get more inspire.
    Managing Software Updates in Configuration Manager 2012
    http://blogs.technet.com/b/server-cloud/archive/2012/02/20/managing-software-updates-in-configuration-manager-2012.aspx
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Best practice for Active Directory User Templates regarding Distribution Lists

    Hello All
    I am looking to implement Active Directory User templates for each department in the company to make the process of creating user accounts for new employees easier. Currently when a user is created a current user's Active directory account is copied, but
    this has led to problems with new employees being added to groups which they should not be a part of.
    I have attempted to implement this in the past but ran into an issue regarding Distribution Lists. I would like to set up template users with all group memberships that are needed for the department, including distribution lists. Previously I set this up
    but received complaints from users who would send e-mail to distribution lists the template accounts were members of.
    When sending an e-mail to the distribution list with a member template user, users received an error because the template account does not have an e-mail address.
    What is the best practice regarding template user accounts as it pertains to distribution lists? It seems like I will have to create a mailbox for each template user but I can't help but feel there is a better way to avoid this problem. If a mailbox is created
    for each template user, it will prevent the error messages users were receiving, but messages will simply build up in these mailboxes. I could set a rule for each one that deletes messages, but again I feel like there is a better way which I haven't thought
    of.
    Has anyone come up with a better method of doing this?
    Thank you

    You can just add arbitrary email (not a mailbox) to all your templates and it should solve the problem with errors when sending emails to distribution lists.
    If you want to further simplify your user creation process you can have a look at Adaxes (consider it's a third-party app). If you want to use templates, it gives you a slightly better way to do that (http://www.adaxes.com/tutorials_WebInterfaceCustomization_AllowUsingTemplatesForUserCreation.htm)
    and it also can automatically perform tasks such as mailbox creation for newly created users (http://www.adaxes.com/tutorials_AutomatingDailyTasks_AutomateExchangeMailboxesCreationForNewUsers.htm).
    Alternatively you can abandon templates at all and use customizable condition-based rules to automatically perform all the needed tasks on user creation such as OU allocation, group membership assignment, mailbox creation, home folder creation, etc. based on
    the factors you predefine for them.

  • Best Practices for Packaging and Deploying Server-Specific Configurations

    We have some server-specific properties that vary for each server. We'd
    like to have these properties collected together in their own properties
    file (either .properties or .xml is fine).
    What is the best-practices way to package and deploy an application (as an
    ear file), where each server needs some specific properties?
    We'd kind of like to have the server-specific properties file be stored
    external to the ear on the server itself, so that the production folks can
    configure each server's properties at the server. But it appears that an
    application can't access a file external to the ear, or at least we can't
    figure out the magic to do it. If there is a way to do this, please let me
    know how.
    Or do we have to build a unique ear for each server? This is possible, of
    course, but we'd prefer to build one deployment package (ear), and then
    ship that off to each server that is already configured for its specific
    environment. We have some audit requirements where we need to ensure that
    an ear that has been tested by QA is the very same ear that has been
    deployed, but if we have to build one for each server, this is not
    possible.
    Any help or pointers would be most appreciated. If this is an old issue,
    my apologies, would you please point me to any previous material to read?
    I didn't see anything after searching through this group's archives.
    Thanks much in advance,
    Paul
    Paul Hodgetts -- Principal Consultant
    Agile Logic -- www.agilelogic.com
    Consulting, Coaching, Training -- On-Site & Out-Sourced Development
    Java, J2EE, C++, OOA/D -- Agile Methods/XP/Scrum, Use Cases, UI/IA

    The one draw back to this is you have to go all the way back to ant and the
    build system to make changes. You really want these env variables to be
    late binding.
    cheers
    mbg
    "Sai S Prasad" <[email protected]> wrote in message
    news:[email protected]...
    >
    Paul,
    I have a similar situation in our project and I don't create ear filesspecific
    to the environment. I do the following:
    1) Create .properties file for every environment with the same attributename
    but different values in it. For example, I have phoneix.properties.NT,phoenix.properties.DEV,
    phoenix.properties.QA, phoenix.properties.PROD.
    2) Use Ant to compile, package and deploy the ear file
    I have a .bat file in NT and .sh for Solaris that in turn calls theant.bat or
    ant.sh respectively. For the wrapper batch file or shell script, you canpass
    the name of the environment. The wrapper batch file will copy theappropriate
    properties file to "phonenix.properties". In the ant build.xml, I alwaysrefer
    to phonenix.properties which is available all the time depending on theenvironment.
    >
    It works great and I can't think of any other flexible way. Hope thathelps.
    >
    Paul Hodgetts <[email protected]> wrote:
    We have some server-specific properties that vary for each server. We'd
    like to have these properties collected together in their own properties
    file (either .properties or .xml is fine).
    What is the best-practices way to package and deploy an application (as
    an
    ear file), where each server needs some specific properties?
    We'd kind of like to have the server-specific properties file be stored
    external to the ear on the server itself, so that the production folks
    can
    configure each server's properties at the server. But it appears that
    an
    application can't access a file external to the ear, or at least we can't
    figure out the magic to do it. If there is a way to do this, please
    let me
    know how.
    Or do we have to build a unique ear for each server? This is possible,
    of
    course, but we'd prefer to build one deployment package (ear), and then
    ship that off to each server that is already configured for its specific
    environment. We have some audit requirements where we need to ensure
    that
    an ear that has been tested by QA is the very same ear that has been
    deployed, but if we have to build one for each server, this is not
    possible.
    Any help or pointers would be most appreciated. If this is an old issue,
    my apologies, would you please point me to any previous material to read?
    I didn't see anything after searching through this group's archives.
    Thanks much in advance,
    Paul
    Paul Hodgetts -- Principal Consultant
    Agile Logic -- www.agilelogic.com
    Consulting, Coaching, Training -- On-Site & Out-Sourced Development
    Java, J2EE, C++, OOA/D -- Agile Methods/XP/Scrum, Use Cases, UI/IA

  • Best Practice for Package Implementation of Data Manipulation

    Hi,
    Would like to ask which is better implementation for data manipulation (insert, update, delete) stored procedure for a single table.
    To create a single procedure with input parameter for the action such as 1 for insert, 2 for update and so on
    or
    to create separate procedures for each like procedure pInsData for insert, pUpdData for update...

    Hi,
    Whenever you create a procedure it resides as a seperate object in database.
    In my opinion its better to create a single procedure which takes care of all DML concern to a table, rather than creating different procedures for each DML.
    If your number of DML are more and interrelated then its better to create a package and put all related DML procedures in the package concern to one transaction or table. This is because whenever you will call a package entire package will be placed in the memory for a particular session. So if you create different procedures for DML then you need to call the procedures each time you want it to be executed.
    Twinkle

  • SAP Best Practice for Plant Organizational Structure

    Hi
    Can one please suggest us . how we can design the Plant Structure ( Please refer OSS notes if you have ).
    1) Design of a Plant / Storage location if it is located in  different state. We have one manufacturing plant , and six storage ware house in different region within states and two outside states. They will just receive , Issue and do Physical Inventory .
    QN : Do we consider (Storage location )this as Plant or Storage Location ?
             Can one  one support with valid document from SAP Please
    Thanks

    Hi,
    If you are storing the material in 8 storage locations only, no tax related, material price do not change according to storage locations, material valuation only in one plant (manufacturing),In This case you can use two plant. One Plant (P1, Logical Plant) and one Storage location(in ur manufacturing plant) and another plant(P2, Statistical Plant) having your having your 8 storage locations, So that you can get inventory report plant wise, storage location wise with time period.
    Check following OSS notes:
    100757, 63493, 96262, 87843, 82033, 64946
    Regards,
    Biju K

  • Best practices for folder structure in SOA Project

    Actually, In my project, I have more than 10 BPEL process and several DBAdapters and some HumanTasks. For each BPEL process, JDeveloper creates .bpel, .componentType, wsdl files. For DBAdapters JDeveloper creates lot of files, and same for HumanTasks as well.
    By default Jdeveloper puts all these files in root directory of the Project. It looks messy having 100's of files in root directory.
    How can I organize all these files?
    What are the best practices for folder structure in SOA Project ?
    Thanks

    Yes Yatan. I did noticed that Polling service WSDL disabled in EM . But I want to try this approach beacause I want to move all database related stuff to one composite. I have another composite with 3 BPEL Processes. One BPEL queries external webservice and save the response in DB. One BPEL just fires the first Process(Query) and respond to caller with an unique id. I have Another BPEL which keeps polling on database for 5 sec(I'm using PICK Activity), if there is any new record in database it will retrun to caller. If no new records in database, returns empty to the caller after 5 sec.
    If I put all these in one composite, having lot of files in root directory, the composite really looks very messy.
    As you said, I want to have 2 composites. First Compoiste will have 3 BPEL processes, and 2nd Composite will have DB Polling and DB Save. I will have another project for MDS to store XSDs.
    So because I can't have Polling service as exposed service, I have to keep Polling service in the same Composite where the BPEL is. Now again it goes back to Big and messy project.
    Is there any way I can separate all DB related including polling in a separate Composite ?
    Thanks
    --Sreeny                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Best practice for data migration install v1.40 - Error 2732 Directory manag

    Hi
    I'm attempting to install SAP Best Practice for Data migration 1.40 on Win Server 2008 R2 (64 bit).
    Prerequisite error
    Installation program stops with missing file error
    The following file was not found
    ... \migration\InstallationWizard\BusinessObjects Data Services\setup.exe
    The file is necessary for successful installation. Please connect to internet or refer to Quick Guide (available on SAP note 1527151) for information regarding the above file.
    Windows installer log displays
    Error 2732 Directory Manager not initialized
    SAP note 1527151 does not exist or is internal.
    Any help appreciated  on what is the root cause of the error as the file does not exist in that folder in the installation zip file.
    Other prerequisite of .NET 3.5.1 met already.
    Patch is released since 20.11.2011 so I presume that it is a good installation set.
    Thanks,
    Alan

    Hi Alan,
    There are details on data migration v1.4 installations on SAP website and market place. The below link should guide to the right place. It has a power point presentation and other useful links as well.
    http://help.sap.com/saap/sap_bp/DMS_V140/DMS_US/html/index.htm
    Arun

  • Business Package for SAP Best Practices for Enterprise Portal

    Hi,
    We are implementing EP for ECC 5.0 and we have to web enable some FI transactions like FB50/fb60 etc. We want to use standard business package for this. The only business package that caters this requirement is "Business Package for SAP Best Practices for Enterprise Portal 60.1". When i checked the data source for this business package, the specification is for "SAP R/3 4.6B and above". Does this work for ECC 5.0 as well? In general does the R/3 specific business packages work for ECC versions? Please let me know. Thanks for the help.  I promise rewards.
    Regards
    Hari

    Hari,
    When you download the BPO via Portal Content Portfolio,
    each bpo has additional information on the release.
    For example for the one you are inquiring about - Business Package for SAP Best Practices for Enterprise Portal, the additional release information is provided on the following links;
    https://www2.iviewstudio.com/sdn/info/index.cfm?action=faqs&part=#QSR03
    https://www2.iviewstudio.com/sdn/detail_view/index.cfm?action=package_information&CatalogSet=SAP%20Content&ItemID=17212&CFID=7544845&CFTOKEN=99283970
    Regards,
    James

  • Best practices for using the knowledge directory

    Anyone know when it is best to store docs in the Knowledge Directory versus Collab? They are both searchable, but I guess you can publish from the Publisher to the KD. Anyone have any best practices for using the KD or setting up taxonomies in the KD?

    Hi Richard,
    If you need to configure dynamic pricing that may vary by tenant and/or if you want to set up cost drivers that are service item attributes, you should configure Billing Tables in the Demand Management module in 10.0. 
    The cost detail functionality in 9.4 will likely be changed to merged with the new pricing feature in 10.0.  The current plan is not to bring cost detail into the Service Catalog module.

  • BASELINE PACKAGE - V1-V2.603 and Best Practices for Pharmaceuticals

    Hi All,
             > Recently we have upgraded to EHP4 stack 4
             > I am trying to install BASELINE PACKAGE - V1-V2.603 I chose that because its localized for India.
             > When i am trying to install  BP-ERP05 603V7 and BP-INSTASS 600V7 its asking for BBPCRM 600, BBPCRM
                700 and SAP_APPL 600, SAP_APPL 603.
             > Why does the installer ask for lower versions? ofcourse i have read that if the version is Higher than the one mentioned
                in the "Quick Guide to Installing the SAP Best Practices Baseline Package (IN)" will not work.
             > But do we have any BaseLine Packages Specific to EHP4?
             > If not, then could any one tell me where and how to download and install the BBPCRM as an add-on.
             > I only need that Software component because I strongly feel that all the interdependencies are linked with this one only.
    Any help and suggestions are welcome.
    Regards,
    Antony Chaitanya.

    Hi Sunny,
                    Thanks very much for your response.
    The major problem that i am having is I some how did not include the BBPCRM software component or the related software components for CRM at the time of upgrade is my best guess.
    So, the latest add ons BP-CRM60 600V3 and BP-CRM70 700V1 or the add ons BP-ERP05 600VD/ 603V7 along with that BP-INSTASS 600V7 are not able to install because the prerequisite are not meeting. Only BP-INSTASS 600V1 got installed.
    Can any one tell me how and what to do now.... plzzz???
    Things like how to get the CRM related s/w components installed or if there is a work around to get the Baseline Packages (IN) activated with out the CRM.
    Regards,
    Antony Chaitanya.

  • [More information] 'SAP Best Practices Baseline package for Brazil V3.607'

    Hi.
    When I study 'SAP Best Practices Baseline package for
    Brazil V3.607', I wonder somthing.
    I want solution of problem.
    ---------Problem---------
    In '100: SAP Best Practices Installation' document on point 3.4 Define Tax Jurisdiction Code it says
    Enter the Jurisdiction Codes according to the document SMB41_J_1BTXJURV_B020_NFE.TXT.
    I have search the internet for this document and the only hit is the actual Best practice document.
    Does anybody knows where to get this document?
    ASAP, reply for me.
    Thanks.

    Dear Dimitry,
    the Best Practice baseline content is freely available to anyone w/o any charge.
    You find the whole content about it at:
    SAP Best Practices package for Russia V3.607 (English)
    SAP Best Practices package for Russia V3.607 (Russian)
    Kind Regards,
    Jan

Maybe you are looking for