Separate interfaces and classes in separate packages?

I am writing an application in the package 'models.geometry'. I am beginning to get a growing number of interfaces with corresponding implementation classes. I therefore consider adding another packages an move all the interfaces to this package and keep the implementation in the original package:
'models.igeometry' // for the interfaces
'models.geometry' // for the implementation
But is this interface/class - package separation good practice?

First of: Usage of the prefix "I" to identify interfaces is rather rare in the Java world (it's not unheard of, but definitely not the norm). And I've never seen "i<package>" to identify a package containing interfaces, so I wouldn't suggest it.
The question is: What does the code which uses your packages access? Does it only need the interfaces and a factory? In this case, I'd separate the packages into "models.geometry" and "models.geometry.impl".
If the classes are first-level API, just as the interfaces (think Link/ArrayList, Map/HashMap), then I'd keep them in the same package or separate them on some other property.

Similar Messages

  • [svn] 4081: Remove @private from an interface and class

    Revision: 4081
    Author: [email protected]
    Date: 2008-11-12 06:50:02 -0800 (Wed, 12 Nov 2008)
    Log Message:
    Remove @private from an interface and class
    QE Notes: None
    Doc Notes: None
    Bugs:
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBaseContentH older.as
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/messages/ISmallMessage.as

    System.arraycopy()
    You're almost certainly better off with a List implementation, though. Whether you use LinkedList or ArrayList should depend on your usage specifics, but from the limited information provided it seems that LinkedList would be a better choice.

  • About interface and class[Please read this]

    I writing what I found out:
    myinterface.java
    interface myinterface
    class A
    A()
    {System.out.println("A()
    of interface");}
    A.java
    class A implements
    myinterface
    A(){System.out.println("A()
    of A.java");}
    public static void main
    (String args[])
    A a=new A();
    //this calls A() of interface
    //myinterface.java
    //how come the output of
    // this code is like this

    how come this is possible?Well, it had to pick one or the other, since they
    have the same symbol name. Why are you choosing to
    make up goofy names that collide in the first place?
    If you want to explicitly use one or the other, you
    need to also choose a package name, and fully-qualify
    the class name that you are trying to instantiate.For example:
    package test;
    interface MyInterface // renamed to follow standard naming convention
      class A
        A() { System.out.println("A() of interface"); }
    class A implements MyInterface
      A() {System.out.println("A() of A.java"); }
      public static void main(String args[])
        test.A a = new test.A(); // prints A() of A.java
        MyInterface.A a1 = new MyInterface.A(); // prints the other one
    }

  • Interface and Class

    Hi pls any one can help me ?. In most of all the places we are declaring the constance in class files as
    class A{
    public static final String str_Constant;
    After that we will refer this like "A.str_Constant"
    Why we cant define it in interface like
    interface A{
    String str_Constant;
    and refer like A.str_Constant
    Thanks in advance

    Not static either:The "static final" modifier is implied, since it doesn't make sense to have non-static, non-final variables in an interface. The way to go is to do this:
    public interface Constants {
       public static final int SOME_CONSTANT = 0;
    }This works if you have package-spanning consants (such as SwingConstants), but if you have class-specific constants you should gather them inside the class:
    public class Stylesheet {
       public static final int BACKGROUND = 0;
       public void set(int arg, Object value) { ... }  
    myStylesheet.set(Stylesheet.BACKGROUND, Color.white);But this doesn't look very good (see enum's in 1.5), so it's probably better do solve it in some other way (depends on the project).
    Regards,
    Nille

  • Interfaces and class methods

    I want to implement an interface (to set common methods), but I want a method to be a class method of the concrete subclasses. Is there any way to do this? I cannot declare methods static in an interface. If I declare the method static in the concrete subclass this generates a compiler error.

    No I tried that! You cannot declare a class abstract and then declare the method abstract and static!
    I can create a method in the abstract class that is static and this can then be overwritten in the subclass, but there is no guarantee that the subclass implementer overwrites this method.
    Perhaps a redesign is in order. I don't think what I am trying to do is so obscure an interface means that you can be sure that the method is implemented, but this method is crying out to be a static method!

  • Interface and Abstract class difference

    An interface can be used in such a way that we don't know the class of object assigned to a reference of that interface type until runtime. Can we use the abstract class in a similar way too?
    The difference between an abstract class and interface can be listed as
    1. Interface can not have implementation of any method
    2. The usage of interface and class is one other difference
    3. What other differences we have?

    Yes an abstract class can be used in a similar way. The main issue with an abstract class is that you extend it and you can only extend one class so that can be a huge limitation that an interface does not give you.
    Here's another one that is often overlooked: use both.
    public abstract class SomeBaseClass implements Runnable {
      public abstract void someAbstractMethod();
      public void someMethodWithADefaultImplementation(){
        System.out.println("Hello!");
    }Any class that extends SomeBaseClass (and is not abstract) will need to implement the run() method of the Runnable interface.

  • How to find classes in the package if package path

    in java i want to find classes,Interface,Exception names which are presant
    in the package..
    for example
    java.sql; if i give this it should return
    class name
    Date
    Time
    DrivarManager
    pls helpme in this field

    download the jdk documentation or view it here
    http://java.sun.com/j2se/1.3/docs/api/index.html
    The exact problem is i hava set the path to my application that path contains several jar's(contains classes,Interfaces) and classes with package structure,
    now my need is if i run the application ,the application
    should find out the classes and Interfaces for given package structure which are present in classpath...
    for this i have to load all the classes to memory(using classes loader) . then find out the classes which are present in memory...
    or
    any other inbuilt method is there in java when i give path structure it find and give classes which are in class path..
    for ex..
    if i set path to jdk
    then if i give the path like java.lang
    it should give me the out put as
    String (or) String.class
    Double
    Cloneable
    (classes & interface in that package)

  • I have Adobe Photoshop Elements 10 and Adobe Premier 10 loaded on a Dell PC. Do I need to uninstall from the Dell before I install on a recently purchased Apple Mac Pro? There are separate disks for Mac and PC in the package.

    I have Adobe Photoshop Elements 10 and Adobe Premier 10 loaded on a Dell PC. Do I need to uninstall from the Dell before I install on a recently purchased Apple Mac Pro? There are separate disks for Mac and PC in the package.

    Generally, it's ok to install on two machines as long as they are both yours and you only use one version at a time.
    BTW, this is the forum for Adobe Contribute.

  • [svn:osmf:] 13401: PARB changes: removing nesting capabilities from MediaContainer, and introducing a separate MediaContainerGroup class ( that is not a MediaContainer) that now holds the functionality.

    Revision: 13401
    Revision: 13401
    Author:   [email protected]
    Date:     2010-01-09 07:37:48 -0800 (Sat, 09 Jan 2010)
    Log Message:
    PARB changes: removing nesting capabilities from MediaContainer, and introducing a separate MediaContainerGroup class (that is not a MediaContainer) that now holds the functionality.
    Modified Paths:
        osmf/trunk/apps/samples/framework/NestedMediaContainersSample/NestedMediaContainersSample .as
        osmf/trunk/framework/MediaFramework/.actionScriptProperties
        osmf/trunk/framework/MediaFramework/.flexLibProperties
        osmf/trunk/framework/MediaFramework/org/osmf/containers/HTMLMediaContainer.as
        osmf/trunk/framework/MediaFramework/org/osmf/containers/IMediaContainer.as
        osmf/trunk/framework/MediaFramework/org/osmf/containers/MediaContainer.as
        osmf/trunk/framework/MediaFramework/org/osmf/display/MediaPlayerSprite.as
        osmf/trunk/framework/MediaFrameworkFlexTest/org/osmf/MediaFrameworkTests.as
        osmf/trunk/framework/MediaFrameworkFlexTest/org/osmf/containers/TestMediaContainer.as
    Added Paths:
        osmf/trunk/framework/MediaFramework/org/osmf/display/MediaContainerGroup.as
        osmf/trunk/framework/MediaFrameworkFlexTest/org/osmf/display/TestMediaContainerGroup.as

    Hi,
    these concepts are used and implemented in jGuard(www.jguard.net) which enable easy JAAS integration into j2ee webapps across application servers.
    cheers,
    Charles(jGuard team).

  • Need Help regarding separate GUI and logic class

    Hi,
    I was given this assignment and I'm stuck big time.
    Basically I have a GUI class for a stopwatch interface.
    public class WatchGui implements Gui{
        JButton b1, b2;
        JLabel minutes, symbol1, seconds, symbol2, hundredths;
        StopWatch stopwatch;
        public WatchGui(){
             stopwatch = new StopWatch();
             b1 = new JButton("RUN");
            minutes = new JLabel("00");
            ActionListener al = new MyActionListener(stopwatch);
            b1.addActionListener(al);
        //  Called to connect a watch to the GUI
        public void connect(Watch w) {
        public void setDisplay(String mm) {
             minutes.setText(mm);
        public void addComponentsToPane(Container pane) {
            pane.setLayout(null);
            pane.add(b1);
            pane.add(b2);
            pane.add(minutes);
            Insets insets = pane.getInsets();
        public void createAndShowGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame("XXX");
            frame.setResizable(false);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Set up the content pane.
            WatchGui Pane = new WatchGui();
            Pane.addComponentsToPane(frame.getContentPane());
            //Size and display the window.
            Insets insets = frame.getInsets();
            frame.setVisible(true);
    }I have a watch class which function as the engine for the stop watch
    import java.awt.event.*;
    import javax.swing.*;
    class StopWatch implements Watch {
         WatchGui watchgui;
         public StopWatch() {
              running = false;
              count = 0;
        public void connect(Gui g) {
             watchgui = (WatchGui) g;
             watchgui.createAndShowGUI();
        public void runStop() {
             mm = String.valueOf("100");
         watchgui.setDisplay(mm);
    class MyActionListener implements ActionListener {
         StopWatch stopwatch;
         public MyActionListener(StopWatch stopwatch) {
              this.stopwatch = stopwatch;
         public void actionPerformed (ActionEvent e) {
              stopwatch.runStop();
    }To get the StopWatch to work, I have this driver class
    import java.lang.reflect.Constructor;
    public class Driver
        public static void main(String[] args)
          throws Exception
         if( args.length!=1 ){
             System.err.println("Usage: Driver WATCHNAME");
             System.exit(1);
             return;
         String watchName= args[0];
         Class cl= Class.forName(watchName,true,Thread.currentThread().getContextClassLoader());
         Constructor c[]= cl.getConstructors();
         if( c.length==0 ){
             System.err.println("There is NO constructor in your watch class");
             System.exit(1);
             return;
         if( c.length>1 ){
             System.err.println( "There is more than one constructor in your class");
             System.exit(1);
         //Construct the components
         Watch w=(Watch)c[0].newInstance(new Object[0]);
         Gui g= new WatchGui();
         //Connect them to each other
         g.connect(w);
         w.connect(g);
         //Reset the components()
         g.reset();
         w.reset();
         //And away we go...
         try{
             for(;;){
              Thread.sleep(10); //milliseconds
              w.tick();
         }catch(InterruptedException ie){
             System.exit(1);
    }My currently problem is that when i click on the button in the GUI, it will go to MyActionListener class and call the runStop method.
    public void runStop() {
         mm = String.valueOf("100");
         watchgui.setDisplay(mm);
    The problem is that when watchgui.setDisplay(mm) is called, exception is thrown instead. I'm suspecting it has something to do with the initialization of watchgui. Can anyone advice?

    import java.awt.*;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    public class WatchGui implements Gui{
         JButton b1, b2;
        JLabel minutes, symbol1, seconds, symbol2, hundredths;
        StopWatch stopwatch;
        public WatchGui(){
             stopwatch = new StopWatch();
             b1 = new JButton("RUN/STOP");
            b2 = new JButton("  RESET  ");
            minutes = new JLabel("00");
            symbol1 = new JLabel(":");
            seconds = new JLabel("00");
            symbol2 = new JLabel(".");
            hundredths = new JLabel("00");
            minutes.setFont(new Font("Arial", Font.BOLD, 40));
            symbol1.setFont(new Font("Arial", Font.BOLD, 40));
            seconds.setFont(new Font("Arial", Font.BOLD, 40));
            symbol2.setFont(new Font("Arial", Font.BOLD, 20));
            hundredths.setFont(new Font("Arial", Font.BOLD, 20));
            ActionListener al = new MyActionListener(stopwatch);
            b1.addActionListener(al);
        //  Called to connect a watch to the GUI
        public void connect(Watch w) {
        //Called to reset the GUI
        public void reset() {
             minutes.setText("00");
             seconds.setText("00");
             hundredths.setText("00");
        //Called whenever the value displayed by the watch changes
        public void setDisplay(String mm, String ss, String hh) {
             minutes.setText(mm);
             seconds.setText(ss);
             hundredths.setText(hh);
        public void addComponentsToPane(Container pane) {
            pane.setLayout(null);
            pane.add(b1);
            pane.add(b2);
            pane.add(minutes);
            pane.add(symbol1);
            pane.add(seconds);
            pane.add(symbol2);
            pane.add(hundredths);
            Insets insets = pane.getInsets();
            Dimension size = b1.getPreferredSize();
            b1.setBounds(50 + insets.left, 20 + insets.top,
                         size.width, size.height);
            size = b2.getPreferredSize();
            b2.setBounds(150 + insets.left, 20 + insets.top,
                         size.width, size.height);
            size = minutes.getPreferredSize();
            minutes.setBounds(75 + insets.left, 70 + insets.top,
                    size.width, size.height);
            size = symbol1.getPreferredSize();
            symbol1.setBounds(120 + insets.left, 70 + insets.top,
                    size.width, size.height);
            size = seconds.getPreferredSize();
            seconds.setBounds(135 + insets.left, 70 + insets.top,
                    size.width, size.height);
            size = symbol2.getPreferredSize();
            symbol2.setBounds(182 + insets.left, 87 + insets.top,
                    size.width, size.height);
            size = hundredths.getPreferredSize();
            hundredths.setBounds(190 + insets.left, 87 + insets.top,
                    size.width, size.height);
        public void createAndShowGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame("StopWatch");
            frame.setResizable(false);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Set up the content pane.
            WatchGui Pane = new WatchGui();
            Pane.addComponentsToPane(frame.getContentPane());
            //Size and display the window.
            Insets insets = frame.getInsets();
            frame.setSize(300 + insets.left + insets.right,
                          150 + insets.top + insets.bottom);
            frame.setVisible(true);
    import java.awt.event.*;
    import javax.swing.*;
    class StopWatch implements Watch {
         WatchGui watchgui;
         long startTime;
         boolean running;
         javax.swing.Timer timer;
         String mm, ss, hh;
         int count, tmp;
         public StopWatch() {
              running = false;
              count = 0;
              timer = new javax.swing.Timer(1000, new ActionListener()
                   public void actionPerformed(ActionEvent e)
                         count++;
                         mm = String.valueOf(count);
                         ss = String.valueOf(count);
                         hh = String.valueOf(count);
                         watchgui.setDisplay(mm, ss, hh);
        //Called to connect the GUI to watch
        public void connect(Gui g) {
             watchgui = (WatchGui) g;
             watchgui.createAndShowGUI();
              //watchgui.setDisplay(mm, ss, hh);
        //Called to initialise the watch
        public void reset() {
             watchgui.reset();
        //Called to deliver a TICK to the watch
        public void tick() {
        //Called whenever the run/stop button is pressed
        public void runStop() {
             int a = 33;
             mm = "" + a;
              ss = "" + a;
              hh = "" + a;
              watchgui.setDisplay(mm, ss, hh);
             if (running == false) {
                  count = 0;
                  timer.start();
                  running = true;
             }else {
                  timer.stop();
                  running = false;
        //Called whenever the lap/reset button is pressed
        public void lapReset() {}
    class MyActionListener implements ActionListener {
         StopWatch stopwatch;
         public MyActionListener(StopWatch stopwatch) {
              this.stopwatch = stopwatch;
         public void actionPerformed (ActionEvent e) {
              stopwatch.runStop();
    import java.lang.reflect.Constructor;
    public class Driver
        public static void main(String[] args)
          throws Exception
         if( args.length!=1 ){
             System.err.println("Usage: Driver WATCHNAME");
             System.exit(1);
             return;
         String watchName= args[0];
         Class cl= Class.forName(watchName,true,Thread.currentThread().getContextClassLoader());
         Constructor c[]= cl.getConstructors();
         if( c.length==0 ){
             System.err.println("There is NO constructor in your watch class");
             System.exit(1);
             return;
         if( c.length>1 ){
             System.err.println( "There is more than one constructor in your class");
             System.exit(1);
         //Construct the components
         Watch w=(Watch)c[0].newInstance(new Object[0]);
         Gui g= new WatchGui();
         //Connect them to each other
         g.connect(w);
         w.connect(g);
         //Reset the components()
         g.reset();
         w.reset();
         //And away we go...
         try{
             for(;;){
              Thread.sleep(10); //milliseconds
              w.tick();
         }catch(InterruptedException ie){
             System.exit(1);
    public interface Gui
        //Called to connect a watch to the GUI
        public void connect(Watch w);
        //Called to reset the GUI
        public void reset();
        //Called whenever the value displayed by the watch changes
        public void setDisplay(String mm, String ss, String hh);
    interface Watch
        //Called to connect the GUI to watch
        public void connect(Gui g);
        //Called to initialise the watch
        public void reset();
        //Called to deliver a TICK to the watch
        public void tick();
        //Called whenever the run/stop button is pressed
        public void runStop();
        //Called whenever the lap/reset button is pressed
        public void lapReset();
    }

  • Separate sales and return transaction for POSDM interface to ECC

    Hi experts
    We have a requirement to separate sales and return transaction movement types (251 and 252) for even the same articles.
    Currently, we are using two-step process but the aggregation will combine both sales and return transactions together.
    (For example, if i sell 2 article A and return 1 article A, the system will aggregate to selling only 1 article A with movement type 251.
    But we want to have movement type 251 posting for 2 article A, and movement type 252 posting for 1 article A.)
    Would you have any recommendation in terms of configuration?
    Thanks a lot for that.
    BR
    Dom

    Hi Rashi Gaur,
    Yes, As already explained by Vikrant, You Can create a separate task group for sales and assign that to sales item type (2001) and Create separate task group for returns and assign that to return item type (2801). This can be performed in two-step agregation process. The sales records will be in and returns will be .
    Thanks and Regards,
    Ramesh D

  • Creating Private Inner Classes in Separate Files

    I sometimes find myself wanting to use private inner classes to do things, but then moving the classes to separate files and giving them package access just because I don't like having single large files.
    Is there a way to create private inner classes on a class but just save them in another file?
    Thanks,
    John

    For me, short file sizes usually make design structure
    more clear. This can make maintenance easier. It can
    also make browsing the code easier, even if you have a
    good editor or IDE. It is also less intimadating
    psychologically (for me, anyway) to work with a number
    of small files, each one with a distinct purpose, than
    it is to open up a monster, even if the monster does
    represent a coherent design unit in some sense. I
    think this psychological impact may be more important
    than most people give it credit for.The psychological impact is lessened if you use an IDE like VisualAge (where only one method at a time is generally displayed) or use the "Show Source Of Selected Element Only" option in Eclipse.
    It's one thing to say a method should be short and a class should have as few methods as possible. Those forces reduce complexity and ease maintenance. It's another to say a source file should be short. A source file is just a storage artifact; source code could be stored in a database without changing how the programmer interacts with it. The fact that the standard java compiler requires the implementation of nested classes to be stored inside the source file of their containing class is a minor inconvenience. Don't let it discourage you from using inner classes when they make sense. The design should not be driven by source file size considerations.
    >
    But you have added code only with the sole intent of
    making a source file smaller. If Java had amechanism
    for storing nested classes in other files youwouldn't
    do this. My point below was that you shouldn't let
    source file size override the decision to use anested
    class.Why shouldn't I let it? There are plenty of
    non-trivial benefits (the ones I gave above, for
    starters) to working with smaller files.Because all of those benefits can be gained from using a decent IDE. Eclipse is free. It can show only the current method and it can collapse nested classes.
    You say "If
    Java had a mechanism...." Well, I could answer: It
    does have such a mechanism, and that mechanism is
    packages.Packages are not a mechanism for creating private inner classes in separate files. Eclipse has a mechanism for making the fact that they reside in the same source file a non-issue.
    >>
    I am not being cavalier. I have no argument, onlyan
    opinion.Again, you are perfectly entitled to your opinion.
    But if it is truly an opinion, and nothing more, why
    bother telling me about it. You might as well post
    your favorite color. It is the reasons for your
    opinion that interest me, and you still have not
    really given any.I have had lengthy arguments about the issue of method and class size. Like I said before, I prefer very small classes and methods. I also think the number of nested classes should be as small as possible. But I have no problem with large files. Files are just one way to organize source code. The size of the things in the files matters, not the files themselves.

  • Include only interfaces and package-level comments -

    hi jd forum -
    forgive if this is covered elsewhere. i've found references to -include, -exclude, and 'docset', but i can't find these in the documentation at http://java.sun.com/j2se/1.3/docs/tooldocs/win32/javadoc.html (maybe it's for a different version).
    i want to only include documentation for interfaces and exclude the classes -- and / or include documentation on a filename basis -- like 'document only IBI*.java.' also, i want to include ONLY package-level documentation (package.html) for some packages but not the javadocs for their associated classes...
    are these things possible? i've looked into -package, -protected, and -public, but these don't seem to cover it.
    thanks in advance;
    -m

    The -include and -exclude options and @docset tag were considered for 1.4 but then decided against by the Javadoc team as we look for other solutions.
    You can document all public interfaces by passing their source filenames in to javadoc. Say, if the source files are in ./src, then:
    javadoc -d docs ./src/com/package/Interface1.java /src/com/package/Interface2.java
    You can use the wildcard asterisk here as well:
    javadoc -d docs ./src/IBI*.java
    There's no way to document the package-level documentation without the associated classes. Javadoc 1.4 has an -exclude option, but it works only to exclude packages from the -subpackages option, which is a shortcut for passing in package names.
    A workaround could be to put the package.html file in a doc-files directory and then add a link to it in overview.html. It won't be processed, so won't have the navigation bars on the top and bottom, and cannot be automatically linked to from other places (index).
    -Doug Kramer
    Javadoc team

  • Implemenet/Extend interface/class in default package

    Filename: DeaultInterface.java
    public interface DefaultInterface {
        // Abstract Methods...
    Filename: ConcreteClass.java
    package com.company;
    import DefaultInterface;
    public class ConcreteClass implements DefaultInterface {
        // Implementation of Abstract Methods...
    }When I compile above java code it gives error "cannot find symbol. symbol: class DefaultInterface".
    Can anyone explain why can't we implement the interface/extend the class in default package(no package)?
    Edited by: 974531 on Dec 2, 2012 11:07 PM

    >
    When I compile above java code it gives error "cannot find symbol. symbol: class DefaultInterface".
    Can anyone explain why can't we implement the interface/extend the class in default package(no package)?
    >
    You CAN implement the interface defined in the default package.
    What you CANNOT do is import it. And that is because the Java Language Specification specifies that named types can only be referenced by their simple name if they are imported and must otherwise be referenced by their fully qualified name.
    See the 7.5 Import Declarations in the Java Language Specification - http://docs.oracle.com/javase/specs/jls/se7/html/jls-7.html
    >
    An import declaration allows a named type or a static member to be referred to by a simple name (§6.2) that consists of a single identifier.
    Without the use of an appropriate import declaration, the only way to refer to a type declared in another package, or a static member of another type, is to use a fully qualified name (§6.7).
    A type in an unnamed package (§7.4.2) has no canonical name, so the requirement for a canonical name in every kind of import declaration implies that (a) types in an unnamed package cannot be imported, and (b) static members of types in an unnamed package cannot be imported. As such, §7.5.1, §7.5.2, §7.5.3, and §7.5.4 all require a compile-time error on any attempt to import a type (or static member thereof) in an unnamed package.
    >
    So you can't reference that type by importing it because you can't import a type that doesn't have a canonical nmae. And you can't just use the simple name because, as the first statement above says you have to import it to use the simple name.
    When you use the simple name of that type without an import the simple name would refer to a class IN your 'com.company' named package.

  • Classes in separate units

    What is the logic behind the separation of classes in separate units?
    I am asking because it has happened to have an applet with several classes in one unit and the virtual machine could not find the classes. I separated the classes into different units and it worked fine.
    But in some cases classes do not necessarily need to be in different units (for example event implementations).
    So I am confused... what is the logic behind this?

    What is the logic behind the separation of classes in separate units?A unit test, tests the smallest unit. You can create unit tests for just one method but it common to test all the methods in a class.
    You use the JUnit frame work to test multiple classes, but this is called a functional test. i.e. multiple units.
    However, the minimum is unit tests for seperate classes. Only when these work does it make sense to perform functional tests of multiple classes.
    I am asking because it has happened to have an applet with several classes in one unit I assume you are saying there is no way to break up these classes anbd test just one of these classes. This can be done using mock objects. mock object replace the objects which are required just to test a given class.
    The mock objects for testing class can usually be reused as mock objects to test all classes.
    and the virtual machine could not find the classes. This probibly a configuration issue.
    I separated the classes into different units and it worked fine.Your environment is not setup conrrectly. Try using a free IDE such as netbeans or eclipse.
    But in some cases classes do not necessarily need to be in different units (for example event implementations).For the purposes of unit tests, a unit is a class because you cannot break up the class any smaller. What kind of unit are you refering to?

Maybe you are looking for

  • Boot permission error starting managed server using startManagedWebLogic

    Hello           I have a clustered WLS environment and am having problems starting the managed server from the command line using startManagedWebLogic.cmd script. The managed server starts without any problems from the admin console. Using the startM

  • Colour banding in new MBP 17 Quad core I7

    Hi there has anyone had this problem yet. I have a new MBP 17 Quad core I7 with an anti glare screen. When I look at images where there is any colour or tonal graduation I get a coloured banding effect where the graduation starts....almost like a hal

  • Free TV show that I already have is downloading

    I'm a fan of damages and have purchased/downloaded the whole series. However this evening Episode is downloading again as a seperate item. If I delete it then restart itunes it downloads again. I just don't want to sync 2 identical episodes onto my o

  • Re in stall flash player Min mC  OXac 10.6

    I  can no longer play viedo from many web sites allways same thing Missing Plug in derect me to change addm password try that no luck. flash player the same thing  player any help i sure could use  Old guy  \ MAC OSX 10,6,8,   min mac   re in stalled

  • INSERTS slow

    I have a batch process that comepletes in 3 hrs max if I process all the rows in one shot. something like this insert into dest_table select * from source_table; But when I process the same at an entity level by passing in the entity pk the process i