Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » workspace\project structure
workspace\project structure [message #214775] Sat, 09 June 2007 21:33 Go to next message
Eclipse UserFriend
Originally posted by: jjarrelZZZZZ.yahoo.com

I am new to the java world and I have to establish a project structure for a
bunch of other newcomers . I'd like to stay in rome and do as the romans do
and this is more or less what I have come up with. This app provide web
services, business tiers, and DAOs. The logical projects are at the
<module> level, like PO or Invoicing.

If there is a better project structure than say so.

Now my questions;
1) at what level does does the eclipse workspace point to?
2) as i start a project what are my steps?
perhaps this has a lot to do with 1). I have the workspace pointing at the
root and wants to create the project off the root when the project is really
at the <module> level.
3) For this development structure, I don't suppose there is anyway to get
rid of the com\company\product dirs. this structure is for one product.
Eclipse seems fairly adamant about putting files in folders absolutely
related to the package name.

Suggestions please...

Thanks,
jeff

\lib
\src
java
com
company
product
<module>
po
invoicing
test
com
company
product
<module>
po
invoice
target
classes
testclasses

\<other>
Re: workspace\project structure [message #215476 is a reply to message #214775] Wed, 13 June 2007 13:24 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse5.rizzoweb.com

jeff jarrell wrote:
> Now my questions;
> 1) at what level does does the eclipse workspace point to?

A workspace is a container (logical or logical and physical) for
projects. Projects contain resources, which can be any kind of file but
in most Java projects include at least source code, JARS, and compiled
output. It is often useful/sensible to organize a single application
into several Projects, depending on how your app and if there are
"common" modules that multiple apps depend on.

> 2) as i start a project what are my steps?
> perhaps this has a lot to do with 1). I have the workspace pointing at the
> root and wants to create the project off the root when the project is really
> at the <module> level.

I'm not sure what you're asking there, sorry.


> 3) For this development structure, I don't suppose there is anyway to get
> rid of the com\company\product dirs. this structure is for one product.
> Eclipse seems fairly adamant about putting files in folders absolutely
> related to the package name.

Yes, your source directory structure must match the package structure.
Not only does Eclipse enforce it, but trust us when we tell you it is
better that way - experience in Java will probably show you why one day. ;-)
One thing I usually do is to leave off the com from the package names.
It doesn't really add any value.

<more below>

> \lib
> \src
> java
> com
> company
> product
> <module>
> po
> invoicing
> test
> com
> company
> product
> <module>
> po
> invoice
> target
> classes
> testclasses

This is pretty much typical and sensible; the only suggestions I'd make
would be:
a) what you call "target" is usually called "build" in Java projects, or
sometimes "bin" (which I personally don't like because not all the
contents of a build output is binary).
b) depending on how big your code base is and how it needs to be
packaged, you may want to split things into multiple projects, for
example "Common", "PO", "Invoicing", etc. If it is not clear whether
that adds any organization value, I would start with one project and
then split it if/when it gets too big to easily manage.

Hope this helps,
Eric
Previous Topic:An exception come out when using jfreechart in eclipse 3.1
Next Topic:Working from another computer
Goto Forum:
  


Current Time: Fri Apr 26 09:10:23 GMT 2024

Powered by FUDForum. Page generated in 0.22687 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top