Java packages and dependency

When java was being developed, what was the philosophy behind allowing packages to be mutually dependent?

Hello Steve,
The Acyclic Dependencies Principle tells us that no cycles should exit in a model depicting the dependencies between packages. From what I can gather this is useful when developing large software systems, as each package becomes a viable work unit for an engineer or small group of engineers to control as a series of releases. If the ADP is not complied with, cycles may exist in the dependencies between packages. If a change is made to one of those packages within a cycle, then an ugly situation develops as the repercussions of the change are looped through the cycle back to its source and so on.
The thing is though, during my readings I came across a statement that said Java packages were mutually dependent. I was just wanting to know why a language that utilises object oriented technology, left the practice of the ADP up to the descretion of the developer? Is the full implementation of ADP on a software system an ideal world scenario?
Anders.

Similar Messages

  • JAVA PACKAGES and JSP

    i Have two problems one is i am designing a website which consists of a form. I am trying to write the Connectiviy and all other insert statements in seperate java packages and include them in JSP files.
    i Have two java packages one is DBUtil(having two java files both dealing with connectovity) and another one is StudentUtIl which has java files that open the connections with database connection and insert data into DB., I am having a big Problem here. How can i call the function in the other java package in the files in this java package. i have openDB()and Close() in the other Db and i want to call these functions in JAVA classes in the other package. How to include a package. Both these packages are in the same File system mounted on a Local directory

    Thank you for the reply. I am giving the code i have given the full class name . and now it is giving the following error :
    Cannot reference a non-static method connectDB() in a static context.
    I am also giving the code. Please do help me on this. i am a beginner in java.
    import java.sql.*;
    import java.util.*;
    import DButil.*;
    public class StudentManager {
    /** Creates a new instance of StudentManager */
    public StudentManager() {
    Connection conn = null;
    Statement cs = null;
    public Vector getStudent(){
    try{
    dbutil.connectDB();
    String Query = "Select St_Record, St_L_Name, St_F_Name, St_Major, St_Email_Address, St_SSN, Date, St_Company, St_Designation";
    cs = conn.createStatement();
    java.sql.ResultSet rs = cs.executeQuery(Query);
    Vector Studentvector = new Vector();
    while(rs.next()){
    Studentinfo Student = new Studentinfo();
    Student.setSt_Record(rs.getInt("St_Record"));
    Student.setSt_L_Name(rs.getString("St_L_Name"));
    Student.setSt_F_Name(rs.getString("St_F_Name"));
    Student.setSt_Major(rs.getString("St_Major"));
    Student.setSt_Email_Address(rs.getString("St_Email_Address"));
    Student.setSt_Company(rs.getString("St_Company"));
    Student.setSt_Designation(rs.getString("St_Designation"));
    Student.setDate(rs.getInt("Date"));
    Studentvector.add(Student);
    if( cs != null)
    cs.close();
    if( conn != null && !conn.isClosed())
    conn.close();
    return Studentvector;
    }catch(Exception ignore){
    return null;
    }finally {
    dbutil.closeDB();
    import java.sql.*;
    import java.util.*;
    public class dbutil {
    /** Creates a new instance of dbutil */
    public dbutil() {
    Connection conn;
    public void connectDB(){
    conn = ConnectionManager.getConnection();
    public void closeDB(){
    try{
    if(conn != null && !conn.isClosed())
    conn.close();
    }catch(Exception excep){
    The main error is occuring at the following lines connectDB() and closeDB() in the class student manager. The class dbutil is in an another package.with an another file called connectionManager which establishes the connection with DB. The dbutil has the openconnection and close connection methods. I have not yet written the insert statements in StudentManager. PLease do Help me

  • Java package and c++ header files

    What is the difference between importing java package and including header files in c++?

    I do not know .. have been away from C/C++ for a long time...
    As much as I remember you can only import one header file each time... also when you import a header file you can just call methods from the header file automatically ...
    However I could be very wrong on this .. really lost touch from C/C++ ...
    regards,
    Sim085

  • To know abt java packages and classes

    please give an idea abt how to find the list of packages and classes
    available in the java packages

    Which ones? If you mean the ones available in the standard Java APIs, check the java-docs:
    1.4.2:
    http://java.sun.com/j2se/1.4.2/docs/api/
    1.5:
    http://java.sun.com/j2se/1.5.0/docs/api/

  • 2 files in same package and depends each other need import package??

    test1.java and test2.java are in the same package mypackage,
    and test1.java will call methods in test2.java, does it mean
    test1.java needs to import mypackage.test2;
    i.e.
    //test1.java
    package mypackage;
    import mypackage.test2;
    class test1
    }

    no, once classes are in the same packages they are picked up ie tc1 is in tc_package and tc2 is also in tc_package, tc1 need not import tc_package.tc2 to use tc2 methods.
    /Paul

  • Java Package/Class Dependency

    Hi, friends,
    I would like to get a list of packages that a given package depends on. If it is possible, I would also know which class of the given package depends on which classes.
    Is there any software to do this?
    If I would like to write a Java utility for that purpose, how can I proceed?
    Best regards,
    Youbin

    in the HTML fles of the java doc, you can know the class hierarchy and antecedents of each class. For example, class JComponent :
    java.lang.Object
    |
    --java.awt.Component
    |
    --java.awt.Container
    |
    --javax.swing.JComponent
    Moreover, the java doc also show the inner classes, fields and methods inherited from those super classes...
    you may also know which classes extends this one. For example JComponent :
    All Implemented Interfaces:
    ImageObserver, MenuContainer, Serializable
    Direct Known Subclasses:
    AbstractButton, BasicInternalFrameTitlePane, Box, Box.Filler, JColorChooser,
    JComboBox, JFileChooser, JInternalFrame, JInternalFrame.JDesktopIcon, JLabel,
    JLayeredPane, JList, JMenuBar, JOptionPane, JPanel, JPopupMenu, JProgressBar,
    JRootPane, JScrollBar, JScrollPane, JSeparator, JSlider, JSpinner, JSplitPane,
    JTabbedPane, JTable, JTableHeader, JTextComponent, JToolBar, JToolTip, JTree,
    JViewport
    vincent

  • Java Packages and Imports

    Hi,
    I have 2 java classes
    A.java
    B.java
    ### A.java ###
    import B;
    public class A
    public static void main(String[] args)
    public class B
    public void foo()
    when I compile B , it works fine, but when i compile A.
    it gives following error
    '.' expected
    why java doesn't allow to create & import a class without package, is there any workaround to resolve this issue
    this is a sample code i have posted, but actually I am facing the same problem in my current project. even if i include that class in classpath error doesn't go away.
    Please suggest what can be done to resolve this issue.
    Thanks in advance.
    NP

    - the default package (the package with no name)It does? Not for me.Gosh, you're right, it doesn't. Sorry.
    Actually, I never use it, my post was a copy/past from damned tutorial...
    - Tim - Harakiri - aaarrhhggg...

  • Packages and packages

    Hi
    I was rereading Martin's principles of package architecture and was wondering how the concept of package in this context relates to the concept of a Java package
    after thinking a bit, I got the feeling these two concepts have nothing to do with each other
    I feel that Java packages deal with namespace and access control, while OO packages (the components of your program's binaries) would be, in the Java world, jar files containing classes from different packages (and not especially all classes from these (Java) packages), and constructed as much as possible in order to follow these supposedly good OO principles
    Am I right ? partially ? totally ? totally not ? I need some insight on this

    Kind of. But what would stop me to define the
    namespace on a per-component base? I used structures
    like com.mycompany.myapp.database (data tier),
    com.mycompany.myapp.web (presentation tier) and the
    likes. You could put classes (or packages) belonging
    to a certain subsystem into a package dedicated to it.I did it for a long time too, traditionaly with webapps :
    be.mycompany.myapp
    dataaccess
    business
    web
    and that worked fine... but that's not my concern
    actually, what concerns me is the business package itself... I'm writing a very simple peer2peer file sharing tool for both fun & education, and the packaging becomes trickier, since the app is naturally distributed :
    * file sharing client package
    * user manager client package
    * server package (handles login requests & user management requests)
    thing is, I reuse many classes among these three "kinds of endpoint", which makes me think about properly dividing my app into small reusable, well-organised components... when java packages come into play, things are getting less clear as of how I should do...
    how do you people do when it comes to structuring (packages AND deliverables of) your business layer ?

  • Creating Packages and Namespace for Webdynpro Java applications in NWDS

    Hi Experts,
    I am working on a stand alone application and using NWDS for the same. This application consist of some Webdynpro Java apps, Dictionary perspective DC's and BPM applications.
    I need to create a package and name space for all the applications. I have read some documents on creating SC in SLD and using it in NWDI. But since I am working on NWDS i am not able to see the SC.
    May be I am not following a correct procedure. Can some one provide a basic document or can tell me steps in short that i need to follow, for Name space and package creation and how to use them in NWDS.
    I am working on CE7.1 ehp1.
    Regards
    Pranav

    HI,
    This blog expalins how to Setup and configure NWDI System land scape:
    /people/bhavana.gupta/blog/2007/01/23/installation-and-configuration-of-netweaver-development-infrastructure-was-64
    NWDI Post installation:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/419b479b-0801-0010-f8a1-c26208b4b209
    http://help.sap.com/saphelp_nw70/helpdata/en/44/60dc1943c2311ce10000000a155369/frameset.htm
    Complete NWDI Resources:
    NWDI Resources [original link is broken]
    Thanks
    SrinivaS

  • Managing java files and packages

    Hi,
    I am just starting out with java and have reached the stage where I want to store my files in packages and the correct directory structure. I have read through the sun link below and have a question they seam to miss. They say that .java and .class files should be kept in separate places. ie sources and classes directories with the package directory names below. But I have found that unless you have the .class files you are referencing in the same directory as the .java files when you come to compile you will get an error so they have to be stored in the same directory???.. Does this make sence or have I gotten it all wrong.
    Thanks
    Joolz
    http://java.sun.com/docs/books/tutorial/java/interpack/managingfiles.html

    You should put path containing your classes in your classpath. There is a -classpath option in javac.

  • Java-JSP working with packages and classes

    Hi everybody,
    I'm bearly new on Java-JSP developping and I wanted to know how Tomcat (for example) manage the imported packages and classes.
    The fact is I'm working on a project ('/bob') which use some packages that I don't see in the '/bob' directory. So, is that possible that '/bob' is downloading packages and classes from Internet to '/bob/download' virtual repertory and use it? If it is true, is it possible to override this download by making '/bob' project using local packages or classes (example : com.boblibrary.classes.util in '/bob/WEB-INF/classes/com/boblibrary/classes/util') instead of downloading it?
    Therefore, the '/bob' project is using bugged classes (that I think it downloads from Internet) which I can't correct.
    Thanks for your help.
    - Renaud

    Thank you for your answer, but I can't imagine where is physicaly the class that my project use and show me as http://localhost:8080/atlassian-jira-3.13.2/download/ressources/br.com.ecore.jira.plugin.projectViewPlugin:ProjectViewTabPanel/js/projectviewtabpanel.js. Where is that Javascript file suppose to be on my hard drive? Or where is that class 'br.com.ecore.jira.plugin.projectViewPlugin' suppose to be on my hard drive? If it is not dowloaded from the Internet.
    I have no trace of that class on 'atlassian-jira-3.13.2/', neither on 'jdk1.6.0_18/', 'jre6/' or 'apache-tomcat-5.5.28/common/classes/'.
    Thanks.

  • [svn:bz-trunk] 10059: update two package-info.java files, and add one new one.

    Revision: 10059
    Author:   [email protected]
    Date:     2009-09-08 11:31:48 -0700 (Tue, 08 Sep 2009)
    Log Message:
    update two package-info.java files, and add one new one.
    Modified Paths:
        blazeds/trunk/modules/proxy/src/flex/messaging/services/http/proxy/package-info.java
    Added Paths:
        blazeds/trunk/modules/core/src/flex/messaging/util/concurrent/package-info.java
        blazeds/trunk/modules/core/src/flex/messaging/validators/package-info.java

    Revision: 10059
    Author:   [email protected]
    Date:     2009-09-08 11:31:48 -0700 (Tue, 08 Sep 2009)
    Log Message:
    update two package-info.java files, and add one new one.
    Modified Paths:
        blazeds/trunk/modules/proxy/src/flex/messaging/services/http/proxy/package-info.java
    Added Paths:
        blazeds/trunk/modules/core/src/flex/messaging/util/concurrent/package-info.java
        blazeds/trunk/modules/core/src/flex/messaging/validators/package-info.java

  • How to use " toFront() " method in java application and in which package or

    How to use " toFront() " method in java application and in which package or class having this toFront() method.if anybody know pl. send example.

    The API documentation has a link at the top of every page that says "Index". If you follow that and look for toFront(), you will find it exists in java.awt.Window and javax.swing.JInternalFrame.
    To use it in a Java application, create an object x of either of those two classes and write "x.toFront();".

  • Packaging and Delpoying Java Application

    I have a java application that i want to package and deploy. I have used JSmooth to wrap my jar file into an exe file. However I was wondering if there are any applications that could be used to install this program like other installers do (ask path, create shortcut, etc).

    There are several packages available that let you create an installer which lets the customer select where to install your app, creates a native executable to launch your java app, adds desktop icons, menus, etc.
    Here's a list of some of apps available:
    http://www.javalobby.org/articles/java2exe/#setup

  • Packaging and installing a java project

    Hi everyone,
    I have a java project which has been developed in Eclipse IDE. I would like to package the project so that i it can be installed and can be run as a stand alone product.
    Any tools that would help me do packaging and installing a java project?
    Thank you.

    Easiest way to package a Java project is to create an executable jar for it. You probably should google for more information on the 'jar.exe' program (sry for window bias)
    If you have external dependencies you should put those in separate jars and include them in the classpath in the jar manifest file.
    The only other thing to worry about is getting java installed on other people's machines. In general it is best if possible to have them download java themselves as they will get the latest and greatest from this website. If that's not possible you may want to look into getting sun's permission to distribute Java with your app.

Maybe you are looking for

  • "empty file" error with CS5, linux server and mavericks

    hello to the community, i'm the owner of a small online marketing agency. we have been using different macs here since 10.6. until mavericks with adobe CS 5 and a linux server for years. today i got a new MBP retina with mavericks and since now i hav

  • Having some trouble rounding decimal place

    Hello all, I am having some issues rounding a decimal in my code. My program is running and doing what I would like otherwise. Here is what I have so far: public class MortCalc2      public static void main(String [] args)           //Declare and ini

  • Volume exceeds maximum file size

    Hi, I am trying to compress a FC7 file using Compressor. I want to compress as a ProRes and as .264 file. I have an error each time: it says: "volume exceeds maximum file size". I don't understand where it come from. I have got space on my disk. I do

  • Intel Rapid Storage Technology (pre-OS) driver installation

    My desktop machine is built on Gigabyte GA-Z87-UD3H and Gigabyte provides the latest driver for Intel Rapid Storage Technology (IRST), which I installed after installing the OS. Same goes for my Lenovo Thinkpad-T420. And for both machine, checking th

  • SCOM 2007 R2 gateway having not granted "log on locally" right

    how we can fix the issue. i used a local account for the gateway which is working previously.