Using an object to store and display data

I'm fairly new to JATO, but I think I now have a basic understanding

of how Viewbeans and Models interact. However, I want to incorporate

the use of a Javabean object that will be stored in the HTTP session

and will act as the connection between the Viewbean and Model instead

of having the Viewbean and Model interact directly with each other.

Basically I would like to have the Model set data in the object

stored in the session so that the Viewbean can pull it out to display

it. And vice versa, once the user modifies the data and is ready to

persist it, I would like to have the Viewbean set data in the object

stored in the session so that the Model can pull it out to store it

in the database. I'm not sure what the best approach would be to

accomplish this. Any help you could give would be greatly

appreciated.

Thanks,

Greg

[965 byte] By [Guest] at [2007-11-25 9:26:41]
# 1

Venki,

Thanks for the response. Actually, I'm not sure if I can answer all

of your questions because those are some of the same questions that

we're trying to answer ourselves. Basically, what we're trying to do

is incorporate our domain object model into the JATO framework. My

thinking was that one way we could accomplish this was by storing a

Javabean object in the HTTPSession to represent an object in the

domain model, and that the Viewbean and JATO Model could get and set

data from there. If you have a better suggestion of how to

accomplish this, I'm definitely open to hearing it.

Thanks,

Greg

In <a href="/group/SunONE-JATO/post?protectID=246075234167171124217231170221059165026 048139046">SunONE-JATO@y...</a>, Venki <<a href="/group/SunONE-JATO/post?protectID=180056180084056116213056203245129208071 ">heyvenki@y...</a>> wrote:

>

> OK grschroeder , first let me get this straight:

> 0. Are you going to pass this object to the model, or are u going

to pass the session object to the model?

> 1. Is there any specific reason for this approach you are taking?

> 2. Will there be a notification from the object u have mentioned to

have the model persist the data?

> 3. What about the reverse case, when the model refreshes the data,

how are you going to refresh you object?

> 4. The JavaBean Object that u are talking about, is it your own

object or is it implementation of an existing JATO interface?

> ~Venki

> grschroeder wrote:I'm fairly new to JATO, but I think I now have a

basic understanding

> of how Viewbeans and Models interact. However, I want to

incorporate

> the use of a Javabean object that will be stored in the HTTP

session

> and will act as the connection between the Viewbean and Model

instead

> of having the Viewbean and Model interact directly with each

other.

> Basically I would like to have the Model set data in the object

> stored in the session so that the Viewbean can pull it out to

display

> it. And vice versa, once the user modifies the data and is ready

to

> persist it, I would like to have the Viewbean set data in the

object

> stored in the session so that the Model can pull it out to store it

> in the database. I'm not sure what the best approach would be to

> accomplish this. Any help you could give would be greatly

> appreciated.

>

> Thanks,

>

> Greg

>

>

>

>

> To download the latest version of JATO, please visit:

> <a href="http://www.sun.com/software/download/developer/5102.html">http://www.s un.com/software/download/developer/5102.html</a>

>

> For more information about JATO, please visit:

> <a href="http://developer.iplanet.com/tech/appserver/framework/index.jsp">http: //developer.iplanet.com/tech/appserver/framework/index.jsp</a>

>

>

Service.

>

>

> Venki

> IT Solutions

> #6, Pycrofts Garden Road, Nugambakkam, Chennai - 600 006

> 91-44-4925740(Home) 91-44-8212877(Work)

> ************************************************************

> * Luck is what happens when Preparation meets Opportunity.

> ************************************************************

>

>

>

Guest at 2007-7-1 16:31:14 > top of Java-index,Development Tools,Java Tools...
# 2

I think the best approach would be to treat your Domain Objects (DO) as

the Database (the enterprise tier) from JATO's perspective. You could

create custom models that interface with our DO's and then the JATO

Views could easily bind to the custom DO models just like any other

model. This should eliminate the need for pushing data/objects from view

to model to database.

There is a JATO class called BeanAdapterModel that might be just what

you need, however, I am not experienced with using it. Maybe someone

else on my team or in the community could better explain how to use this

class.

craig

grschroeder wrote:

>Venki,

>

>Thanks for the response. Actually, I'm not sure if I can answer all

>of your questions because those are some of the same questions that

>we're trying to answer ourselves. Basically, what we're trying to do

>is incorporate our domain object model into the JATO framework. My

>thinking was that one way we could accomplish this was by storing a

>Javabean object in the HTTPSession to represent an object in the

>domain model, and that the Viewbean and JATO Model could get and set

>data from there. If you have a better suggestion of how to

>accomplish this, I'm definitely open to hearing it.

>

>Thanks,

>

>Greg

>

>

> In <a href="/group/SunONE-JATO/post?protectID=246075234167171124217231170221059165026 048139046">SunONE-JATO@y...</a>, Venki <<a href="/group/SunONE-JATO/post?protectID=180056180084056116213056203245129208071 ">heyvenki@y...</a>> wrote:

>

>>OK grschroeder , first let me get this straight:

>>0. Are you going to pass this object to the model, or are u going

>>

>to pass the session object to the model?

>

>>1. Is there any specific reason for this approach you are taking?

>>2. Will there be a notification from the object u have mentioned to

>>

>have the model persist the data?

>

>>3. What about the reverse case, when the model refreshes the data,

>>

>how are you going to refresh you object?

>

>>4. The JavaBean Object that u are talking about, is it your own

>>

>object or is it implementation of an existing JATO interface?

>

>>~Venki

>> grschroeder wrote:I'm fairly new to JATO, but I think I now have a

>>

>basic understanding

>

>>of how Viewbeans and Models interact. However, I want to

>>

>incorporate

>

>>the use of a Javabean object that will be stored in the HTTP

>>

>session

>

>>and will act as the connection between the Viewbean and Model

>>

>instead

>

>>of having the Viewbean and Model interact directly with each

>>

>other.

>

>>Basically I would like to have the Model set data in the object

>>stored in the session so that the Viewbean can pull it out to

>>

>display

>

>>it. And vice versa, once the user modifies the data and is ready

>>

>to

>

>>persist it, I would like to have the Viewbean set data in the

>>

>object

>

>>stored in the session so that the Model can pull it out to store it

>>in the database. I'm not sure what the best approach would be to

>>accomplish this. Any help you could give would be greatly

>>appreciated.

>>

>>Thanks,

>>

>>Greg

>>

>>

>>

>>

>>To download the latest version of JATO, please visit:

>><a href="http://www.sun.com/software/download/developer/5102.html">http://www.s un.com/software/download/developer/5102.html</a>

>>

>>For more information about JATO, please visit:

>><a href="http://developer.iplanet.com/tech/appserver/framework/index.jsp">http: //developer.iplanet.com/tech/appserver/framework/index.jsp</a>

>>

>>

>>

>Service.

>

>>

>>Venki

>>IT Solutions

>>#6, Pycrofts Garden Road, Nugambakkam, Chennai - 600 006

>>91-44-4925740(Home) 91-44-8212877(Work)

>>************************************************************

>>* Luck is what happens when Preparation meets Opportunity.

>>************************************************************

>>

>>

>>

>>

>

>

>

>To download the latest version of JATO, please visit:

><a href="http://www.sun.com/software/download/developer/5102.html">http://www.s un.com/software/download/developer/5102.html</a>

>

>For more information about JATO, please visit:

><a href="http://developer.iplanet.com/tech/appserver/framework/index.jsp">http: //developer.iplanet.com/tech/appserver/framework/index.jsp</a>

>

>

>

>

Guest at 2007-7-1 16:31:14 > top of Java-index,Development Tools,Java Tools...
# 3

Thanks for the help Craig. I looked at the sample code that makes

use of the BeanAdapterModel. Basically it looks like it allows a

view to interact with a bean the same way it would interact with any

other model. That part I think I understand. The part I'm a little

unclear on still is how to interface this BeanAdapterModel( which is

a very basic model ) that I now have with a query model to actually

interact with the database. Would I need to make direct JDBC calls

from my custom model instead of letting JATO dynamically create the

calls for me?

Thanks,

Greg

In <a href="/group/SunONE-JATO/post?protectID=246075234167171124217231170221059165026 048139046">SunONE-JATO@y...</a>, "Craig V. Conover" <<a href="/group/SunONE-JATO/post?protectID=219212113009229091025149066024064239039 098031046209130">craig.conover@s...</a>>

wrote:

> I think the best approach would be to treat your Domain Objects

(DO) as

> the Database (the enterprise tier) from JATO's perspective. You

could

> create custom models that interface with our DO's and then the JATO

> Views could easily bind to the custom DO models just like any other

> model. This should eliminate the need for pushing data/objects from

view

> to model to database.

>

> There is a JATO class called BeanAdapterModel that might be just

what

> you need, however, I am not experienced with using it. Maybe

someone

> else on my team or in the community could better explain how to use

this

> class.

>

> craig

>

>

> grschroeder wrote:

>

> >Venki,

> >

> >Thanks for the response. Actually, I'm not sure if I can answer

all

> >of your questions because those are some of the same questions

that

> >we're trying to answer ourselves. Basically, what we're trying to

do

> >is incorporate our domain object model into the JATO framework.

My

> >thinking was that one way we could accomplish this was by storing

a

> >Javabean object in the HTTPSession to represent an object in the

> >domain model, and that the Viewbean and JATO Model could get and

set

> >data from there. If you have a better suggestion of how to

> >accomplish this, I'm definitely open to hearing it.

> >

> >Thanks,

> >

> >Greg

> >

> >

> > In <a href="/group/SunONE-JATO/post?protectID=246075234167171124217231170221059165026 048139046">SunONE-JATO@y...</a>, Venki <<a href="/group/SunONE-JATO/post?protectID=180056180084056116213056203245129208071 ">heyvenki@y...</a>> wrote:

> >

> >>OK grschroeder , first let me get this straight:

> >>0. Are you going to pass this object to the model, or are u going

> >>

> >to pass the session object to the model?

> >

> >>1. Is there any specific reason for this approach you are taking?

> >>2. Will there be a notification from the object u have mentioned

to

> >>

> >have the model persist the data?

> >

> >>3. What about the reverse case, when the model refreshes the

data,

> >>

> >how are you going to refresh you object?

> >

> >>4. The JavaBean Object that u are talking about, is it your own

> >>

> >object or is it implementation of an existing JATO interface?

> >

> >>~Venki

> >> grschroeder wrote:I'm fairly new to JATO, but I think I now have

a

> >>

> >basic understanding

> >

> >>of how Viewbeans and Models interact. However, I want to

> >>

> >incorporate

> >

> >>the use of a Javabean object that will be stored in the HTTP

> >>

> >session

> >

> >>and will act as the connection between the Viewbean and Model

> >>

> >instead

> >

> >>of having the Viewbean and Model interact directly with each

> >>

> >other.

> >

> >>Basically I would like to have the Model set data in the object

> >>stored in the session so that the Viewbean can pull it out to

> >>

> >display

> >

> >>it. And vice versa, once the user modifies the data and is ready

> >>

> >to

> >

> >>persist it, I would like to have the Viewbean set data in the

> >>

> >object

> >

> >>stored in the session so that the Model can pull it out to store

it

> >>in the database. I'm not sure what the best approach would be to

> >>accomplish this. Any help you could give would be greatly

> >>appreciated.

> >>

> >>Thanks,

> >>

> >>Greg

> >>

> >>

> >>

> >>

> >>To download the latest version of JATO, please visit:

> >><a href="http://www.sun.com/software/download/developer/5102.html">http://www.s un.com/software/download/developer/5102.html</a>

> >>

> >>For more information about JATO, please visit:

> >><a href="http://developer.iplanet.com/tech/appserver/framework/index.jsp">http: //developer.iplanet.com/tech/appserver/framework/index.jsp</a>

> >>

> >>

> >>

> >Service.

> >

> >>

> >>Venki

> >>IT Solutions

> >>#6, Pycrofts Garden Road, Nugambakkam, Chennai - 600 006

> >>91-44-4925740(Home) 91-44-8212877(Work)

> >>************************************************************

> >>* Luck is what happens when Preparation meets Opportunity.

> >>************************************************************

> >>

> >>

> >>

> >

> >

> >

> >To download the latest version of JATO, please visit:

> ><a href="http://www.sun.com/software/download/developer/5102.html">http://www.s un.com/software/download/developer/5102.html</a>

> >

> >For more information about JATO, please visit:

> ><a href="http://developer.iplanet.com/tech/appserver/framework/index.jsp">http: //developer.iplanet.com/tech/appserver/framework/index.jsp</a>

> >

> >

> >

> >

Guest at 2007-7-1 16:31:14 > top of Java-index,Development Tools,Java Tools...
# 4

Craig,

I think it all finally makes sense. First, your assumption is

correct regarding the process flow. The ViewBean will interact with

a custom Javabean which will then in turn interact with a SQL Model

to access the database. So now let me make sure I understand what I

need to do. Basically the custom Javabean will have a method to get

the SQLModel. I would then invoke the setValue method on the

SQLModel and call the appropriate execute method( e.g.,

executeUpdate, etc. ) just like I would do from a ViewBean. Does

this sound correct?

Thanks,

Greg

In <a href="/group/SunONE-JATO/post?protectID=246075234167171124217231170221059165026 048139046">SunONE-JATO@y...</a>, "Craig V. Conover" <<a href="/group/SunONE-JATO/post?protectID=219212113009229091025149066024064239039 098031046209130">craig.conover@s...</a>>

wrote:

> Greg,

> see below...

>

> grschroeder wrote:

>

> >Thanks for the help Craig. I looked at the sample code that makes

> >use of the BeanAdapterModel. Basically it looks like it allows a

> >view to interact with a bean the same way it would interact with

any

> >other model. That part I think I understand.

> >

> This is correct.

>

> > The part I'm a little

> >unclear on still is how to interface this BeanAdapterModel( which

is

> >a very basic model ) that I now have with a query model to

actually

> >interact with the database.

> >

> Not sure what you mean by "interface this BeanAdapterModel ... with

a

> query model". Does this mean that you have a ViewBean the interacts

with

> a custom JavaBean via the BeanAdpterModel wrapper, and from the

> JavaBean you are interacting with the SQL Model?

>

> So it looks like this: ViewBean > BeanAdapterModel(Custom JavaBean)

>

> SQL Model > RDBMS

>

> That's what I am reading anyway. Please explain this to me.

>

> >Would I need to make direct JDBC calls

> >from my custom model instead of letting JATO dynamically create

the

> >calls for me?

> >

> If my assumptions above are correct, then the custom JavaBean can

simply

> use the SQL Model in exactly the same manner as the ViewBean,

otherwise,

> if no SQL Model is involved, then yes, you need to handle JDBC

directly,

> which is fine, if you do it "right" (connection pooling, result set

> handling, etc.).

>

> >

> >

> >Thanks,

> >

> >Greg

> >

> > In <a href="/group/SunONE-JATO/post?protectID=246075234167171124217231170221059165026 048139046">SunONE-JATO@y...</a>, "Craig V. Conover" <<a href="/group/SunONE-JATO/post?protectID=219212113009229091025149066024064239039 098031046209130">craig.conover@s...</a>>

> >wrote:

> >

> >>I think the best approach would be to treat your Domain Objects

> >>

> >(DO) as

> >

> >>the Database (the enterprise tier) from JATO's perspective. You

> >>

> >could

> >

> >>create custom models that interface with our DO's and then the

JATO

> >>Views could easily bind to the custom DO models just like any

other

> >>model. This should eliminate the need for pushing data/objects

from

> >>

> >view

> >

> >>to model to database.

> >>

> >>There is a JATO class called BeanAdapterModel that might be just

> >>

> >what

> >

> >>you need, however, I am not experienced with using it. Maybe

> >>

> >someone

> >

> >>else on my team or in the community could better explain how to

use

> >>

> >this

> >

> >>class.

> >>

> >>craig

> >>

> >>

> >>grschroeder wrote:

> >>

> >>>Venki,

> >>>

> >>>Thanks for the response. Actually, I'm not sure if I can answer

> >>>

> >all

> >

> >>>of your questions because those are some of the same questions

> >>>

> >that

> >

> >>>we're trying to answer ourselves. Basically, what we're trying

to

> >>>

> >do

> >

> >>>is incorporate our domain object model into the JATO framework.

> >>>

> >My

> >

> >>>thinking was that one way we could accomplish this was by

storing

> >>>

> >a

> >

> >>>Javabean object in the HTTPSession to represent an object in the

> >>>domain model, and that the Viewbean and JATO Model could get and

> >>>

> >set

> >

> >>>data from there. If you have a better suggestion of how to

> >>>accomplish this, I'm definitely open to hearing it.

> >>>

> >>>Thanks,

> >>>

> >>>Greg

> >>>

> >>>

> >>> In <a href="/group/SunONE-JATO/post?protectID=246075234167171124217231170221059165026 048139046">SunONE-JATO@y...</a>, Venki <<a href="/group/SunONE-JATO/post?protectID=180056180084056116213056203245129208071 ">heyvenki@y...</a>> wrote:

> >>>

> >>>>OK grschroeder , first let me get this straight:

> >>>>0. Are you going to pass this object to the model, or are u

going

> >>>>

> >>>to pass the session object to the model?

> >>>

> >>>>1. Is there any specific reason for this approach you are

taking?

> >>>>2. Will there be a notification from the object u have

mentioned

> >>>>

> >to

> >

> >>>have the model persist the data?

> >>>

> >>>>3. What about the reverse case, when the model refreshes the

> >>>>

> >data,

> >

> >>>how are you going to refresh you object?

> >>>

> >>>>4. The JavaBean Object that u are talking about, is it your own

> >>>>

> >>>object or is it implementation of an existing JATO interface?

> >>>

> >>>>~Venki

> >>>>grschroeder wrote:I'm fairly new to JATO, but I think I now

have

> >>>>

> >a

> >

> >>>basic understanding

> >>>

> >>>>of how Viewbeans and Models interact. However, I want to

> >>>>

> >>>incorporate

> >>>

> >>>>the use of a Javabean object that will be stored in the HTTP

> >>>>

> >>>session

> >>>

> >>>>and will act as the connection between the Viewbean and Model

> >>>>

> >>>instead

> >>>

> >>>>of having the Viewbean and Model interact directly with each

> >>>>

> >>>other.

> >>>

> >>>>Basically I would like to have the Model set data in the object

> >>>>stored in the session so that the Viewbean can pull it out to

> >>>>

> >>>display

> >>>

> >>>>it. And vice versa, once the user modifies the data and is

ready

> >>>>

> >>>to

> >>>

> >>>>persist it, I would like to have the Viewbean set data in the

> >>>>

> >>>object

> >>>

> >>>>stored in the session so that the Model can pull it out to

store

> >>>>

> >it

> >

> >>>>in the database. I'm not sure what the best approach would be

to

> >>>>accomplish this. Any help you could give would be greatly

> >>>>appreciated.

> >>>>

> >>>>Thanks,

> >>>>

> >>>>Greg

> >>>>

> >>>>

> >>>>

> >>>>

> >>>>To download the latest version of JATO, please visit:

> >>>><a href="http://www.sun.com/software/download/developer/5102.html">http://www.s un.com/software/download/developer/5102.html</a>

> >>>>

> >>>>For more information about JATO, please visit:

> >>>><a href="http://developer.iplanet.com/tech/appserver/framework/index.jsp">http: //developer.iplanet.com/tech/appserver/framework/index.jsp</a>

> >>>>

> >>>>

> >>>>

> >>>Service.

> >>>

> >>>>Venki

> >>>>IT Solutions

> >>>>#6, Pycrofts Garden Road, Nugambakkam, Chennai - 600 006

> >>>>91-44-4925740(Home) 91-44-8212877(Work)

> >>>>************************************************************

> >>>>* Luck is what happens when Preparation meets Opportunity.

> >>>>************************************************************

> >>>>

> >>>>

> >>>>

> >>>>

> >>>

> >>>

> >>>To download the latest version of JATO, please visit:

> >>><a href="http://www.sun.com/software/download/developer/5102.html">http://www.s un.com/software/download/developer/5102.html</a>

> >>>

> >>>For more information about JATO, please visit:

> >>><a href="http://developer.iplanet.com/tech/appserver/framework/index.jsp">http: //developer.iplanet.com/tech/appserver/framework/index.jsp</a>

> >>>

> >>>

> >>>

> >

> >>>

> >

> >

> >

> >To download the latest version of JATO, please visit:

> ><a href="http://www.sun.com/software/download/developer/5102.html">http://www.s un.com/software/download/developer/5102.html</a>

> >

> >For more information about JATO, please visit:

> ><a href="http://developer.iplanet.com/tech/appserver/framework/index.jsp">http: //developer.iplanet.com/tech/appserver/framework/index.jsp</a>

> >

> >

> >

> >

Guest at 2007-7-1 16:31:14 > top of Java-index,Development Tools,Java Tools...
# 5

This sounds correct.

My only question is this. What necessitates going through the JavaBean

to the SQL Model?

In other words, would it be easier/better/whatever to do this:

Get data from the bean:

ViewBean <> JavaBean (with or without the BeanAdapter)

Push the data from the bean to the sql model from the View Bean

ViewBean > SQL Model

I'm not suggesting that this is easier/better, I just want to make sure

you've looked at all the angles.

In fact, now that I put it in type, this sounds less MVC like. The prior

solution sounds more modular.

c

grschroeder wrote:

>Craig,

>

>I think it all finally makes sense. First, your assumption is

>correct regarding the process flow. The ViewBean will interact with

>a custom Javabean which will then in turn interact with a SQL Model

>to access the database. So now let me make sure I understand what I

>need to do. Basically the custom Javabean will have a method to get

>the SQLModel. I would then invoke the setValue method on the

>SQLModel and call the appropriate execute method( e.g.,

>executeUpdate, etc. ) just like I would do from a ViewBean. Does

>this sound correct?

>

>Thanks,

>

>Greg

>

> In <a href="/group/SunONE-JATO/post?protectID=246075234167171124217231170221059165026 048139046">SunONE-JATO@y...</a>, "Craig V. Conover" <<a href="/group/SunONE-JATO/post?protectID=219212113009229091025149066024064239039 098031046209130">craig.conover@s...</a>>

>wrote:

>

>>Greg,

>>see below...

>>

>>grschroeder wrote:

>>

>>>Thanks for the help Craig. I looked at the sample code that makes

>>>use of the BeanAdapterModel. Basically it looks like it allows a

>>>view to interact with a bean the same way it would interact with

>>>

>any

>

>>>other model. That part I think I understand.

>>>

>>This is correct.

>>

>>> The part I'm a little

>>>unclear on still is how to interface this BeanAdapterModel( which

>>>

>is

>

>>>a very basic model ) that I now have with a query model to

>>>

>actually

>

>>>interact with the database.

>>>

>>Not sure what you mean by "interface this BeanAdapterModel ... with

>>

>a

>

>>query model". Does this mean that you have a ViewBean the interacts

>>

>with

>

>>a custom JavaBean via the BeanAdpterModel wrapper, and from the

>>JavaBean you are interacting with the SQL Model?

>>

>>So it looks like this: ViewBean > BeanAdapterModel(Custom JavaBean)

>>

>>SQL Model > RDBMS

>>

>>That's what I am reading anyway. Please explain this to me.

>>

>>>Would I need to make direct JDBC calls

>>>

>>>from my custom model instead of letting JATO dynamically create

>>

>the

>

>>>calls for me?

>>>

>>If my assumptions above are correct, then the custom JavaBean can

>>

>simply

>

>>use the SQL Model in exactly the same manner as the ViewBean,

>>

>otherwise,

>

>>if no SQL Model is involved, then yes, you need to handle JDBC

>>

>directly,

>

>>which is fine, if you do it "right" (connection pooling, result set

>>handling, etc.).

>>

>>>

>>>Thanks,

>>>

>>>Greg

>>>

>>> In <a href="/group/SunONE-JATO/post?protectID=246075234167171124217231170221059165026 048139046">SunONE-JATO@y...</a>, "Craig V. Conover" <<a href="/group/SunONE-JATO/post?protectID=219212113009229091025149066024064239039 098031046209130">craig.conover@s...</a>>

>>>wrote:

>>>

>>>>I think the best approach would be to treat your Domain Objects

>>>>

>>>(DO) as

>>>

>>>>the Database (the enterprise tier) from JATO's perspective. You

>>>>

>>>could

>>>

>>>>create custom models that interface with our DO's and then the

>>>>

>JATO

>

>>>>Views could easily bind to the custom DO models just like any

>>>>

>other

>

>>>>model. This should eliminate the need for pushing data/objects

>>>>

>from

>

>>>view

>>>

>>>>to model to database.

>>>>

>>>>There is a JATO class called BeanAdapterModel that might be just

>>>>

>>>what

>>>

>>>>you need, however, I am not experienced with using it. Maybe

>>>>

>>>someone

>>>

>>>>else on my team or in the community could better explain how to

>>>>

>use

>

>>>this

>>>

>>>>class.

>>>>

>>>>craig

>>>>

>>>>

>>>>grschroeder wrote:

>>>>

>>>>>Venki,

>>>>>

>>>>>Thanks for the response. Actually, I'm not sure if I can answer

>>>>>

>>>all

>>>

>>>>>of your questions because those are some of the same questions

>>>>>

>>>that

>>>

>>>>>we're trying to answer ourselves. Basically, what we're trying

>>>>>

>to

>

>>>do

>>>

>>>>>is incorporate our domain object model into the JATO framework.

>>>>>

>>>My

>>>

>>>>>thinking was that one way we could accomplish this was by

>>>>>

>storing

>

>>>a

>>>

>>>>>Javabean object in the HTTPSession to represent an object in the

>>>>>domain model, and that the Viewbean and JATO Model could get and

>>>>>

>>>set

>>>

>>>>>data from there. If you have a better suggestion of how to

>>>>>accomplish this, I'm definitely open to hearing it.

>>>>>

>>>>>Thanks,

>>>>>

>>>>>Greg

>>>>>

>>>>>

>>>>> In <a href="/group/SunONE-JATO/post?protectID=246075234167171124217231170221059165026 048139046">SunONE-JATO@y...</a>, Venki <<a href="/group/SunONE-JATO/post?protectID=180056180084056116213056203245129208071 ">heyvenki@y...</a>> wrote:

>>>>>

>>>>>>OK grschroeder , first let me get this straight:

>>>>>>0. Are you going to pass this object to the model, or are u

>>>>>>

>going

>

>>>>>to pass the session object to the model?

>>>>>

>>>>>>1. Is there any specific reason for this approach you are

>>>>>>

>taking?

>

>>>>>>2. Will there be a notification from the object u have

>>>>>>

>mentioned

>

>>>to

>>>

>>>>>have the model persist the data?

>>>>>

>>>>>>3. What about the reverse case, when the model refreshes the

>>>>>>

>>>data,

>>>

>>>>>how are you going to refresh you object?

>>>>>

>>>>>>4. The JavaBean Object that u are talking about, is it your own

>>>>>>

>>>>>object or is it implementation of an existing JATO interface?

>>>>>

>>>>>>~Venki

>>>>>>grschroeder wrote:I'm fairly new to JATO, but I think I now

>>>>>>

>have

>

>>>a

>>>

>>>>>basic understanding

>>>>>

>>>>>>of how Viewbeans and Models interact. However, I want to

>>>>>>

>>>>>incorporate

>>>>>

>>>>>>the use of a Javabean object that will be stored in the HTTP

>>>>>>

>>>>>session

>>>>>

>>>>>>and will act as the connection between the Viewbean and Model

>>>>>>

>>>>>instead

>>>>>

>>>>>>of having the Viewbean and Model interact directly with each

>>>>>>

>>>>>other.

>>>>>

>>>>>>Basically I would like to have the Model set data in the object

>>>>>>stored in the session so that the Viewbean can pull it out to

>>>>>>

>>>>>display

>>>>>

>>>>>>it. And vice versa, once the user modifies the data and is

>>>>>>

>ready

>

>>>>>to

>>>>>

>>>>>>persist it, I would like to have the Viewbean set data in the

>>>>>>

>>>>>object

>>>>>

>>>>>>stored in the session so that the Model can pull it out to

>>>>>>

>store

>

>>>it

>>>

>>>>>>in the database. I'm not sure what the best approach would be

>>>>>>

>to

>

>>>>>>accomplish this. Any help you could give would be greatly

>>>>>>appreciated.

>>>>>>

>>>>>>Thanks,

>>>>>>

>>>>>>Greg

>>>>>>

>>>>>>

>>>>>>

>>>>>>

>>>>>>To download the latest version of JATO, please visit:

>>>>>><a href="http://www.sun.com/software/download/developer/5102.html">http://www.s un.com/software/download/developer/5102.html</a>

>>>>>>

>>>>>>For more information about JATO, please visit:

>>>>>><a href="http://developer.iplanet.com/tech/appserver/framework/index.jsp">http: //developer.iplanet.com/tech/appserver/framework/index.jsp</a>

>>>>>>

>>>>>>

>>>>>>

>>>>>Service.

>>>>>

>>>>>>Venki

>>>>>>IT Solutions

>>>>>>#6, Pycrofts Garden Road, Nugambakkam, Chennai - 600 006

>>>>>>91-44-4925740(Home) 91-44-8212877(Work)

>>>>>>******************************************************* *****

>>>>>>* Luck is what happens when Preparation meets Opportunity.

>>>>>>******************************************************* *****

>>>>>>

>>>>>>

>>>>>>

>>>>>>

>>>>>

>>>>>To download the latest version of JATO, please visit:

>>>>><a href="http://www.sun.com/software/download/developer/5102.html">http://www.s un.com/software/download/developer/5102.html</a>

>>>>>

>>>>>For more information about JATO, please visit:

>>>>><a href="http://developer.iplanet.com/tech/appserver/framework/index.jsp">http: //developer.iplanet.com/tech/appserver/framework/index.jsp</a>

>>>>>

>>>>>

>>>>>

>>>

>>>

>>>

>>>To download the latest version of JATO, please visit:

>>><a href="http://www.sun.com/software/download/developer/5102.html">http://www.s un.com/software/download/developer/5102.html</a>

>>>

>>>For more information about JATO, please visit:

>>><a href="http://developer.iplanet.com/tech/appserver/framework/index.jsp">http: //developer.iplanet.com/tech/appserver/framework/index.jsp</a>

>>>

>>>

>>>

>

>>>

>

>

>

>To download the latest version of JATO, please visit:

><a href="http://www.sun.com/software/download/developer/5102.html">http://www.s un.com/software/download/developer/5102.html</a>

>

>For more information about JATO, please visit:

><a href="http://developer.iplanet.com/tech/appserver/framework/index.jsp">http: //developer.iplanet.com/tech/appserver/framework/index.jsp</a>

>

>

>

>

Guest at 2007-7-1 16:31:14 > top of Java-index,Development Tools,Java Tools...
# 6

grschroeder wrote:

>Craig,

>

>Thanks again for all the help. I was actually headed down the path

>of having the Viewbean interact with the custom Javabean and then

>have the Viewbean push the data to the SQL Model, but I wasn't sure

>if this was the best approach or not. Then, from your replies, I

>thought you were referring more to the approach of pushing the data

>to the SQL Model from the Javabean.

>

This is what I was saying at first, then suggested an alternative. But

the alternative was what I thought might not be as "correct" in terms of

MVC, but do what works.

> I guess it was just a

>misunderstanding on my part, but in any case now I have two

>approaches that I can try.

>

>Thanks again. I appreciate it.

>

>Greg

>

> In <a href="/group/SunONE-JATO/post?protectID=246075234167171124217231170221059165026 048139046">SunONE-JATO@y...</a>, "Craig V. Conover" <<a href="/group/SunONE-JATO/post?protectID=219212113009229091025149066024064239039 098031046209130">craig.conover@s...</a>>

>wrote:

>

>>This sounds correct.

>>My only question is this. What necessitates going through the

>>

>JavaBean

>

>>to the SQL Model?

>>

>>In other words, would it be easier/better/whatever to do this:

>>Get data from the bean:

>>ViewBean <> JavaBean (with or without the BeanAdapter)

>>Push the data from the bean to the sql model from the View Bean

>>ViewBean > SQL Model

>>

>>I'm not suggesting that this is easier/better, I just want to make

>>

>sure

>

>>you've looked at all the angles.

>>In fact, now that I put it in type, this sounds less MVC like. The

>>

>prior

>

>>solution sounds more modular.

>>

>>c

>>

>>

>>grschroeder wrote:

>>

>>>Craig,

>>>

>>>I think it all finally makes sense. First, your assumption is

>>>correct regarding the process flow. The ViewBean will interact

>>>

>with

>

>>>a custom Javabean which will then in turn interact with a SQL

>>>

>Model

>

>>>to access the database. So now let me make sure I understand what

>>>

>I

>

>>>need to do. Basically the custom Javabean will have a method to

>>>

>get

>

>>>the SQLModel. I would then invoke the setValue method on the

>>>SQLModel and call the appropriate execute method( e.g.,

>>>executeUpdate, etc. ) just like I would do from a ViewBean. Does

>>>this sound correct?

>>>

>>>Thanks,

>>>

>>>Greg

>>>

>>> In <a href="/group/SunONE-JATO/post?protectID=246075234167171124217231170221059165026 048139046">SunONE-JATO@y...</a>, "Craig V. Conover" <<a href="/group/SunONE-JATO/post?protectID=219212113009229091025149066024064239039 098031046209130">craig.conover@s...</a>>

>>>wrote:

>>>

>>>>Greg,

>>>>see below...

>>>>

>>>>grschroeder wrote:

>>>>

>>>>>Thanks for the help Craig. I looked at the sample code that

>>>>>

>makes

>

>>>>>use of the BeanAdapterModel. Basically it looks like it allows

>>>>>

>a

>

>>>>>view to interact with a bean the same way it would interact with

>>>>>

>>>any

>>>

>>>>>other model. That part I think I understand.

>>>>>

>>>>This is correct.

>>>>

>>>>>The part I'm a little

>>>>>unclear on still is how to interface this BeanAdapterModel(

>>>>>

>which

>

>>>is

>>>

>>>>>a very basic model ) that I now have with a query model to

>>>>>

>>>actually

>>>

>>>>>interact with the database.

>>>>>

>>>>Not sure what you mean by "interface this BeanAdapterModel ...

>>>>

>with

>

>>>a

>>>

>>>>query model". Does this mean that you have a ViewBean the

>>>>

>interacts

>

>>>with

>>>

>>>>a custom JavaBean via the BeanAdpterModel wrapper, and from the

>>>>JavaBean you are interacting with the SQL Model?

>>>>

>>>>So it looks like this: ViewBean > BeanAdapterModel(Custom

>>>>

>JavaBean)

>

>>>>SQL Model > RDBMS

>>>>

>>>>That's what I am reading anyway. Please explain this to me.

>>>>

>>>>>Would I need to make direct JDBC calls

>>>>>

>>>>>from my custom model instead of letting JATO dynamically create

>>>>

>>>the

>>>

>>>>>calls for me?

>>>>>

>>>>If my assumptions above are correct, then the custom JavaBean can

>>>>

>>>simply

>>>

>>>>use the SQL Model in exactly the same manner as the ViewBean,

>>>>

>>>otherwise,

>>>

>>>>if no SQL Model is involved, then yes, you need to handle JDBC

>>>>

>>>directly,

>>>

>>>>which is fine, if you do it "right" (connection pooling, result

>>>>

>set

>

>>>>handling, etc.).

>>>>

>>>>>Thanks,

>>>>>

>>>>>Greg

>>>>>

>>>>> In <a href="/group/SunONE-JATO/post?protectID=246075234167171124217231170221059165026 048139046">SunONE-JATO@y...</a>, "Craig V. Conover" <<a href="/group/SunONE-JATO/post?protectID=219212113009229091025149066024064239039 098031046209130">craig.conover@s...</a>>

>>>>>wrote:

>>>>>

>>>>>>I think the best approach would be to treat your Domain Objects

>>>>>>

>>>>>(DO) as

>>>>>

>>>>>>the Database (the enterprise tier) from JATO's perspective.

>>>>>>

>You

>

>>>>>could

>>>>>

>>>>>>create custom models that interface with our DO's and then the

>>>>>>

>>>JATO

>>>

>>>>>>Views could easily bind to the custom DO models just like any

>>>>>>

>>>other

>>>

>>>>>>model. This should eliminate the need for pushing data/objects

>>>>>>

>>>from

>>

>>>>>view

>>>>>

>>>>>>to model to database.

>>>>>>

>>>>>>There is a JATO class called BeanAdapterModel that might be

>>>>>>

>just

>

>>>>>what

>>>>>

>>>>>>you need, however, I am not experienced with using it. Maybe

>>>>>>

>>>>>someone

>>>>>

>>>>>>else on my team or in the community could better explain how to

>>>>>>

>>>use

>>>

>>>>>this

>>>>>

>>>>>>class.

>>>>>>

>>>>>>craig

>>>>>>

>>>>>>

>>>>>>grschroeder wrote:

>>>>>>

>>>>>>>Venki,

>>>>>>>

>>>>>>>Thanks for the response. Actually, I'm not sure if I can

>>>>>>>

>answer

>

>>>>>all

>>>>>

>>>>>>>of your questions because those are some of the same questions

>>>>>>>

>>>>>that

>>>>>

>>>>>>>we're trying to answer ourselves. Basically, what we're

>>>>>>>

>trying

>

>>>to

>>>

>>>>>do

>>>>>

>>>>>>>is incorporate our domain object model into the JATO

>>>>>>>

>framework.

>

>>>>>My

>>>>>

>>>>>>>thinking was that one way we could accomplish this was by

>>>>>>>

>>>storing

>>>

>>>>>a

>>>>>

>>>>>>>Javabean object in the HTTPSession to represent an object in

>>>>>>>

>the

>

>>>>>>>domain model, and that the Viewbean and JATO Model could get

>>>>>>>

>and

>

>>>>>set

>>>>>

>>>>>>>data from there. If you have a better suggestion of how to

>>>>>>>accomplish this, I'm definitely open to hearing it.

>>>>>>>

>>>>>>>Thanks,

>>>>>>>

>>>>>>>Greg

>>>>>>>

>>>>>>>

>>>>>>> In <a href="/group/SunONE-JATO/post?protectID=246075234167171124217231170221059165026 048139046">SunONE-JATO@y...</a>, Venki <<a href="/group/SunONE-JATO/post?protectID=180056180084056116213056203245129208071 ">heyvenki@y...</a>> wrote:

>>>>>>>

>>>>>>>>OK grschroeder , first let me get this straight:

>>>>>>>>0. Are you going to pass this object to the model, or are u

>>>>>>>>

>>>going

>>>

>>>>>>>to pass the session object to the model?

>>>>>>>

>>>>>>>>1. Is there any specific reason for this approach you are

>>>>>>>>

>>>taking?

>>>

>>>>>>>>2. Will there be a notification from the object u have

>>>>>>>>

>>>mentioned

>>>

>>>>>to

>>>>>

>>>>>>>have the model persist the data?

>>>>>>>

>>>>>>>>3. What about the reverse case, when the model refreshes the

>>>>>>>>

>>>>>data,

>>>>>

>>>>>>>how are you going to refresh you object?

>>>>>>>

>>>>>>>>4. The JavaBean Object that u are talking about, is it your

>>>>>>>>

>own

>

>>>>>>>object or is it implementation of an existing JATO interface?

>>>>>>>

>>>>>>>>~Venki

>>>>>>>>grschroeder wrote:I'm fairly new to JATO, but I think I now

>>>>>>>>

>>>have

>>>

>>>>>a

>>>>>

>>>>>>>basic understanding

>>>>>>>

>>>>>>>>of how Viewbeans and Models interact. However, I want to

>>>>>>>>

>>>>>>>incorporate

>>>>>>>

>>>>>>>>the use of a Javabean object that will be stored in the HTTP

>>>>>>>>

>>>>>>>session

>>>>>>>

>>>>>>>>and will act as the connection between the Viewbean and Model

>>>>>>>>

>>>>>>>instead

>>>>>>>

>>>>>>>>of having the Viewbean and Model interact directly with each

>>>>>>>>

>>>>>>>other.

>>>>>>>

>>>>>>>>Basically I would like to have the Model set data in the

>>>>>>>>

>object

>

>>>>>>>>stored in the session so that the Viewbean can pull it out to

>>>>>>>>

>>>>>>>display

>>>>>>>

>>>>>>>>it. And vice versa, once the user modifies the data and is

>>>>>>>>

>>>ready

>>>

>>>>>>>to

>>>>>>>

>>>>>>>>persist it, I would like to have the Viewbean set data in the

>>>>>>>>

>>>>>>>object

>>>>>>>

>>>>>>>>stored in the session so that the Model can pull it out to

>>>>>>>>

>>>store

>>>

>>>>>it

>>>>>

>>>>>>>>in the database. I'm not sure what the best approach would

>>>>>>>>

>be

>

>>>to

>>>

>>>>>>>>accomplish this. Any help you could give would be greatly

>>>>>>>>appreciated.

>>>>>>>>

>>>>>>>>Thanks,

>>>>>>>>

>>>>>>>>Greg

>>>>>>>>

>>>>>>>>

>>>>>>>>

>>>>>>>>

>>>>>>>>To download the latest version of JATO, please visit:

>>>>>>>><a href="http://www.sun.com/software/download/developer/5102.html">http://www.s un.com/software/download/developer/5102.html</a>

>>>>>>>>

>>>>>>>>For more information about JATO, please visit:

>>>>>>>>

>>>>>>><a href="http://developer.iplanet.com/tech/appserver/framework/index.jsp">http: //developer.iplanet.com/tech/appserver/framework/index.jsp</a>

>>>>>>>

>>>>>>>>

>>>>>>>>

>>>>>>>Service.

>>>>>>>

>>>>>>>>Venki

>>>>>>>>IT Solutions

>>>>>>>>#6, Pycrofts Garden Road, Nugambakkam, Chennai - 600 006

>>>>>>>>91-44-4925740(Home) 91-44-8212877(Work)

>>>>>>>>*********************************************** *************

>>>>>>>>* Luck is what happens when Preparation meets Opportunity.

>>>>>>>>*********************************************** *************

>>>>>>>>

>>>>>>>>

>>>>>>>>

>>>>>>>>

>>>>>>>To download the latest version of JATO, please visit:

>>>>>>><a href="http://www.sun.com/software/download/developer/5102.html">http://www.s un.com/software/download/developer/5102.html</a>

>>>>>>>

>>>>>>>For more information about JATO, please visit:

>>>>>>><a href="http://developer.iplanet.com/tech/appserver/framework/index.jsp">http: //developer.iplanet.com/tech/appserver/framework/index.jsp</a>

>>>>>>>

>>>>>>>

>>>>>>>

>>>>>

>>>>>

>>>>>

>>>>>To download the latest version of JATO, please visit:

>>>>><a href="http://www.sun.com/software/download/developer/5102.html">http://www.s un.com/software/download/developer/5102.html</a>

>>>>>

>>>>>For more information about JATO, please visit:

>>>>><a href="http://developer.iplanet.com/tech/appserver/framework/index.jsp">http: //developer.iplanet.com/tech/appserver/framework/index.jsp</a>

>>>>>

>>>>>

>>>>>

>>>

>>>

>>>

>>>To download the latest version of JATO, please visit:

>>><a href="http://www.sun.com/software/download/developer/5102.html">http://www.s un.com/software/download/developer/5102.html</a>

>>>

>>>For more information about JATO, please visit:

>>><a href="http://developer.iplanet.com/tech/appserver/framework/index.jsp">http: //developer.iplanet.com/tech/appserver/framework/index.jsp</a>

>>>

>>>

>>>

>

>>>

>

>

>

>To download the latest version of JATO, please visit:

><a href="http://www.sun.com/software/download/developer/5102.html">http://www.s un.com/software/download/developer/5102.html</a>

>

>For more information about JATO, please visit:

><a href="http://developer.iplanet.com/tech/appserver/framework/index.jsp">http: //developer.iplanet.com/tech/appserver/framework/index.jsp</a>

>

>

>

>

Guest at 2007-7-1 16:31:14 > top of Java-index,Development Tools,Java Tools...