You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jin Lee <ji...@gmail.com> on 2004/11/17 08:30:11 UTC

Introduction and question about tapestry + persistence

Hi all,

I just wanted to introduce myself to the tapestry mailing list. I have
been developing web apps using Java for the last couple years and in
the last 6 months or so I have really gotten into MVC frameworks such
as Struts and JSF. I would by no means consider myself an expert, but
I have already had a couple issues with Struts and although JSF has
potential, it is still not a rich, mature framework.

I've read everything I can get my hands on about Tapestry, including
the manning book. I really love its concepts and its goals. I am
hoping to have my first tapestry application in production within the
next 3 months.

Hope I haven't bored you yet, as I actually did have a question ;) I
was wondering if anyone could give me opinions about Tapestry and
persistence layers, such as Hibernate. I've never dealt with
persistence layers (in struts I just executed JDBC calls inside the
Action classes), and I really want to start off this time doing things
the right way. Specifically:

1. In your opinon, how "big" does a web app have to be to consider
using a persistence layer? Many times I question if I should really
use one since the web application doesn't do a whole lot. In these
instances, is it ok to have JDBC calls in your business classes?

2. What are the advantages to using a persistence layer? There are
probably a million but Im a only a lowbie programmer, not yet up to
speed with industry best practices. In my head, I just see it as
another layer of work :)

3. Kind of related to the first question, but is it ok to have JDBC
calls in tapestry's domain objects?

4. What persistence layers work well with tapestry? 

Well, thats all I have for now. Forgive me if I am not making too much
sense, this is still a bit new to me. Thank you very much for reading
and I look forward to your responses.

Sincerely,

Jin Lee

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Introduction and question about tapestry + persistence

Posted by Luc Peerdeman <lj...@xs4all.nl>.
Hi Jin,

Jin Lee wrote:

> 1. In your opinon, how "big" does a web app have to be to consider
> using a persistence layer? Many times I question if I should really
> use one since the web application doesn't do a whole lot. In these
> instances, is it ok to have JDBC calls in your business classes?

IMHO, there is hardly ever a reason to do any low level JDBC programming 
  even for small applications. For the first project where you use a 
object-relational mapping framework like Hibernate there will be a short 
learning curve, but if there are more than a handful of classes it is 
already worthwhile. On subsequent projects you will be much faster using 
a framework.

> 2. What are the advantages to using a persistence layer? There are
> probably a million but Im a only a lowbie programmer, not yet up to
> speed with industry best practices. In my head, I just see it as
> another layer of work :)

A layer of extra work for the computer, but for the programmer it is 
less work. Of course assuming you generate the input files for the 
mapping layer using tools (from the database meta data, bottom up, or 
from the Java classes, top down, or even using both, 'meet in the middle'.

Furthermore, when layers are decoupled (separate persistence layer) 
there are many advantages to that: for example being able to let the 
framework handle differences in SQL dialects for different databases you 
might want to support.

Many more advantages: maintenance is less expensive, performance is 
often very good and hard to beat with hand written SQL, extra features 
like caching and even clustered caching may be supported by the 
persistence layer, etc etc.

Bottom line for me is: it is much easier and offers a lot more. I 
remember my first project where I used a tool like this (TopLink, now 
owned by Oracle) and the customer was hoping we would be able to 'reuse' 
  a very complex piece of SQL (hundreds of lines, with hierarchal 
relations within one table etc) that had cost them quite a lot of time 
to program. Doing this in TopLink turned out to be quite easy, after I 
figured out the idea behind the SQL, and took only a few lines of text 
in the mapping description.

> 4. What persistence layers work well with tapestry? 

I think Tapestry can work with any good persistence layer, we happen to 
use a JDO based product.

Good luck !

Luc.


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Introduction and question about tapestry + persistence

Posted by Todd O'Bryan <to...@mac.com>.
I had much better luck getting started with Cayenne. Hibernate's 
wonderful documentation was not completely up-to-date and left me 
swimming up current with small problems that I couldn't fix for several 
days. Cayenne just worked, and within an afternoon, I was writing code 
that actually did something.

The user base is smaller, but the mailing list was also much more 
helpful than Hibernate's forums.

YMMV, however,
Todd

On Nov 17, 2004, at 3:14 PM, Jin Lee wrote:

> Thank you everyone for the replies. I've decided to go ahead and look
> into Hibernate since it seems well documented and has a very large
> user base. Many times I have walked into a project thinking that it
> was relatively small, only to have it grow almost exponentially by the
> time it went into production.
>
> Once again, thank you everyone for your feedback. I've purchased the
> Manning book on Hibernate, and look forward to late nights of
> studying! (Havent felt this way since college hehe)
>
> Jin
>
>
> On Tue, 16 Nov 2004 23:30:11 -0800, Jin Lee <ji...@gmail.com> wrote:
>> Hi all,
>>
>> I just wanted to introduce myself to the tapestry mailing list. I have
>> been developing web apps using Java for the last couple years and in
>> the last 6 months or so I have really gotten into MVC frameworks such
>> as Struts and JSF. I would by no means consider myself an expert, but
>> I have already had a couple issues with Struts and although JSF has
>> potential, it is still not a rich, mature framework.
>>
>> I've read everything I can get my hands on about Tapestry, including
>> the manning book. I really love its concepts and its goals. I am
>> hoping to have my first tapestry application in production within the
>> next 3 months.
>>
>> Hope I haven't bored you yet, as I actually did have a question ;) I
>> was wondering if anyone could give me opinions about Tapestry and
>> persistence layers, such as Hibernate. I've never dealt with
>> persistence layers (in struts I just executed JDBC calls inside the
>> Action classes), and I really want to start off this time doing things
>> the right way. Specifically:
>>
>> 1. In your opinon, how "big" does a web app have to be to consider
>> using a persistence layer? Many times I question if I should really
>> use one since the web application doesn't do a whole lot. In these
>> instances, is it ok to have JDBC calls in your business classes?
>>
>> 2. What are the advantages to using a persistence layer? There are
>> probably a million but Im a only a lowbie programmer, not yet up to
>> speed with industry best practices. In my head, I just see it as
>> another layer of work :)
>>
>> 3. Kind of related to the first question, but is it ok to have JDBC
>> calls in tapestry's domain objects?
>>
>> 4. What persistence layers work well with tapestry?
>>
>> Well, thats all I have for now. Forgive me if I am not making too much
>> sense, this is still a bit new to me. Thank you very much for reading
>> and I look forward to your responses.
>>
>> Sincerely,
>>
>> Jin Lee
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Introduction and question about tapestry + persistence

Posted by Nick Stuart <ba...@gmail.com>.
Hi Jin and all. Another framework for the data layer to look at is
Castor. I've used it for quite a while and it handles all my needs
nicely. I haven't used Hibernate, so I cant do a straight comparison,
but Castor will defiantly work for all but the most complicated
database scemas, and as a bonus does XML stuff as well. (
http://www.castor.org )

1) I have written several small apps, and use castor on almost all of
them. I got tired of having to go back in to ALL the jdbc statements
if I addde/removed a field. In Castor (and others ) its a single
change in an xml file.

2) A lot :)

3) Perfectly legal, but may not be the best separation of logic. Goes
away from the MVC approach.

4) As stated before, which ever one you like best.

-Nick


On Wed, 17 Nov 2004 15:32:58 -0500, Rick Austin <ri...@rickaustin.net> wrote:
> Just wanted to mention iBATIS as well. We're doing new development
> against an existing Windows C++ "legacy" app with existing tables a lot
> of tuned SQL statements. I looked at Hibernate and iBATIS but iBATIS was
> a better fit. If we were designing from scratch then that might have
> swayed us to go with Hibernate.
> 
> The iBATIS site is: http://www.ibatis.com/
> 
> 
> 
> -----Original Message-----
> From: Jin Lee [mailto:jinslee@gmail.com]
> Sent: Wednesday, November 17, 2004 3:14 PM
> To: Tapestry users
> Subject: Re: Introduction and question about tapestry + persistence
> 
> Thank you everyone for the replies. I've decided to go ahead and look
> into Hibernate since it seems well documented and has a very large user
> base. Many times I have walked into a project thinking that it was
> relatively small, only to have it grow almost exponentially by the time
> it went into production.
> 
> Once again, thank you everyone for your feedback. I've purchased the
> Manning book on Hibernate, and look forward to late nights of studying!
> (Havent felt this way since college hehe)
> 
> Jin
> 
> On Tue, 16 Nov 2004 23:30:11 -0800, Jin Lee <ji...@gmail.com> wrote:
> > Hi all,
> >
> > I just wanted to introduce myself to the tapestry mailing list. I have
> 
> > been developing web apps using Java for the last couple years and in
> > the last 6 months or so I have really gotten into MVC frameworks such
> > as Struts and JSF. I would by no means consider myself an expert, but
> > I have already had a couple issues with Struts and although JSF has
> > potential, it is still not a rich, mature framework.
> >
> > I've read everything I can get my hands on about Tapestry, including
> > the manning book. I really love its concepts and its goals. I am
> > hoping to have my first tapestry application in production within the
> > next 3 months.
> >
> > Hope I haven't bored you yet, as I actually did have a question ;) I
> > was wondering if anyone could give me opinions about Tapestry and
> > persistence layers, such as Hibernate. I've never dealt with
> > persistence layers (in struts I just executed JDBC calls inside the
> > Action classes), and I really want to start off this time doing things
> 
> > the right way. Specifically:
> >
> > 1. In your opinon, how "big" does a web app have to be to consider
> > using a persistence layer? Many times I question if I should really
> > use one since the web application doesn't do a whole lot. In these
> > instances, is it ok to have JDBC calls in your business classes?
> >
> > 2. What are the advantages to using a persistence layer? There are
> > probably a million but Im a only a lowbie programmer, not yet up to
> > speed with industry best practices. In my head, I just see it as
> > another layer of work :)
> >
> > 3. Kind of related to the first question, but is it ok to have JDBC
> > calls in tapestry's domain objects?
> >
> > 4. What persistence layers work well with tapestry?
> >
> > Well, thats all I have for now. Forgive me if I am not making too much
> 
> > sense, this is still a bit new to me. Thank you very much for reading
> > and I look forward to your responses.
> >
> > Sincerely,
> >
> > Jin Lee
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Confused with nested components and parameters

Posted by sa...@women-at-work.org.
Hi there!

I am so confused about something really simple :-(

Within a component template I want to display a label:

// loginblock.jwc

<component-specification class="org.apache.tapestry.BaseComponent"
allow-body="yes" allow-informal-parameters="yes">
   <component id="loginBox" type="DottedBox">	
    <static-binding name="label" value="login.gif"/>
   </component>
 </component-specification>



And the DottedBox.html

// DottedBox.html
...
<img jwcid="@Any" src="ognl:label" border="0"/>
...


// DottedBox.jwc
<component-specification class="org.apache.tapestry.BaseComponent"
allow-body="yes" allow-informal-parameters="yes">
    <component id="wrapped" type="RenderBody"/>	
    <property-specification name="label" type="java.lang.String"/>
   </component>
</component-specification>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Confused with nested components and parameters 2

Posted by sa...@women-at-work.org.
Hi there!

I am so confused about something really simple :-(

Within a component template I want to display a label:

// loginblock.jwc

<component-specification class="org.apache.tapestry.BaseComponent"
allow-body="yes" allow-informal-parameters="yes">
   <component id="loginBox" type="DottedBox">	
    <static-binding name="label" value="login.gif"/>
   </component>
 </component-specification>



And the DottedBox.html

// DottedBox.html
...
<img jwcid="@Any" src="ognl:label" border="0"/>
...


// DottedBox.jwc
<component-specification class="org.apache.tapestry.BaseComponent"
allow-body="yes" allow-informal-parameters="yes">
    <component id="wrapped" type="RenderBody"/>	
    <property-specification name="label" type="java.lang.String"/>
   </component>
</component-specification>


But all I get is <img border="0"/> instead of <img src="login.gif"
border="0"/> within the html :-(



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Introduction and question about tapestry + persistence

Posted by Rick Austin <ri...@rickaustin.net>.
Just wanted to mention iBATIS as well. We're doing new development
against an existing Windows C++ "legacy" app with existing tables a lot
of tuned SQL statements. I looked at Hibernate and iBATIS but iBATIS was
a better fit. If we were designing from scratch then that might have
swayed us to go with Hibernate.

The iBATIS site is: http://www.ibatis.com/

-----Original Message-----
From: Jin Lee [mailto:jinslee@gmail.com] 
Sent: Wednesday, November 17, 2004 3:14 PM
To: Tapestry users
Subject: Re: Introduction and question about tapestry + persistence


Thank you everyone for the replies. I've decided to go ahead and look
into Hibernate since it seems well documented and has a very large user
base. Many times I have walked into a project thinking that it was
relatively small, only to have it grow almost exponentially by the time
it went into production.

Once again, thank you everyone for your feedback. I've purchased the
Manning book on Hibernate, and look forward to late nights of studying!
(Havent felt this way since college hehe)

Jin


On Tue, 16 Nov 2004 23:30:11 -0800, Jin Lee <ji...@gmail.com> wrote:
> Hi all,
> 
> I just wanted to introduce myself to the tapestry mailing list. I have

> been developing web apps using Java for the last couple years and in 
> the last 6 months or so I have really gotten into MVC frameworks such 
> as Struts and JSF. I would by no means consider myself an expert, but 
> I have already had a couple issues with Struts and although JSF has 
> potential, it is still not a rich, mature framework.
> 
> I've read everything I can get my hands on about Tapestry, including 
> the manning book. I really love its concepts and its goals. I am 
> hoping to have my first tapestry application in production within the 
> next 3 months.
> 
> Hope I haven't bored you yet, as I actually did have a question ;) I 
> was wondering if anyone could give me opinions about Tapestry and 
> persistence layers, such as Hibernate. I've never dealt with 
> persistence layers (in struts I just executed JDBC calls inside the 
> Action classes), and I really want to start off this time doing things

> the right way. Specifically:
> 
> 1. In your opinon, how "big" does a web app have to be to consider 
> using a persistence layer? Many times I question if I should really 
> use one since the web application doesn't do a whole lot. In these 
> instances, is it ok to have JDBC calls in your business classes?
> 
> 2. What are the advantages to using a persistence layer? There are 
> probably a million but Im a only a lowbie programmer, not yet up to 
> speed with industry best practices. In my head, I just see it as 
> another layer of work :)
> 
> 3. Kind of related to the first question, but is it ok to have JDBC 
> calls in tapestry's domain objects?
> 
> 4. What persistence layers work well with tapestry?
> 
> Well, thats all I have for now. Forgive me if I am not making too much

> sense, this is still a bit new to me. Thank you very much for reading 
> and I look forward to your responses.
> 
> Sincerely,
> 
> Jin Lee
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Introduction and question about tapestry + persistence

Posted by Jin Lee <ji...@gmail.com>.
Thank you everyone for the replies. I've decided to go ahead and look
into Hibernate since it seems well documented and has a very large
user base. Many times I have walked into a project thinking that it
was relatively small, only to have it grow almost exponentially by the
time it went into production.

Once again, thank you everyone for your feedback. I've purchased the
Manning book on Hibernate, and look forward to late nights of
studying! (Havent felt this way since college hehe)

Jin


On Tue, 16 Nov 2004 23:30:11 -0800, Jin Lee <ji...@gmail.com> wrote:
> Hi all,
> 
> I just wanted to introduce myself to the tapestry mailing list. I have
> been developing web apps using Java for the last couple years and in
> the last 6 months or so I have really gotten into MVC frameworks such
> as Struts and JSF. I would by no means consider myself an expert, but
> I have already had a couple issues with Struts and although JSF has
> potential, it is still not a rich, mature framework.
> 
> I've read everything I can get my hands on about Tapestry, including
> the manning book. I really love its concepts and its goals. I am
> hoping to have my first tapestry application in production within the
> next 3 months.
> 
> Hope I haven't bored you yet, as I actually did have a question ;) I
> was wondering if anyone could give me opinions about Tapestry and
> persistence layers, such as Hibernate. I've never dealt with
> persistence layers (in struts I just executed JDBC calls inside the
> Action classes), and I really want to start off this time doing things
> the right way. Specifically:
> 
> 1. In your opinon, how "big" does a web app have to be to consider
> using a persistence layer? Many times I question if I should really
> use one since the web application doesn't do a whole lot. In these
> instances, is it ok to have JDBC calls in your business classes?
> 
> 2. What are the advantages to using a persistence layer? There are
> probably a million but Im a only a lowbie programmer, not yet up to
> speed with industry best practices. In my head, I just see it as
> another layer of work :)
> 
> 3. Kind of related to the first question, but is it ok to have JDBC
> calls in tapestry's domain objects?
> 
> 4. What persistence layers work well with tapestry?
> 
> Well, thats all I have for now. Forgive me if I am not making too much
> sense, this is still a bit new to me. Thank you very much for reading
> and I look forward to your responses.
> 
> Sincerely,
> 
> Jin Lee
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Introduction and question about tapestry + persistence

Posted by David Ezzio <de...@ysoft.com>.
Hi Jin,

Other posters have given you reasons to use a persistence service.  To 
read about using JDO + Tapestry, I recommend my two tutorials on the 
subject at the JPOX site (an open source JDO implementation).

They can be found at:

http://www.jpox.org/docs/1_0/tutorials/tapestry.html

and

http://www.jpox.org/docs/1_1/tutorials/tapestry_petstore.html

Let me know what you think,

David


Jin Lee wrote:
> Hi all,
> 
> I just wanted to introduce myself to the tapestry mailing list. I have
> been developing web apps using Java for the last couple years and in
> the last 6 months or so I have really gotten into MVC frameworks such
> as Struts and JSF. I would by no means consider myself an expert, but
> I have already had a couple issues with Struts and although JSF has
> potential, it is still not a rich, mature framework.
> 
> I've read everything I can get my hands on about Tapestry, including
> the manning book. I really love its concepts and its goals. I am
> hoping to have my first tapestry application in production within the
> next 3 months.
> 
> Hope I haven't bored you yet, as I actually did have a question ;) I
> was wondering if anyone could give me opinions about Tapestry and
> persistence layers, such as Hibernate. I've never dealt with
> persistence layers (in struts I just executed JDBC calls inside the
> Action classes), and I really want to start off this time doing things
> the right way. Specifically:
> 
> 1. In your opinon, how "big" does a web app have to be to consider
> using a persistence layer? Many times I question if I should really
> use one since the web application doesn't do a whole lot. In these
> instances, is it ok to have JDBC calls in your business classes?
> 
> 2. What are the advantages to using a persistence layer? There are
> probably a million but Im a only a lowbie programmer, not yet up to
> speed with industry best practices. In my head, I just see it as
> another layer of work :)
> 
> 3. Kind of related to the first question, but is it ok to have JDBC
> calls in tapestry's domain objects?
> 
> 4. What persistence layers work well with tapestry? 
> 
> Well, thats all I have for now. Forgive me if I am not making too much
> sense, this is still a bit new to me. Thank you very much for reading
> and I look forward to your responses.
> 
> Sincerely,
> 
> Jin Lee
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org