  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Struts - A MVC web framework | | Tomcat - JSP/Servlet container | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | | JSP - A mailing list about Java Server Pages specification and reference | |
Struts & Hibernate
|
|
|
  | | | What is a "Data Object "? | What is a "Data Object "? 2004-01-03 - By ashraf galal
Back <html><div style='background-color:'><P class=MsoNormal style="MARGIN: 0in 0in 0pt"><TT><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New' ">Chad;<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></TT></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><TT><SPAN style="FONT-SIZE: 10pt ; COLOR: black; FONT-FAMILY: 'Courier New'">Regarding your first comment:<o:p>< /o:p></SPAN></TT></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><TT><SPAN style="FONT-SIZE: 10pt ; COLOR: black; FONT-FAMILY: 'Courier New'">If you have a look at the sequence diagram attached with this class diagram (which I wasn�t able to send it to you since the message must not be greater than 50K and it also from the book), you will find that the business object might be stored in persistence storage.<o:p> </o:p></SPAN></TT></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><TT><SPAN style="FONT-SIZE: 10pt ; COLOR: black; FONT-FAMILY: 'Courier New'">This persistence storage could be any thing you like, entity bean, java class, flat file, �etc.<o:p></o:p></SPAN> </TT></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><TT><SPAN style="FONT-SIZE: 10pt ; COLOR: black; FONT-FAMILY: 'Courier New'">To have the big picture please get a look to the DAO class diagram and sequence diagram this will explain more about the data object.<o:p></o:p></SPAN></TT></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><TT><SPAN style="FONT-SIZE: 10pt ; COLOR: black; FONT-FAMILY: 'Courier New'">The term data object, we use that term to indicate any object that persist in storage. <o:p></o:p></SPAN></TT></P > <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><TT><SPAN style="FONT-SIZE: 10pt ; COLOR: black; FONT-FAMILY: 'Courier New'">The business object pattern does not mean data object. <o:p></o:p></SPAN></TT></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><TT><SPAN style="FONT-SIZE: 10pt ; COLOR: black; FONT-FAMILY: 'Courier New'">The following is from the book too: <o:p></o:p></SPAN></TT></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-font-size: 12.0pt">Business object is an object that implements business logic and/or business data.<o:p></o:p></SPAN>< /P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-font-size: 12.0pt">`<o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-font-size: 12.0pt">Business data and business logic are implemented in coarse-grained objects called business objects.<o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-font-size: 12.0pt"> <o:p></o:p></SPAN ></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-font-size: 12.0pt">In J2EE, business objects are implemented as session or entity beans.<o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-bidi-font-size: 12.0pt">In some cases, a business object could be an arbitrary java object that provides some services. <o:p></o:p></SPAN></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><TT><SPAN style="FONT-SIZE: 10pt ; COLOR: black; FONT-FAMILY: 'Courier New'"> <o:p></o:p></SPAN></TT></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><TT><SPAN style="FONT-SIZE: 10pt ; COLOR: black; FONT-FAMILY: 'Courier New'"> <o:p></o:p></SPAN></TT></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><TT><SPAN style="FONT-SIZE: 10pt ; COLOR: black; FONT-FAMILY: 'Courier New'">Regarding the second comment I think you are right. I confused you but what I want to say that we use business delegate pattern to avoid direct invocation from the client.<o:p></o:p></SPAN>< /TT></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><TT><SPAN style="FONT-SIZE: 10pt ; COLOR: black; FONT-FAMILY: 'Courier New'">So instantiating the pattern in client is not recommended.<o:p></o:p></SPAN></TT></P> <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><TT><SPAN style="FONT-SIZE: 10pt ; COLOR: black; FONT-FAMILY: 'Courier New'">But I didn�t mean to use business delegate with the business object. since the business object (as you see from the data access object (DAO)) is the data client. It is the object that requires access to the data source to obtain and store data. (some of my words from the book too). <o:p></o:p></SPAN></TT></P> <P><BR><BR></P><BR><BR><BR> <DIV>Ashraf Galal <BR>(416)804-8359</DIV>>From: Chad Woolley <LISTS @(protected)>>Reply-To: An interest list for Sun Java Center J2EE Pattern Catalog <J2EEPATTERNS-INTEREST@(protected)>>To: J2EEPATTERNS -INTEREST@(protected) >Subject: Re: What is a "Data Object"? >Date: Fri, 2 Jan 2004 04:15:19 -0700 > >Ashraf, > >First, please ignore my previous message where I said you only >posted the UML >diagram. Your text came across as an attachment and I couldn't read >it in my >digest (which is in some unreadable mime format) or on sun's site. >Plus, there > ;may be duplicates, because when I tried to post from the web form, >the page hung >but the post still went through. That must have been what happened > ;to you too. > This isn't a very impressive site for sun, they should just do it >like Apache's. > >Anyway, thanks for your response. I've got some comments and >questions, which I >included inline below. & gt; >ashraf galal wrote: > >>Chad; >> >>It is the implementation of the business object pattern. >> >>Term: Business Object: >> >>An object that implements business logic and/or business data. >> >>Business data and business logic are implemented in coarse-grained >>objects called business objects. >> >>In J2EE, business objects are implemented as session or entity >> ;beans. >> >>In some cases, a business object could be an arbitrary java object >>that provides some services. >>See attached document for class and sequence diagrams >> >>I do think that these diagrams must answer most of your questions. >> >>We might implement the business object using the composite entity >>pattern (you are right) or DAO or other different implementation. > >This code example is in the "Business Object" chapter, and the UML >diagram you >attached is from the chapter. I would think they would call it >"Business > ;Object" in the code sample if it is an occurence of that pattern. >In other >places in the book, if a pattern uses itself "recursively", it uses >the same name. > >Maybe that is the case, though. Maybe it is just a "simple" >business object >that doesn't have much logic in it. It still doesn't make sense to >call it >something different, though. > > >> ;Regarding your question �Can the Presentation Tier directly >>instantiate and use "Data Objects"? ? >> >>We always use the business delegate pattern to decouple the tier >>and hide the implementation details. It is better not to use it >>directly from client tier (my opinion). > > ;Now you lost me. How is this related to the Business Delegate >pattern? if it >was used on the client, it would probably be passed through a > ;Business Delegate, >but that doesn't tell me anythin g more about what a "Data Object" is >or how it >is used. > > ;Thanks for your response! > >Chad > >============================== ====================================== >Companion Site: http://www .corej2eepatterns.com >J2EE BluePrints: http://java.sun.com/blueprints /corej2eepatterns >List Archive: >http://archives.java.sun.com/archives /j2eepatterns-interest.html >Unsubscribing: email "signoff J2EEPATTERNS -INTEREST" to >listserv@(protected) </div><br clear=all><hr>Tired of spam? Get <a href="http://g.msn.com/8HMAENCA/2734??PS=">advanced junk mail protection</a> with MSN 8.</html> ==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
|
|
 |