Best practice ?  send Object to request or desired pieces of data?

Newbie to this style of programming...
Is the best practice to put the customer object in the session or request object and allow jsp's to declare and instantiate the customer object out of the session/request (then use whatever getters are needed to properly display the desired data)?
Or would it be better to send the customer ID, Name, address etc as a string to the session/request object and just have the JSP declare the strings & instantiate from the session/request object(thus keeping more complicated java code out of the jsp)?
Thanks for the help in advance!

Doesn't this result in more code? If we send the object, we need code to declare and instantiate the object, then use the getters to get the data to display.
If I just send the necessary data, I just need to declare a string = request.getParameter... or just display the request.getParameter.
I actually like the concept of sending the object, it seems cleaner and less likely to result in servlet changes down the road, but i want to make sure there is not some other reason NOT to do this.

Similar Messages

  • Best practices when making service requests

    Best practices when making service requests
    We've been working on moving our old services that were built with an different service request tool into RequestCenter and were wondering if anyone had any thoughts about best standards or practices for the new forms that they would be willing to share.  For example, one such standard might be that the customer - initiator information will always be displayed at the top of the request.
    Are there any other standardizations you could share that help lend consistency and provide improved readability for request forms?  Maybe someone has a design framework guide they would be willing to share?
    Thanks!
    Tim

    Thanks for the comments and the book suggestion.
    We've been placing the customer information at the top because wanted the customer to review the information before subbmitng the form.  Our LDAP data is somewhat spotty and we want to make sure we have the right information when the form is submitted but I can see the advantages to placing it at the bottom as well.  I'll have to think that over more.
    Does anyone find tha certain fields work better than others?  For example, we've not had much

  • Best practice - caching objects

    What is the best practice when many transactions requires a persistent
    object that does not change?
    For example, in a ASP model supporting many organizations, organization is
    required for many persistent objects in the model. I would rather look the
    organization object up once and keep it around.
    It is my understanding that once the persistence manager is closed the
    organization can no longer be part of new transactions with other
    persistence managers. Aside from looking it up for every transaction, is
    there a better solution?
    Thanks in advance
    Gary

    problem with using object id fields instead of PC object references in your
    object model is that it makes your object model less useful and intuitive.
    Taking to the extreme (replacing all object references with their IDs) you
    will end up with object like a row in JDBC dataset. Plus if you use PM per
    HTTP request it will not do you any good since organization data won't be in
    PM anyway so it might even be slower (no optimization such as Kodo batch
    loads)
    So we do not do it.
    What you can do:
    1. Do nothing special just use JVM level or distributed cache provided by
    Kodo. You will not need to access database to get your organization data but
    object creation cost in each PM is still there (do not forget this cache we
    are talking about is state cache not PC object cache) - good because
    transparent
    2. Designate a single application wide PM for all your read-only big
    things - lookup screens etc. Use PM per request for the rest. Not
    transparent - affects your application design
    3. If large portion of your system is read-only use is PM pooling. We did it
    pretty successfully. The requirement is to be able to recognize all PCs
    which are updateable and evict/makeTransient those when PM is returned to
    the pool (Kodo has a nice extension in PersistenceManagerImpl for removing
    all managed object of a certain class) so you do not have stale data in your
    PM. You can use Apache Commons Pool to do the pooling and make sure your PM
    is able to shrink. It is transparent and increase performance considerably
    One approach we use
    "Gary" <[email protected]> wrote in message
    news:[email protected]...
    >
    What is the best practice when many transactions requires a persistent
    object that does not change?
    For example, in a ASP model supporting many organizations, organization is
    required for many persistent objects in the model. I would rather look the
    organization object up once and keep it around.
    It is my understanding that once the persistence manager is closed the
    organization can no longer be part of new transactions with other
    persistence managers. Aside from looking it up for every transaction, is
    there a better solution?
    Thanks in advance
    Gary

  • Looking for best practice sending args to classes

    Unfortunately, I'm stuck in a company that only employs MS developers, so I'm kind of stranded with no buddies to mentor my java skills... so thanks in advance for any help, I appreciate it.
    Anyway, I think that I've been doing things the hard way for a while and I'm looking for some sort of best practice to start using. I'm currently working on a GUI that will take all the selections, via combo boxes, text fields, etc., and send them to a class (a web bot, actually) and run it.
    I'm starting to run into the problem of having too many arguments to send to my Bot class. What's a good way that I should be doing this? I figure I can do it a couple of ways, right?
    new Bot(arg1, arg2, ......... argX);
    Bot bot = new Bot();
    bot.setArg1("something");
    bot.setArg2("something");
    etc..
    bot.run();Or, is there a better way? Can I package all the args in a collection somehow?? That way I only have 1 argument to send... I don't know... Thanks for the help.

    Create a class "Data" (for example) that encapsulates all the data you want to pass to the Bot class. Then create an instance of the Data class and set all the relevant fields (i.e. setArg1 etc). Now you pass this Data instance to your Bot class. This way you only have to pass one Object around and you've encapsulated all your data.

  • Best Practice Szenario for HCM request

    Dear collegues, I'm looking for a link to get the best practice scenarios like in logistics and FI for HCM (http://help.sap.com/bp_blv1600/BL_DE/html/index_DE.htm). I need this for a customer from me urgentlly. Can you help me please.
    Guenter Schwarz D002299

    Hi
    There's no 'best practice' as such, but there are a few that I think should be default:
    Enabling CDR, On-Hook Pickup, CFwdAll Override... but really the settings are specific to the requirements of the deployment.
    Aaron

  • Best Practice Table Creation for Multiple Customers, Weekly/Monthly Sales Data in Multiple Fields

    We have an homegrown Access database originally designed in 2000 that now has an SQL back-end.  The database has not yet been converted to a higher format such as Access 2007 since at least 2 users are still on Access 2003.  It is fine if suggestions
    will only work with Access 2007 or higher.
    I'm trying to determine if our database is the best place to do this or if we should look at another solution.  We have thousands of products each with a single identifier.  There are customers who provide us regular sales reporting for what was
    sold in a given time period -- weekly, monthly, quarterly, yearly time periods being most important.  This reporting may or may not include all of our product identifiers.  The reporting is typically based on calendar-defined timing although we have
    some customers who have their own calendars which may not align to a calendar month or calendar year so recording the time period can be helpful.
    Each customer's sales report can contain anything from 1,000-20,000 rows of products for each report.  Each customer report is different and they typically have between 4-30 columns of data for each product; headers are consistently named.  The
    product identifiers included may vary by customer and even within each report for a customer; the data in the product identifier row changes each week.  Headers include a wide variety of data such as overall on hand, overall on order, unsellable on hand,
    returns, on hand information for each location or customer grouping, sell-through units information for each location or customer grouping for that given time period, sell-through dollars information for each location or customer grouping for that given time
    period,  sell-through units information for each location or customer grouping for a cumulative time period (same thing for dollars), warehouse on hands, warehouse on orders, the customer's unique categorization of our product in their system, the customer's
    current status code for that product, and so on.
    Currently all of this data is stored in a multitude of Excel spreadsheets (by customer, division and time period).  Due to overall volume of information and number of Excel sheets, cross-referencing can take considerable time.  Is it possible to
    set-up tables for our largest customers so I can create queries and pivot tables to more quickly look at sales-related information by category, by specific product(s), by partner, by specific products or categories across partners, by specific products or
    categories across specific weeks/months/years, etc.  We do have a separate product table so only the product identifier or a junction table may be needed to pull in additional information from the product table with queries.  We do need to maintain
    the sales reporting information indefinitely.
    I welcome any suggestions, best practice or resources (books, web, etc).
    Many thanks!

    Currently all of this data is stored in a multitude of Excel spreadsheets (by customer, division and time period).  Due to overall volume of information and number of Excel sheets, cross-referencing can take considerable time.  Is it possible to
    set-up tables .....
    I assume you want to migrate to SQL Server.
    Your best course of action is to hire a professional database designer for a short period like a month.
    Once you have the database, you need to hire a professional DBA to move your current data from Access & Excel into the new SQL Server database.
    Finally you have to hire an SSRS professional to design reports for your company.
    It is also beneficial if the above professionals train your staff while building the new RDBMS.
    Certain senior SQL Server professionals may be able to do all 3 functions in one person: db design, database administration/ETL & business intelligence development (reports).
    Kalman Toth Database & OLAP Architect
    SELECT Video Tutorials 4 Hours
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Best practice for storing/loading medium to large amounts of data

    I just have a quick question regarding the best medium to store a certain amount of data. Currently in my application I have a Dictionary<char,int> that I've created, that I subsequently populate with hard-coded static values.
    There are about 30 items in this Dictionary, so this isn't presented as much of a problem, even though it does make the code slightly more difficult to read, although I will be adding more data structures in the future with a similar number of items.
    I'm not sure whether it's best practice to hard-code these values in, so my question is, is there a better way to store this information, retrieve and load it at run-time?

    You could use one of the following methods:
    Use the application.config file. Upside is that it is easy to maintain. Downside is a user could edit it manually as its just an xml file.
    You could use a settings file. You can specify where the setting file is persisted including under the user's profile or the application. You could serialize/deserialize your settings to a section in the settings. See
    this MSDN help section
    on details abut the settings.
    Create a .txt, .json, or .xml file (depending on the format you will be deserializing your data) in your project and have it be copied to the output path with each build. The upside is that you could push out new versions in the future of the file without
    having to re-compile your application. Downside is that it could be altered if the user has O/S permissions to that directory.
    If you really do not want anyone to access it and are thinking of pushing out a new application version every time something changes you could create a .txt, .json, .xml file (depending on the format you will be deserializing your data) just like the previous
    step but this time mark it as an embedded resource in your project (you can do this in the properties of the  file in visual studio). It will essentially get compiled in your application. Content retrieval is outlined in
    this how to from Microsoft and then you just deserialize the retrieved content the same as the previous step.
    As far as formats of your data. I recommend you use either XML or JSON or a text file if its just a flat list of items (ie. list of strings). Personally I find JSON much easier to read compared to XML and change and there are plenty of supported serializers
    out there. XML is great too if you need to be strict as to what the schema is.
    Mark as answer or vote as helpful if you find it useful | Igor

  • TopLink - Best Practice Question - Object Validation

    We are fairly new to TopLink and have a question about doing object validation. We would like perform some validation on our objects that are about to be persisted to the DB. Since TopLink will persist all objects that are reachable from the ojects that are registered (I think) we would like to send a message to each of these objects (validate) before they are persisted. If the object validation fails, we will throw an exception (and the objects will not be persisted), hopefully such that the exception can be received by the client. Has anybody done anything similar to this before, or is there a better way of approaching this?
    TIA for any help.

    Are you using EJBs?
    If so, there are a couple of options that may work better for you.
    1. You could use the ejbStore method for your validation and throw the exception in there. You should be able to get the exception on the client side, but it may be wrapped in several layers.
    2. For more complex validation, you may want to use a session bean to control the validation process. It can interact with your entity beans and provide feedback about why validation fails.

  • Best practices - parameter objects

    I'm programming Java EE, Hibernate, Spring... I know you shouldn't use parameter objects to try to bring down the number of in-parameters to a method. (I try to stay below 4.) You should always try to create a real object with non-trivial methods. But that object can't be a Spring Bean. All our Spring Beans are singletons. I tried to declare <id="somename" singleton=false> in ApplicationContext.xml but got a bunch of errors when initializing the Spring context. It reacted on the word sigleton. It didn't recognize it. It seems I can't declare a bean as a prototype and maybe I shouldn't. So my in-parameter should be a real object but not a bean unless I can use it as the singleton it is.
    Or is it OK to use parameter objects?

    853368 wrote:
    The declaration:
    <bean id="ruleService" class="com........ .......RuleServiceImpl" singleton="false">
    Results in:
    2011-09-19 14:28:47,743 ERROR [org.springframework.web.context.ContextLoader] - <Context initialization failed>
    org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 125 in XML document from ServletContext resource [WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'singleton' is not allowed to appear in element 'bean'.
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
    at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
    at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
    at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
    at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
    at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
    at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java:115)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
    at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)Try scope="singleton" (more information [url http://forum.springsource.org/showthread.php?30209-Attribute-singleton-is-not-allowed-to-appear-in-element-bean-.]here). Post your namespace declarations in the spring bean configuration if what i suggested doesn't work.

  • Best Practice to process change request

    Hi All,
    There's a confusion of provided functionality by SAP for Change Request Management. Though, through different blogs/articles/book, we have implemented change request management, but initiation process of change request seems missing.
    What I know is project can be tracked through maintenance cycle, if support message is posted through SAP production server through SAP->Help->Create Support Message. What I'm looking for is user should be able to select few parameters of particular forms from forms' repository, available online. Once its filled, it goes to his manager according to Organogram, then a support message gets created automatically, and rest of the process remains same as provided at current by SAP.
    What you guys know of it?
    Thanks
    Nayab

    Thanks Sammi for your confirmatory post.
    So if we need to use required fields for particular configuration from user, say the requirement to develop new company code, of which all required information is maintained in form, the user should submit the filled form, authorized by his manager, to IT department, we then ask the particular user to raise support message and keep a track of such maintenance activity.
    Is it possible to modify Create Support Message screen, that is, another parameter to upload file, as we can do in solution manager service desk mesage -> documents. This might help as well, but I guess SAP must be providing a tool, may be some different product for aforementioned requirement.
    Regards,
    Nayab

  • Best Practices - reports

    I am looking for advice on best practices for reporting. Test runs generate alot of data and I am not always sure what the best things to report on are.
    In particular I am comparing a number of different code releases over the last few weeks, is page response time the only thing, or most important thing to report on?

    Sorry for the not very detailed reply. You were on the right track though.
    The page response times are an important metric as they, along with error rates, indicated the end user experience. Therefore, I would recommend that any comparison of test runs begin with an analysis of the average response times under load and the transaction failure rate under load. Using e-Load, you could build these graphs as response times/transactions failed and virtual users on a time axis, or use Users as the scale.
    But, in my experience the end user experience is only the beginning of the story, with the impact on the underlying infrastructure telling the other side. As you have already worked out, if the response times at a given level of users are the same the first instinct is to say the new code is as successful. But the CPUs of the application servers might now be at 80% utilization where before they were 50%. So while the end user would see no difference your overall capacity will have dropped. The same could go for other metrics like bandwidth if more or larger images were added to the application, etc.
    System level metrics then like KB/sec, hits per second and pages per second should also be included in the comparison. And these are already available in e-Load. Serverstats can collect the rest of the data for you in most cases.
    At minimum, I would look at CPU on the Web Servers. CPU, memory, requests per second and requests queued on the application servers. And CPU, connections and disk usage on databases. This will be a good start .
    CMason
    Senior Consultant - eLoadExpert
    Empirix

  • Best Practice Attaching USB drive to VM

    Since USB passthru is no longer supported in OVM, what is the best practice and or recommendation for loading large amounts of data to a VM from an external USB drive? 

    thxceej, welcome to the discussion area!
    Suggest that you connect the drive directly to your MBP, then open
    Applications > Utilities > Disk Utility.
    Click to select your drive on the left and then click Repair Disk at the lower right of the window and let the process run. It may take 30-60 minutes depending on how much data you have on the disk.
    When the disk has been repaired, power down the complete network...all devices. Connect the drive back to the USB port on the Time Capsule. Then start the modem first, then your router,then devices one at a time until everything is powered back up.
    See if that helps.

  • Best practice followed on CONTRACT

    Hello All
    What are the best practice needs to be followed on changing the material data information ,
    Step 1. created a contract for Material and PO released agains contract. later some times.
    Step 2:- material master changes some important piece of data like order Unit/ Deletion or material group changes on MATERIAL.
    step 3:- We do the same for the  materials in the contract and deactivate the w.r.t line and create a new line item so that my new line item picks up from material master.
    What are the other incidents material master team may do on material master so that i can inform the contract team to do the same.
    What are the actions material master team may do on MATERIAL and which is relavant for contract data.so that i can alert CONTRACT and MATERIAL master team. so that communication will be seemless.so that every thing perfect and sync.
    Muthu

    Please check these answered links:
    Contract best practices
    good practices in SAP Value Contract
    Best Practice while creating Contract, Purchase Requisition, Purchase Order
    Best Practice unit of measurement usage in CONTRACT.

  • Best practice on publishing content

    Hi all,
    I would like to know what your best practices are in an easy publisching process for unstructed data for a intranet enviroment. Standaard i have to do several steps like create document, create iview to document, include iview on rol or workset.
    Best to my idea would be to create a folder in KM with sub folders and HTML files in there. Then some fancy tool that generated automaticaly a workset with menu structure based of the folder structure and includes the html files in pages.
    Is a kind of tool out there or do you have easy ways with current tools.

    Hi Pim,
    I would suggest you look at "Collaboration Rooms" as
    an option for deploying structured "unstructured"
    content (if that makes sense). This may be a good
    option for some of your scenarios.
    It may even make sense to define your own Collaboration
    Room Templates to match your use cases. This feature
    automates creation of persistence areas (CM Stores),
    as well as the instances of the worksets and iViews.
    New support for Room Parts and extensions really reduces
    the overhead in creating special areas in which to
    deploy content and collaborate.
    Regards,
    Darin

  • Best practice: Retrieving data using DI server

    Hello experts,
    We are going to build a web shop using DI server. We are not going to use B1WS, because it is not supported and it seems like a lot of people can't get it to work (and so can't we).
    DI Server supports some Data Retrieve Messages, but most of them have a very restricted use. GetItemList for example only returns the item codes and item names. I can't limit the amount of returned values and I can't add columns to the results (if I'm mistaken about this, please tell me so!)
    What are best practices for this?
    Do I use the ExecuteSQL Data Retrieve Message in those cases (like 90-95% of the time) or do I use combinations of Data Retrieve Messages?
    Thanks for your time!
    Vincent

    Hi Vincent,
    What you mentioned are actual problems with current DI API and DI Server. You can't set the amount when using GetItemList both in DI API and DI Server.  The design maybe just consider the common requirements in mid/small size companies. So I think it's better to use ExecuteSQL if you have special requirement.
    Regards,
    MIN Hongjun

Maybe you are looking for

  • How can I set a value of column in SSIS by using Replace

    How can I set a value of a column in SSIS using a Replace in Derive columns. I have here NameCode and I need to Set = 1 Where NameCode like LIKE '____99____' eg. 1006993010... if 5th and 6th characters are 99 Else 0 Hope to hear from someone soon and

  • SAP QUERY copied to z program.

    Hi , There was an standard sap query ,system had generated a program for this ,this program is copied to a Zprogram and some modificationa had been done for the zprogram in_sap4.7_ version.Now they want this z program to be copied to ECC6.0.Here my q

  • Reorganizing  SD/FI  documents  for  credit  management

    Hello , we  are  in  production  already  more  than  year  but  just  now  we  will  transport  the  settings  of  the  credit  managment. As  there  is  many  SD  documents  already  do  you  advise  me  to  execute  any  program  to  reorganize  e

  • Apex emailing functionality

    Hello all, i have trawled the net for info on the apex email functionality, nothing seems to be what i am after i don't think! I would like to be able to set up something that emails a group of select people (which i can specify) every time someone i

  • Query on  Multiple-Row subqueries

    Multiple-row subqueries: -->"They should not be used with the NOT IN operator in the main query if NULL is likely to be part of the result of the subquery " -->"They can be used to retrieve multiple rows from a single table only" But i checked the fo