Re: Code directories

2007-09-26 Thread Martijn Dashorst
On 9/26/07, Neil B. Cohen [EMAIL PROTECTED] wrote:
 to be all in one package. But does that mean pairs of java/html files
 have to be together

Yes, unless you don't want it to, but then you have to resort to other
tricks (enough examples regarding that on this list).

The easiest way to start learning wicket, imo, is to keep everything
related to a page, border or panel together in the same package
directory: .java, .html and .properties

 or does the entire program have to be in one package?

No (unless you want to)

Martijn

-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Code directories

2007-09-26 Thread Neil B. Cohen

Martijn Dashorst wrote:

On 9/26/07, Neil B. Cohen [EMAIL PROTECTED] wrote:
  

to be all in one package. But does that mean pairs of java/html files
have to be together



Yes, unless you don't want it to, but then you have to resort to other
tricks (enough examples regarding that on this list).

The easiest way to start learning wicket, imo, is to keep everything
related to a page, border or panel together in the same package
directory: .java, .html and .properties
  


That makes sense - but if I have data model objects like 'User.java' 
which are used by multiple pages, then it would seem that all the pages 
(and all the related data model objects) have to end up in the same 
package with 'User' - yes? Or am I missing something obvious here... It 
seems like the entire program will be contained in one package. That 
isn't the end of the world for me - I just want to be sure I understand 
it...


Thanks -

nbc
  

or does the entire program have to be in one package?



No (unless you want to)

Martijn

  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Code directories

2007-09-26 Thread Gwyn Evans
On Wednesday, September 26, 2007, 12:47:54 PM, Neil [EMAIL PROTECTED] wrote:

 I'm brand new to Wicket - trying to see if I can re-design some web 
 applications to use this framework. A couple of questions have come up
 right at the beginning - I'll start with the simple one

 1) Code layout - In my existing system, I have code separated into a 
 number of different packages - for example,
   com.foo.dm  (data model)
   com.foo.da(data access)
   com.foo.servlet
   com.foo.util
 etc. etc.
 Somewhere in the Wicket website, I saw something that said the code had
 to be all in one package. But does that mean pairs of java/html files 
 have to be together, or does the entire program have to be in one package?

It was probably meaning that the Java/HTML pairs should be kept
together[*].  You certainly don't need to keep your program in one
package!

Places to check for info are the main Wicket site, the wicket-examples
linked from there (especially the sources), plus the Wiki.  See the
Documentation Index and the Reference Library pages to start!

/Gwyn

[*] There are ways around this, but we strongly recommend that you
don't consider it until you've got specific reasons not to, beyond the
normal it seems odd that everyone has when starting...


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Code directories

2007-09-26 Thread Martijn Dashorst
On 9/26/07, Neil B. Cohen [EMAIL PROTECTED] wrote:
 That makes sense - but if I have data model objects like 'User.java'
 which are used by multiple pages, then it would seem that all the pages
 (and all the related data model objects) have to end up in the same
 package with 'User' - yes? Or am I missing something obvious here...

If you want to do that sure, but that is not typical. The only thing
that should be together are the wicket related parts, but they can be
stored in different packages:

com.example.gui.admin
com.example.gui.users
com.example.gui.products
com.example.gui.products.cheese
com.example.gui.products.wine
com.example.gui.products.footballs

Your domain classes can reside wherever you want:

com.example.domain.cheese.french
com.example.domain.cheese.dutch

They can even come from other JAR files, as long as they are on the classpath.

The only requirement for wicket out-of-the-box is to find the markup
files for pages and panels next to the class files of your java files.
The easiest way to achieve this is to put the html and java files *for
your pages* in the same package. That's all.

Martijn

-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-beta3 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Code directories

2007-09-26 Thread Neil B. Cohen

Martijn Dashorst wrote:

On 9/26/07, Neil B. Cohen [EMAIL PROTECTED] wrote:
  

That makes sense - but if I have data model objects like 'User.java'
which are used by multiple pages, then it would seem that all the pages
(and all the related data model objects) have to end up in the same
package with 'User' - yes? Or am I missing something obvious here...



  

Got it - thanks to all for the quick replies!

nbc


If you want to do that sure, but that is not typical. The only thing
that should be together are the wicket related parts, but they can be
stored in different packages:

com.example.gui.admin
com.example.gui.users
com.example.gui.products
com.example.gui.products.cheese
com.example.gui.products.wine
com.example.gui.products.footballs

Your domain classes can reside wherever you want:

com.example.domain.cheese.french
com.example.domain.cheese.dutch

They can even come from other JAR files, as long as they are on the classpath.

The only requirement for wicket out-of-the-box is to find the markup
files for pages and panels next to the class files of your java files.
The easiest way to achieve this is to put the html and java files *for
your pages* in the same package. That's all.

Martijn

  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]