Transfer Objects in Value List Handler

Do we need really the EJB for Caching the data using Value List Handler.If EJB is not required then how can we cache the data using Value List Handler

Sorry for disturbing u again.Actually my requirments
is , In the Jsp page i have to display 1000You are referring to java server pages and not java script correct?
records(example) provided with pagination option ie
each page should display 50 records and options will
be given to user to see another 50 records by
clicking the pagination hyper link.This time it
should pick up from Cache memory not form DB.I came
to know thru documentation posted in website that
ValueList Handler provides the Caching Facility.Can i
achieve this by using ValueList Handler.You can achieve it in any number of ways.
Nothing in your description suggests that Value List Handler is going to help you in any substantial way.
Another
restrictions is not to use EJB.You have to get the data from somewhere.

Similar Messages

  • Want detailed sample code(value list handler pattern) for my case

    I am trying to write a Session Facade Bean with getAllUsers() method which get Collection pased from my UserBean(entity), to get all my users info.and I have a helper class called UserInfo
    public class UserInfo implements java.io.Serializable
    public String userid;
    public String username;
    public String password;
         public UserInfo()
         public void setUserInfo(String userid,String username,String password)
              this.userid=userid;
              this.username=username;
              this.password=password;
    I dont' know How my ejb client(jsp maybe) to use value list handler pattern to implement getting all users shown.
    I found http://java.sun.com/blueprints/corej2eepatterns/Patterns/ValueListHandler.html the sample code is to complex.
    any one could help me figure out ...
    what helper class do i need .or maybe interface
    what is the best practice?
    thanks in advanced.

    Hi,
    For a J2EE system with session facades, I've implemented that pattern based on the DTO pattern.
    The idea is based on Sun's blueprint Pet Store implementation.
    For that' I've created a DTO called "ListChunk", which holds a chunk of the complete list. In the Pet Store
    application v1.3.2 it's called "Page".
    So, those facade methods that would possibly return a huge list (such as getAllXXX and findXXX)
    return a ListChunk. As arguments, those methods take start index and the maximum size.
    If you want a value-list handler to control the iteration on your client side, you code such a class that
    uses the facade method.
    Here's some code:
    public class ListChunk implements Serializable {
         private List list;
         private int startIndex;     // starts on '0'
         private int totalSize;
         public ListChunk(List list, int startIndex, int totalSize)  {
              this.list = list;
              this.startIndex = startIndex;
              this.totalSize = totalSize;
         public List getList()  {
              return list;
         public int size()  {
              return list.size();
         public boolean hasNext()  {
              return totalSize > (startIndex + list.size());
         public boolean hasPrevious()  {
              return startIndex > 0;
         public int getTotalSize()  {
              return totalSize;
    }And a method in the facade could look like this:
         public ListChunk getAllCoWorkers(int startIndex, int maxSize, CoWorkerSortBy sortBy) {...}

  • Value-list handler, value-list iterator and session-facade strategy

    Hello all,
    Further to an earlier post, I rewrote my post trying to me more accurate in my question.
    Here is my problem:
    I am trying to implement the value-list handler design pattern using the session facade strategy. In the pattern as it is described here
    (http://java.sun.com/blueprints/corej2eepatterns/Patterns/ValueListHandler.html) the client accesses the value-list handler AND the iterator directly.
    As I chose the session-facade strategy having my value-list handler as a stateful session ejb, I don't know how the client is going to access the iterator. I see only one option: Having the client access the iterator through the ejb value-list handler. This requires adding new methods to the ejb.
    Is this the correct way of doing it? Is there another way of doing this?
    Thanks in advance,
    Julien Martin.

    u can use project list handler as ur session facade.
    regarding ur second question ..session facade and value list handler session bean which is also a session facade( but there is difference between first and second) so u can use session facade and value listhandler

  • Caching using - Value List Handler

    Hi All,
    Iam new to Value List Framework.I had a doubt regarding the caching in Value List Handler.Suppose there are 1000 records in DB.I querying the DB using Value List Handler.I want to display the paging functionality in JSP.That is i want to display 50 recodrs each in the jsp.Then if have to provide the Link for another set of records.I had donr this functinality.What is the problem is if i click the hyperlink which is provided for PAgination Functionality now it is hiting the DB and fetching the recodrs and iam showing in JSP.I don't know how to do the Caching functionality using Value List Handler.so that i can avoid each time DB hit.First time i will hit the DB fetch all the records and store it in the Cache.Can anyone help me regarding this issue.

    hi [email protected]
    can you plz provide me some stuff for pagination using toplink. I am new to toplink and need to use pagination.

  • Connecting To Same Value List Handler

    I have a question about using the Value List Handler pattern. Right now I am just working on the design of my application (class diagrams, scenario diagrams, etc).
    I have a VLH that will retrieve data from the DB (via a DAO) and will return data to the caller. The VLH basically fronts the DAO. The caller in this case will be a Business Delegate. So the call sequence is:
    client (JSP) --> Business Delegate --> Value List Handler --> DAO
    Now the VLH is a stateless EJB. But the Business Delegate is just a plain Java class that will get instantiated on every call to the server. My hope is that it will connect to the same VLH instance (I use a ServiceLocator). But I'm not sure this will happen.
    According to what I read about Stateless Session EJBs, they are dedicated to a single client. But what is the "client" in my scenario? Is it the browser session? Or is it the Business Delegate? If its the latter, then will new instances of the Business Delegate be able to connect to the same VLH?

    Use a stateful session bean! Says so on the Sun Blueprints site for this pattern.

  • Value List- EHP4

    Hi,
    We are working on PMR-ehp4. We have some ratings for the appraisals EX: 1- 5 Scale but when we see the same scales on portal as a standard SAP EHP4 fucntionality the blank fields against the ratings are showing "No value" Text on the portal.
    Could any one please share your inputs how to bring the "blank field" instead of "No Value" text.
    Thanks in advance
    VK

    u can use project list handler as ur session facade.
    regarding ur second question ..session facade and value list handler session bean which is also a session facade( but there is difference between first and second) so u can use session facade and value listhandler

  • Default values of columns not transferred in SSIS Transfer Objects Task

    I am working on a project that is creating a new application, my area of the project being the migration of data from the old application database, transforming it, and populating the new database.
    The transformations to the old data are done in a staging database.
    At the end of the process, the staging database ends up with a lot of new applications tables, populated with the migrated legacy data.
    We need to move these tables from the staging database to (initially) our test databases, but ultimately what will be the live database.
    We have tried using the "Transfer SQL Server Objects Task" in SSIS, but have ran into a problem that a lot of the database tables have default values for columns.
    These default values are not brought over.
    Example. Tables contain a "GUID" field, which has a default of value of newid()
    Right clicking and the table generating the CREATE script generates 
    [GUID] [uniqueidentifier] ROWGUIDCOL NOT NULL CONSTRAINT [DF_tbCRM_Client_GUID] DEFAULT (newid()),
    However, the Transfer objects task does not create this default of newid()
    Examining the SQL generated by the Import / Export Wizard when investigating this shows that the wizard generates this column as
    [GUID] uniqueidentifier NOT NULL
    and the column default value is lost.
    Is there something i should be setting somewhere to force SSIS to bring these column definitions over correctly?

     Kaarthik Sivashanmugam wrote:
    This behavior is by design to maintain backward compatibility with the Copy SQL Server Objects task in SQL Server 2000. Only two constraints (Primary key and foreign key constraints) are expected to be copied by Transfer Objects task.
    thank you for you response Sivashanmugam.
    How can I move these tables (of which there are over a hundred) from my staging database into the application database - and keep the table definitions correct?
    I cannot use the transfer objects task, as this will not define the tables correctly.
    I cannot use the import and export wizard, as this will also not define the tables correctly.
    This means I will manually have to code the drop, create and inserts for over a hundred tables?

  • Transfer Object (Value Object)

    Hi Friends
    I am want to Use TO in Swing. But i do not know how to.
    If You have any knowledge about To in Swings please provide me.
    Thanks
    ---SunnyJain

    well that is not what i wanted ..
    They have some thing link this usage in J2EE.
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html
    I want to make swing client Table to use a Transfer Object to send data and receive data.

  • How to combine Session Facade and Transfer object?

    Hello All!
    I'm working on an enterprise application. Presentation layer is a stand alone client, business logic is build on the Glassfish v2.1 and MySQL is used as a database. The client is connection to the GlassFishj server remotely using EJBs.
    I have problems with business logic architecture.
    Here is the brief description of backend application architecture design:
    1. Session Facade pattern is used to simplify the client and application server interface and to provide application layers between backend (http://java.sun.com/blueprints/corej2eepatterns/Patterns/SessionFacade.html).
    2.Transfer Object pattern to define update transfer objects strategy in order to decrease network overhead during client and application server interactions and to provide version control for objects. Transfer objects are designed as simple java business serializable objects. (http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html)
    3. Originally the backend application consisted of three modules: users, storage and orders, but at the end I have decided to divide my application into the following parts - assortments, map, menu, orders, transactions, users.
    4. All MySQL database transactions are via JDBC using procedures. No use of entity beans.
    Questions:
    1. I have some doubts about using Session Facade and Transfer object patterns at the same time. At first I'd mike to cite the definitions of the patters from the SUN official web site.
    * Use a session bean as a facade to encapsulate the complexity of interactions between the business objects participating in a workflow. The Session Facade manages the business objects, and provides a uniform coarse-grained service access layer to clients.
    * Use a Transfer Object to encapsulate the business data. A single method call is used to send and retrieve the Transfer Object. When the client requests the enterprise bean for the business data, the enterprise bean can construct the Transfer Object, populate it with its attribute values, and pass it by value to the client.
    * So, if I use Transfer Object along with Session Facade, it makes some difficulties with object version control, because I 2 or
    3 transfer objects controls with the 1 bean class. The best option for Transfer object Pattern is that each transfer object should have its own bean class to provide ability of object's version control. In the case it can bring the network overhead because of frequent remote calls caused by the large number of the bean classes.
    * So, should I use the both patterns? If yes, how to manage the interaction the patterns. If no, which one to use.
    2. E.g. I have a huge list of the Order objects and each Order object consists of other complicated objects. So, would I have trouble to transfer that list over network? If yes, how to manage it.
    Thank you!
    Astghik

    Astghik wrote:
    Hello All!
    I'm working on an enterprise application. Presentation layer is a stand alone client, business logic is build on the Glassfish v2.1 and MySQL is used as a database. The client is connection to the GlassFishj server remotely using EJBs.
    I have problems with business logic architecture.
    Here is the brief description of backend application architecture design:
    1. Session Facade pattern is used to simplify the client and application server interface and to provide application layers between backend (http://java.sun.com/blueprints/corej2eepatterns/Patterns/SessionFacade.html).
    I would simply recommend establishing a service tier. Your services should be stateless. You can go the extra mile and have a session facade, but in the majority of cases, coding to an interface for your service accomplishes the same goals.
    2.Transfer Object pattern to define update transfer objects strategy in order to decrease network overhead during client and application server interactions and to provide version control for objects. Transfer objects are designed as simple java business serializable objects. (http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html)
    The idea of the transfer object is very similar to the Command pattern. I think if you investigate that pattern, it will be more obvious. The transfer object reduces network latency by consolidating all the parameters into an object, ideally, this also consolidates multiple method calls. If you combine a transfer object (or command object) with a service tier, you get the best of both worlds. The service can delegate calls to helper objects (or other services or components) using the data in the transfer / command object.
    3. Originally the backend application consisted of three modules: users, storage and orders, but at the end I have decided to divide my application into the following parts - assortments, map, menu, orders, transactions, users.
    The is your domain. It will vary from application to application. The principles above are more general (e.g., patterns and architectural tiers) and should apply to most domains. However, your actual use case may require something different.
    4. All MySQL database transactions are via JDBC using procedures. No use of entity beans.
    Consider using something like iBatis or Spring's JDBC templating to make your life easier with JDBC.
    Questions:
    1. I have some doubts about using Session Facade and Transfer object patterns at the same time. At first I'd mike to cite the definitions of the patters from the SUN official web site.
    * Use a session bean as a facade to encapsulate the complexity of interactions between the business objects participating in a workflow. The Session Facade manages the business objects, and provides a uniform coarse-grained service access layer to clients.
    * Use a Transfer Object to encapsulate the business data. A single method call is used to send and retrieve the Transfer Object. When the client requests the enterprise bean for the business data, the enterprise bean can construct the Transfer Object, populate it with its attribute values, and pass it by value to the client.
    * So, if I use Transfer Object along with Session Facade, it makes some difficulties with object version control, because I 2 or
    3 transfer objects controls with the 1 bean class. The best option for Transfer object Pattern is that each transfer object should have its own bean class to provide ability of object's version control. In the case it can bring the network overhead because of frequent remote calls caused by the large number of the bean classes.
    * So, should I use the both patterns? If yes, how to manage the interaction the patterns. If no, which one to use.
    Versioning is a separate issue. Generally, the more coarsely grained your transfer / command object is, the more changes are likely to impact dependent objects.
    Your command or transfer object does not have to be a vanilla JavaBean, where you are basically creating a bean that has data from other objects. You can simply use your command / transfer object to encapsulate already existing domain objects. I see no need to map to a JavaBean with what you have described.
    Generally, a method signature should be understandable. This means that many times it is better to pass the method, say, two coarsely grained objects than a signature with a dozen primitives. There are no hard and fast rules here. If you find a method signature getting large, consider a transfer / command object. If you want one service to delegate calls to a number of other services, you can also create a transfer / command object to furnish the controlling service with the data it needs to invoke the dependent services.
    2. E.g. I have a huge list of the Order objects and each Order object consists of other complicated objects. So, would I have trouble to transfer that list over network? If yes, how to manage it.
    This is a large, open-ended question. If you are going to display it to a user on a screen, I do not see how you avoid a network transfer with the data. The general answer is to not pass the data itself but rather a token (such as a primary key, or a primary key and a start and stop range such as you see on a Google search result). You do want to limit the data over the network, but this comes at a cost. Usually, the database will receive additional load. Once that becomes unacceptable, you might start putting things into session. Then you worry about memory concerns, etc. There is no silver bullet to the problem. It depends on what issues you are trying to address and what trade-offs are acceptable in your environment.
    Thank you!
    AstghikBest of luck.
    - Saish

  • Hierarchical data transfer objects confusing Flex compiler...

    I just posted this same query on FlexCoders... but then I
    thought this might be a better target group to ask, so here goes:
    We are working on a set of data transfer objects where we
    have matching server-side java classes and client-side AS classes.
    Some of these DTO contain lists of other DTOs. As an example:
    A.java:
    public class A {
    List<B> blist
    In A.as we have...
    class A {
    public var blist : ArrayCollection;
    And we have B.java and B.as
    Then we have a RemoteObject call to pull down a bunch of A
    objects....
    Here's the problem, Flex does not compile B.as at build-time.
    So if B.as has a compiler problem, you never know about it,
    except that the 'blist' in A never gets populated. If you break
    down the data transfer and debug it. You find that during
    RemoteObject call, the blist data comes "down the wire", but as an
    ArrayCollection generic Objects, they never get turned into
    instances of Bs...
    I am guessing that this is happening because at compile time,
    there is not direct reference to B in the clientside project. Our
    covering .mxml wants one or more A objects, and inside A the blist
    is an ArrayCollection. So the compiler doesn't see a reference to
    B..
    So anyone know how we can fairly seamlessly make sure B.as
    gets compiled at build time so we'd know of compiler issues with it
    rather than spending lots of time debugging mysterious null values?
    (This appears to happen whether the project is set to compile
    on the client-side or the server-side. We are using Flex and FDS
    2.0.1 and Java 1.5)

    up...

  • Questions on scripts, tables & transfer objects between clients.

    1. In script, how to use the same print program for two different layouts? with procedure.!
    2. Why cant sapscripts be client independent.?
    3. Want to maintain a table in dev server and if i update the data, it should simultanously update in Quality and Production servers. How? please explain in details.
    4. How to transfer object between clients.? explain.
    Points will be promptly rewarded for HELPFULL answers.!

    Hi!
    3. With SE01, you can create a transport request for all table entries.
    SE01 - Create button - Workbench request - Give description and save
    Select the created request and click on Display object list.
    Click on Display - Change button
    Insert line button
    ProgID: R3TR
    Object: TABU
    Object name: Z_YOUR_TABLE
    Double click on the table name
    Insert line
    Key: *
    Save everything
    Release the transport in SE10 transaction and transport with STMS transaction.
    Regards
    Tamá

  • Transfer Object in JSF, Spring, and Hibernate

    The application on which I am working deploys the JavaServer Faces, Spring and Hibernate frameworks.
    We are going to use the "transfer object" to move data between J2EE tiers from the front end to the back end and vice versa. In addition, data "types" may need to be converted --
    At the front end, the "type" of the data that are entered by users may not match that in the database table. For example, checkboxes may be marked or left blank by users. The "type" of the checkboxes is "boolean" in the JSF backing bean. However, we have either "Y" or "N" for the corresponding field in the database table.
    The JSF backing bean holds data as well as controller functionality. Of course, the transfer object holds data only.
    With regard to class properties, Is the transfer object an exact copy of the JSF backing bean? And at which tier the data are converted to match their correspoding "types" in the database tables?
    We also have the "data objects" which are exact representation of database tables.
    Thanks for your advices.

    Small example: you can decide in the business layer
    whether to convert it to boolean or Boolean (which
    has a 3rd state: null).But it all goes back to your data model. If your data model supports null for that property, then of course boolean is a poor choice. If that case one could use Boolean. None of this has anything to do with re-usability, which was your objection.
    I think the re-usability question goes back to the data model as well. Suppose your data model says this property is boolean valued. However if your database does not support booleans natively, then you need to map the value for storage in the database. But that is the data persistence layers problem.
    OTOH, suppose your data model says that this property may be 'Y' or 'N'. Then the Java class represent the business object should not have a boolean property, we should make it match the data model.
    However, I think that most cases where people are storing 'Y' or 'N' in a field in the database fall into the first case, where the data model is a boolean and they are working around limitations in the database. There is no reason in that case to perpetuate the same limitations in the Java code.

  • Transfer Objects in EJB 3.0

    Hello,
    I am building Enterprise application with EJB 3.0 and JSF. In many J2EE books there's that Trasfer Object pattern ( sometimes called Value Object or so), I just wonder what are your experiences in using TO in Java EE ( EJB 3.0).
    Because entity beans in EJB 3.0 are POJOs I think that there is no need to
    use TO pattern.
    Im my app I receive entity from session bean and bind that entity to JSF components. This is the easisest solution for me because I don't build boring
    transfer object, and don't have to wory about transformation between TO and Entity beans. Am I doing right or I am maybe missing something??
    By reading EJB 3.0 spec. when session bean returns entity it becomes
    detached so its just plain java object. ??
    I know that using TO you can reduce coupling between client and EJB but
    you must implement additional level with TO objects and transformations, so
    it looks to me that by using TO you just get more complexity and problems ?
    Tell me what are your thoughts and experiences.
    Regards,
    Niksa Jakovljevic
    FOS

    Hi Niksa,
    Your intuition about EJB 3.0 is correct. One of the advantages of Java Persistence API entities
    is that they can be passed directly to clients without having to convert their data to separate transfer
    objects. The reason this was a common pattern in EJB 2.x and earlier is that CMP 2.x beans are 1st
    class EJB components that are limited in their ability to be used outside of the ejb tier.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Transfer Object Pattern and Concurrency Transaction Mgmt

    I am developing an application that implements a remote rich client. For
    performance reasons I have chosen to use the Transfer Object pattern. I
    have been very successful with this from a performance standpoint, it
    really paid off. I am using it in combination with an assembler pattern
    to construct Transfer Objects for the view and to also reassemble domain
    objects based on changes made to transfer objects on my client side.
    Anyways the only problem I am having with it is I can't seem to figure
    out how I should implement optimistic locking with it. Is there a best
    practices to handle transaction control here?
    I generally try to keep visibility of stale data down, but there are still
    situations where concurrent clients could have requested to edit the same
    the Transfer Object at the same time. I would ideally like to handle this
    using a flavor of optimistic locking. I in fact have implemented
    optimistic locking on the domain side, but now I am not sure how or if I
    should integrate this into the Transfer Object or View side. The version
    field used in optimistic locking is generally a hidden field. The only
    way I can see to handle this with the view side is to expose this field on
    the Domain Objects and actually store it into assembeled transfer objects.
    This seems like it may be a bad idea from a design standpoint.
    The problem is the client requests data and it assembled and delivered to the client. Then at some later time the client may send a request to the server to update this data. At this time a new transaction must be started where the server reloads the domain data and copies over the requested changes. Since the domain data was just loaded you wouldn't ever trigger a versioning problem unless the version was maintained on the transfer object and copied over as well. I am developing this project with hibernate on the back end and unfortunately hibernate doesn't acknowledge manual changes to the version field.
    I just feel like there must be a better way to do this. I believe that using the Transfer Object or DTO pattern for remote client/server architectures is pretty common. So there must be a best practice to deal with concurrency? Suggestions, insight, lay it on me please.
    thx

    I personal respect both concepts and am using both in an application I am currently work.
    Firstly, I have my Transfer Object which I call xxxData.
    Next, the entities are called xxx
    I have my DAO classes that handles all CRUD operation. but within the DAO class I have two methods
    private <EntityClass> retrieveEntityFromObject(<EntityClassData> data) {}
    private <EntityClassData> retrieveEntityFromObject(<EntityClass> entity) {}so with these methods, I separate my business logic from my data layer. My codes will alway use data objects instead of entities. For example, a create method will be
    public ProductData createProduct(ProductData data)
         entity.persist(retrieveEntityFromObject(data));
    }I hope someone understands
    Regards

  • Crystal Reports and values list of BEx variables

    Hello.
    I read this - http://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsandBWquery+elements
    And there are writed in wiki:
    "List of values for SAP variables are created automatically by Crystal Reports only when you use SAP Toolbar to create the report:
    The list of values for a variable in Crystal Reports will be static, but the list will be always dymanic in InfoView as long as you use BW Publisher (save reports to BW, publish to BOE)and you logon to BOE using SAP Authentication."
    I have two link to BEx queries from my CR report - and my variables have not values. I think that I don't use "SAP" menu when created the report.
    But... what I can doing now? Is way transform "simple" report into "SAP" report?
    May be is way create "SAP" report and after it copy all content of old report into new "SAP" report including all objects, formats, formulas, connections?
    May be is way load values list from BEx query with "simple" reports?
    And another question - I see that in list I get texts and codes but showing only texts in run-time. Can I tune CR for show codes too?

    Post to Integration Kit SAP forum

Maybe you are looking for

  • Message-driven bean destination name not found error

    Hi, I am getting this error when I attempt to deploy the Warehouse message-driven bean example/tutorial. I followed the steps in the JMS Queue Simple Sample Application included with the server to set up the queue and queue factory, but I don't think

  • My Album Art is not Appearing

    This has been a problem for me for a very long time. That Everytime i'm transfering music to my ipod touch 4th Gen. I've tried restoring my ipod, uninstalling itunes and reinstalling. Nothing seems to be fixing the problema and it's starting to get a

  • My MacBook get's hot really quick and then discharge's quickly without opening any program, please help.

    My MacBook get's hot really quick and then discharge's quickly without opening any program, please help. I have checked the cooling fan, and it's working, and I took it to an IT technician and he said my hardware is allright, so is it a problem from

  • Possessed Quotation Marks

    I just realized that the quotation marks in my stories are not consistant. Here's the deal: I wrote them on my ancient ibook in Appleworks. Transfered them to my new mac mini, I'm using Pages 08 to edit them. I noticed that the quotes in text I add a

  • Re-download already purchased music

    Can you re-download already purchased music or do I need to buy the songs again?