Misc Basic PL/SQL Application Design/Programming Questions 101 (101.1)

---****** background for all these questions is at bottom of this post:
Question 1:
I read a little on the in and out parameters and that IN is "by reference" and OUT and IN-OUT are by value. To me "by reference" means "pointer" as in C programming. So it seems to me that I could call a function with an IN parameter and NOT put it on the right side of an assignment statement. In other words, I'm calling my function
get_something(IN p_test1 varchar2) return varchar2;
from SP1 which has a variable named V_TEST1.
So.... can I do this? (method A):
get_something(V_TEST1);
or do I have to do this (method B):
V_TEST1 := get_something(V_TEST1);
Also, although this may muddy the thread (we'll see), it seems to me that IN, since its by reference, will always be more efficient. I will have many concurrent users using this program: should this affect my thinking on the above question?
-- ******* background *******
So Far:<< I've read and am reading all over the net, read and reading oracle books from oracle (have a full safari account), reading Feurstein's tome, have read the faq's here.
Situation Bottom Line:<< Have an enormous amount to do in a very little time. Lots riding on this. Any and all pointers will be appreciated. After we get to some undetermined point I can re-do this venture as a pl/sql faq and submit it for posting (y'alls call). Some questions may be hare brained just because I'm freaking out a little bit.
Situation (Long Version):<< Writing a pl/sql backend to MS Reporting Services front end. Just started doing pl/sql about 2 months ago. Took me forever to find out about ref-cursor as the pipe between oracle and all client applications. I have now created a package. I've been programming for 20 years in many languages, but brand new to pl/sql. However, pl/sql sql has freed me from myriad of limitations in MS RS's. My program is starting to get big (for me -- I do a lot in a little) pks is currently 900 lines with 15 functions so far. Currently SP (pls) is back up to 800 lines. I get stuff working in the sp then turn it into a function and move it to the package.
What does application do?:<<<< Back End for MS Reporting Services Web front end. It will be a very controlled "ad-hoc" (or the illusion of ad-hoc) web interface. All sql queries are built at run-time and executed via "open ref cusor for -- sql statement -- end;" data returned via OUT ref_cursor. Goal is to have almost 100% of functionality in a package. Calling SP will be minimalist. Reporting Services calls the SP, passes X number of parameters, and gets the ref_cursor back.
Oracle Version: 10.2 (moving to 11g in the next 3 months).Environment: Huge DW in a massively shared environment. Everything is locked down and requires a formal request. I had to have my authenticated for a couple dbms system packages just to starting simple pl/sql programs.

Brad Bueche wrote:
Question 1:
I read a little on the in and out parameters and that IN is "by reference" and OUT and IN-OUT are by value. To me "by reference" means "pointer" as in C programming. So it seems to me that I could call a function with an IN parameter and NOT put it on the right side of an assignment statement. The IN parameter is not passing by reference. It is passing by value. This means variable/value of the caller used as parameter, is copied to the (pushed) stack of code unit called.
An OUT parameter means that the value is copied from the called unit's stack to the caller (and the current value of the caller's variable is overwritten).
To pass by reference, the NOCOPY clause need to be used. Note that is not an explicit compile instruction. The PL/SQL engine could very well decide to pass by value and not reference instead (depending on the data type used).
Note that the ref cursor data type and the LOB data types are already pointers. In which case these are not passed reference as they are already references.
The NOCOPY clause only make sense for large varchar2 variables (these can be up to 32KB in PL/SQL) and for collection/array data type variables.
As for optimising PL/SQL code - there are a number of approaches (and not just passing by reference). Deterministic functions can be defined. PL/SQL code can be written (as pipelined tables) to run in parallel using the default Oracle Parallel Query feature. PL/SQL can be manually parallelised. Context switches to the SQL engine can be minimised using bulk processing. Etc.
Much of the performance will however come down to 2 basic issues. How well the data structures being processed are designed. How well the code itself is modularised and written.

Similar Messages

  • Running SQL Queries in PeopleSoft Application Designer

    Hi,
    I'd like to find out which peoplesoft tables contain two fields x and y. I have the sql query to do that, but I don't know where I can run that query from in application designer. Its quite possible that it will be done from "Query" window in Application Designer.
    Can someone tell me the steps to do this? I'm very new to PeopleSoft.
    thanks.
    Askar

    1. Open the QUERY tool from the AppDesigner.
    2. File/New
    3. Expand the record
    4. Click on PSRECFIELD
    5. Drag and drop to the right part of the window
    6. At the left window, drag and drop the fields RECNAME from the left (from the record PSRECFIELD) into the tab Field at the right
    7. At the left window, expend the record hierarchy of PSRECFIELD
    8. Expand PSRECDEN Record Definition
    9. Right click on PSRECFIELD Field definition, then "New join"
    10. Choose Standard join
    11. At the right, click on tab Criteria
    12. Drag and drop the FIELDNAME field from the first PSRECFIELD (A)
    13. Double click on Expression 2
    14. In the new window, enter one of the first column name you want to retrieve
    15. Drag and drop the FIELDNAME field from the second PSRECFIELD (C)
    16. Double click on Expression 2
    17. In the new window, enter one of the second column name you want to retrieve
    18. Double click on Logical column at the right until to have "AND"
    19. Click on tab Result
    20. Click on Run query (or File/Run current query)
    21. Enjoy with your results.
    Note, QUERY tool will query the Peoplesoft tables, on the other hands, the Peoplesoft metamodel. If you have built objects directly against the database without having used AppDesigner, you won't be able to retrieve the data.
    Nicolas.

  • Call an ABAP Program from Web Application designer

    Hi Gurus,
    I have an requirement in which I need to fetch an CSV file from the server and place the file into an internal table in R/3.I got the function module and wrote the program for this,but now I need to call this ABAP program from Web Application designer.
    To make it more explicit ,I need to call an ABAP Program /function module from the WAD.I am new to WAD Please help.
    Ankit

    Hi Ankit,
    take a look:
    /thread/725385 [original link is broken]
    WAD and ABAP
    How to call a ABAP or ABAP Class from the WEB
    /people/kai.wachter/blog/2008/03/11/how-to-write-own-items-in-bi-70-java-runtime
    Regards
    Andreas

  • Web application designer basics

    hi experts,
    i am bw learner and want to know few things
    1) how do we publish report developed in web application designer so that we can access it on internet. Is there any webserver offered by sap.
    2) how that report will be authenticated in browser, do we have to create a login page for users or is there any built in one.
    3) Does web application designer comes with Sap GUI (like bex analyzer) or do we have to install separate programme.
    Points will be assigned. thanks

    I would suggest that you search the forums first ...
    1) how do we publish report developed in web application designer so that we can access it on internet. Is there any webserver offered by sap.
    SAp BI comes with a ABAP Web server and a JAVA web server. You can publish the web template / report using these servers ... they can be directly accessed using the URL ( the application has a feature to execute the same in the web ) or the same can be published as a page on Enterprise portal and then accessed from there.
    2) how that report will be authenticated in browser, do we have to create a login page for users or is there any built in one.
    The access for the same will be through the BI login. When you execute the URL , you will be prompted to login by the server and you do not need to create a separate login page for the same. You can also access them through Enterprise portal where the user needs to login to the enterprise portal and then access all systems using a Single Sign On or SSO.
    3) Does web application designer comes with Sap GUI (like bex analyzer) or do we have to install separate programme.
    The front end for Web Application designing is called Web Application designer and it gets installed along with your GUI installation and you can design the templates using the same.
    Note: WAD is getting phased out by Xcelsius as part of the BI BO roadmap but then with extended support you will have WAD supported till about 2016 I guess so nothing to worry right now.

  • Where to see the output of my Application Engine Program ?

    Folks,
    Hello. I am creating my first AE program in Application Designer and test it in the 2-tier mode. I open the AE program in Appication Designer and click Edit ->Run Program. Then open the log file to see its execution and know the AE program is running out. But I don't know where to see the output of the AE program.
    The AE program is only executing a SQL "select" statement. Its output is the ResultSet of the SQL.
    Do any folks know where to see the output of the AE program ?
    Thanks in advanced.

    The AE program is only executing a SQL "select" statement. Its output is the ResultSet of the SQL.
    Do any folks know where to see the output of the AE program ?The output of the select didn't go anywhere. You have to actually do something with the values selected. App Engine selects them and puts them in memory (if you tell it to through %Select), but where those values go depends on you. If you have a DoSelect, then your next action may be an SQL insert/update/delete or even another %Select. If it is another %Select, then I would expect your next action to be Call Section or PeopleCode.
    If you just want to select data and print it to the app engine log file, then I would setup a step with a DoSelect/%Select and then a PeopleCode action. In your PeopleCode action, use MessageBox(0, "", 0, 0, "The value in field MYFIELD is " MYREC_AET.MYFIELD);
    I wrote a blog post a few years ago with additional tips and tricks for AppEngine output: http://jjmpsj.blogspot.com/2008/05/appengine-output-tricks-reporting.html.

  • PeopleTools 8.49 Application Designer cannot log into HRCS 9.0 Database

    Folks,
    Hello. I am working on Human Resources and Campus Solution 9.0 (HRCS 9.0) Portal. The thing is as below:
    I understand HRCS 9.0 requires PeopleTools 8.50 or higher. But I have no choice to use PeopleTools 8.49 for it.
    My PeopleSoft Internet Architecture is PeopleTools 8.49, Weblogic 9.2, Tuxedo 9.0 and MS SQL Server 2005.
    My Operating System is Windows Server 2003 on the top of VM Player 3.
    First time, I installed HRCS 9.0 with PeopleTools 8.49 and set up HRCS 9.0 Database in SQL Server successfully.
    Application Designer log into Database HRCS 9.0 successfully with UserId PS and Password PS.
    Later, the miserable thing happens to me: I delete HRCS 9.0 Database in SQL Server by an accident !
    I set up HRCS 9.0 Database again, but Application Designer cannot log into HRCS 9.0 Database any more.
    I create a new Virtual Machine to install entire PIA and PeopleTools 8.49 with Windows Server 2003 and set up HRCS 9.0 Database, but Application Designer still cannot log into HRCS 9.0 Database.
    My question is:
    How to have PeopleTools 8.49 Application Designer log into HRCS 9.0 Database in SQL Server 2005 as I did it at the first time ?
    Thanks in advance.

    Hi,
    When you look at the readme on Oracle Software Delivery Cloud for PeopleSoft Human Capital Management and Campus Solutions 9.0:
    PeopleSoft Human Capital Management and Campus Solutions 9.0 – Revision 5: This part (number V30469-01) has replaced the PeopleSoft Enterprise Human Resources Management System (HRMS) and Campus Solutions 9.0 media (part number B34591-01), the PeopleSoft Enterprise Human Resources Management System and Campus Solutions 9.0 - Revision 1 media (part number V20635-01) and the PeopleSoft Enterprise Human Resources Management System and Campus Solutions 9.0: Feature Pack – March 2011 media (part number V24852-01). New installations of PeopleSoft Human Capital Management and Campus Solutions 9.0 should use this part. If you have already installed the original HRMS and Campus Solutions 9.0 (part number B34591-01) media, Revision 1 (part number V20635-01) media, or Feature Pack - March 2011 (part number V24852-01) media, you should install the Maintenance Packs or bundles available on My Oracle Support; you should not install this part. The PeopleSoft Human Capital Management and Campus Solutions 9.0 – Revision 5 media includes all maintenance posted through December 27, 2011 (up to PeopleSoft HCM and CS Maintenance Pack 13, PeopleSoft HRMS Bundle #18, PeopleSoft Campus Solutions Bundle #23, PeopleSoft Payroll Tax Update 11-F, and Global Payroll Update 2011-F). If you install this media, you do not need to separately install these maintenance packs or bundles. All installs of HCM and Campus Solutions 9.0 – Revision 5 require PeopleTools 8.52.03 or higher+. Please check the upgrade documentation for the PeopleTools requirements for your specific upgrade path. For additional information on PeopleSoft Feature Packs, please go to My Oracle Support.
    So if you are using the install files from Oracle Software Delivery Cloud for PeopleSoft Human Capital Management and Campus Solutions 9.0, you can only download the revision recut that is running on PeopleTools 8.52.03 and you can not downgrade to PeopleTools 8.49.
    If you have your original installation files (HRMS 9.0 on PeopleTools 8.49), you can use these.
    If you do not have your original installation files, you only option is to contact Oracle
    Regards,
    Hakan

  • TA38622 is there any way to send sms by a connected iPhone to computer ? if so does it need any special application and program ? with witch port ? thank you.

    is there any way to send sms by a connected iPhone to computer ? if so does it need any special application and program ? with witch port ? thank you.

    Hi, Santosh..., and welcome to the Community,
    I would recommend testing the SMS reply forwarding to your mobile number.  Depending upon the results and if this works for you, you could then contact Skype Customer Service to cancel and request a refund.
    In other words, SMS will be received via your mobile number, not via your Skype Number.
    Regards,
    Elaine
    Was your question answered? Please click on the Accept as a Solution link so everyone can quickly find what works! Like a post or want to say, "Thank You" - ?? Click on the Kudos button!
    Trustworthy information: Brian Krebs: 3 Basic Rules for Online Safety and Consumer Reports: Guide to Internet Security Online Safety Tip: Change your passwords often!

  • Web Application Designer need help ASAP

    Hi All,
    I have a requirement to customize the analysis item in a web application designer.
    I have created new templetes and added a analysis with a query view as data provider .
    in the output I require to hide some rows of the query view and also change the color of the text i.e the numbers.
    How to modify the output of the analysis item which is coming from a query view or is there any way where I can modify the output of the web templete.
    Thanking You,
    Rukmini

    Dear Devi,
    If you do not want to use the default display and behavior of the Analysis Web item, you can use the Modification parameter to change them. You can modify the table structure and the table cells.
    The Modification parameter provides modules whose use can be controlled using additional parameters.
    This function enables you to use similar options to those available in earlier releases with the Web Design API for Tables. Unlike the Web Design API for Tables, modifications enable you to make targeted changes to the display and behavior without any programming.
    Prerequisites
    The modules are the main prerequisites for making modifications to the Analysis Web item. The modules are implemented in Java. The SAP Basis infrastructure in SAP NetWeaver 7.0 does not support any customer modifications or extensions to Java coding. Customers are therefore not able to develop their own modules for modifications to the Analysis Web item.
    SAP delivers a number of sample modules. You can use parameters to modify the display and behavior of these modules.
    Procedure
    You use the modules as follows:
           1.      Select a module from the sample modules.
           2.      Specify the module in the Modification parameter of the Analysis Web item.
           3.      Control the display and behavior of the module by specifying the module-specific parameters.
    Result
    The table of the Analysis Web item is displayed in an individual manner using the modules. The behavior of the table may also be different. For example, you can define commands for table cells.
    Example
    For example, you can define a fixed column width or display comments in cells.
    For more info :
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/1a/456a3badc1b315e10000000a114084/frameset.htm
    Hope this helps u..
    Best Regards,
    VVenkat..

  • To use Web Application Designer release 2004s do we need to have portals???

    Hi
    I would like some clarity regarding whther we need a portal or not.
    If you use Web Application Designer (SAP BW 3.x) it works fine, you can create reports and then it shows in SAP Easy Access under favourites. Executes fine, no portal is used.
    Now when I want to use the new Web Application Designer I can not execute the reports. Gives me error
    "Java communication error: RFC destination NOT_CONFIGURED does not exist", the window it appears in has a text saying it can't conect to the portal. Then notes that I look at regarding this seems that the connection between SAP BW and Portal must be set up.
    So can please someone tell me whether you need the portal to use the new Web Application Designer release 2004s
    Thanks in advance

    YOu neeed BI Java configured
    If you do not use any new BEx Web functions, do you have to install the usage types BI Java and EP?
    answer -SAP EP 6.0 Portals could be integrated into a federated portal system landscape using URL iViews.
    For more insights - FAQ
    Pls read carefuly should answer all your current and future questions.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/43008b6a-0901-0010-90af-c848d878bac3?rid=/library/uuid/a5067965-0901-0010-6f8a-bbf0b7424283
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/43008b6a-0901-0010-90af-c848d878bac3?rid=/library/uuid/cea68c65-0901-0010-f5a4-fd34189d8078
    Hope it Helps
    Chetan
    @CP..

  • Web Application Designer: Column width on analysis_item with BW 7.0

    Hi,
    I'm new to SAP world and I have found a problem I'm not able to solve. I'm working with the Web Application Designer and I want to modify the cell properties (such as cell width) for aligning different queries. In fact, my question are:
    <b>
    1. Is it possible to hard-code/specify column widths of the analysis_item?
    2. The property width of the analysis_item doesn't work, does it?
    </b>
    Thanks for your time and efforts.
    Message was edited by:
            Daniel Rubio

    Hi,
    I have just discovered the capability of modifying columns widths with css properties.
    So if I add to the head section of the html:
    div.prueba2 .urSTTDBdr1
    div.prueba2 .urSTTDBdr
    div.prueba2 .urSTTDBdr2
    And later I put the AnalysisItem between a div class="prueba2" and /div, the columns widths are changed.
    Do you know where can I find all the style properties (such as urSTTDBdr1) and its functions?
    Thanks

  • Unable to open WAD (web application designer) in BW 3.5!

    Hi,
    when i open WAD through menu path (start->programs       
    ->Business explorer->Web application designer), i am getting the following error!
    WADConst
    Please log on to a Netweaver BI 7.x system. System J2E does not have the minimum version required 70005.
    I just can`t understand from where i got this BI 7.x system, when my system is BW 3.5 (NW04 platform).
    can any one expalin me what is this problem? and suggest me to over come this problem?
    Thanks,
    Ravi

    Hi Ravi!
    I assume that you installed the SAP GUI 6.40 with BI Addin (which contains the BI Frontend for SAP NetWeaver 2004s BI).
    In this case, you have a sub folder underneath "Business Explorer" in your startmenu named "Business Explorer (SAP BW 3.x)".
    You have to use this version of the BEx Web Application Designer.
    If this is not the case, please create a Support Message with all detailed information (backend and frontend versions).
    Thank you,
       Tobias

  • Need Help With Basics of SQL

    Hey I'm trying to get a working understanding of some of the basics behind SQL, I've composed a few questions that I think may help me with this. Anyone that can help me with any of them will greatly help me thanks.
    1. How to create synonym for tables?
    2. How to describe the structure of tables?
    3. How to list the contents of tables?
    4. How to create a table named with the same structure as another table?
    5. How to copy rows with less than a certain criteria in value (e.g. Price<$5.00) into another table?
    6. How to change the data type to e.g. NUMBER(6)?
    7. How to add a new column named with data type e.g. VARCHAR2(10)?
    8. How to change a specific field within a table (e.g. For ORDER_NUMBER 12489, change the C_NUMBER to 315)?
    9. How to delete a specific row from a table?
    10. How to declare a column as the primary key of a table and call it e.g. PK_something?
    11. How to show certain columns when another column is less than a certain criteria in value (e.g. Price<$5.00)?
    12. How to show certain columns with another column having a certain item class e.g. HW or AP?
    13. How to list certain columns when another column e.g. price is between two values?
    14. How to list certain columns when another column e.g. price is negative?
    15. How to use the IN operator to find certain columns (e.g. first and last name of customers who are serviced by a certain ID)
    16. How to find certain columns when one of the columns begins with a particular letter (e.g. A)
    18. How to list the contents of the a table sorted in ascending order of item class and, within each item class, sorted in descending order of e.g. price?
    19. How to do a count of column in a table?
    20. How to sum a column and make rename is something?
    21. How to do a count of a column in a table (without repeats e.g. if a certain number repeats more than once than to only count it once)?
    22. How to use a subquery to find certain fields in columns when the another column’s fields values are greater than e.g. its average price?

    848290 wrote:
    Hey I'm trying to get a working understanding of some of the basics behind SQL, I've composed a few questions that I think may help me with this. Anyone that can help me with any of them will greatly help me thanks.To use the terminology you have in those questions, you must already have a basic understanding of SQL, so you have exposed yourself as not being the author of such questions.
    Please do not ask homework questions without having at least attempted to answer them yourself first and show where you're struggling.

  • Security for creating web templates using web application designer

    I work for ChevronTexaco as a BW Security Analyst. I have a request to set up roles for web template creation using the Web Application Designer. Where can I get help in setting up the security for these types of roles? My experience is in setting up roles for running and creating queries in BEX. I need to know what additional authorizations will enable web template creation. Setting up a trace in ST01 has been less than helpful since it dumps out tons of RS_COMP tracing that doesn't help me much.
    The user wants to be able to create web templates for existing queries in BEX and restrict by rs_comp infocubes/areas/reportid, etc. and to be able to save to restricted role names. Are there new auth groups specific to this type of activity that I need to code for in addition to the basic end user or report builder authorizations?
    Any help would be greatly appreciated.
    Jeff Ehritt
    925 827-6012
    ChevronTexaco

    Thanks Marc, I'll check it out. My problem was that I was trying to create the role by granting a userid sap_all, sap_new and s.a_system as well as power user auths for a specific application. I set up a trace in ST01 for authorization cking on the ID while one of our BW Central Support people went into Web Designer to create a template and everything else they wanted to do.
    The resulting trace spewed out so much stuff from S_RS_comp and comp1 as to be virtually useless since it named scores of different cubes and infoareas that the analyst wasn't even interested in. The results puzzled me and made it extremely difficult to pin down the required authorizations. Usually ST01 can be used as a blueprint to create the role,ie; everything that the user touches is traced but no more than that. Have you seen this before? With just the new role I had set up the user could not save to a role unless I coded the fully qualified role name such as YRH_SENDAT_USER. YRH* would not work.
    Thanks,
    Jeff Ehritt
    ERP COE SAP BW Security

  • Security For BW Web Application Designer

    I work for ChevronTexaco as a BW Security Analyst. I have a request to set up roles for web template creation using the Web Application Designer. Where can I get help in setting up the security for these types of roles? My experience is in setting up roles for running and creating queries in BEX. I need to know what additional authorizations will enable web template creation. Setting up a trace in ST01 has been less than helpful since it dumps out tons of RS_COMP tracing that doesn't help me much.
    The user wants to be able to create web templates for existing queries in BEX and restrict by rs_comp infocubes/areas/reportid, etc. and to be able to save to restricted role names. Are there new auth groups specific to this type of activity that I need to code for in adition to the basic end user or report builder authorizations?
    Any help would be greatly appreciated.
    Jeff Ehritt
    925 827-6012
    ChevronTexaco

    Hi Jeff,
    there are no special authorization objects for Web Templates. RS_COMP will still only work for queries, structures.... Saving to roles requires certain authorizations for the role (s_agr_*), here you can define the roles you can save templates to.
    Regards, Klaus

  • Trying to understand the basic concept of object oriented programming.

    I am trying to understand the basic concept of object oriented programming.
    Object - a region of storage that define is defined by both state/behavior.
    ( An object is the actual thing that behavior affects.)
    State - Represented by a set of variables and the values they contain.
    (Is the location or movement or action that is the goal that the behavior is trying to accomplish.)
    Variables- (What does this mean?)
    Value - (What does this mean?)
    Behavior - Represented by a set of methods and the logic they implement.
    ( A set of methods that is built up to tell's the how object to change it's state. )
    Methods - A procedure that is executed when an object receives a message.
    ( A very basic comand.For example the method tells the object to move up, another method tells the method to go left. Thus making the object move up/left that combination is the behavior.)
    Class - A template from which the objects are created.
    ( I am very confused on what classes are.)
    - The definitions of the words I obtained from the "Osborne Teach Yourself Java". The () statements are how I interperate the Mechanisms (I do not know if Thats what you call them.) interact with each other. I understand my interpretation may be horribly wrong. I will incredibly appreciate all the support I may get from you.
    Thank you

    Object oriented programming is a replacement for the older idea of procedural programming (you can research procedural programming in google). As I understand it, in procedural programming, you have a step by step set of function calls to accomplish some task. Each function receives a data structure, manipulates it, and passes it to the next function. The problem with this is that each function preforms some action for the overall task and can't easily be reused by some other task. Its also harder to read the flow of what is happening with raw data structures flying all over the place.
    In object oriented programming, an object calls a function of another object and receives back, not a data structure, but another object. Objects contain a data structure that can only be accessed by its functions. An object is not so much a sub component of a bigger task, as it is a service that any other task can use for any purpose. Also, when you pass an object to the caller, the caller can ask questions about the data structure via its functions. The developer doesnt have to know what the previous function did to the data by reading up on any documentation, or having to reverse engineer the code.
    I suggest the best way of learning this is to code something like a library object.
    A library object contains a collection of book objects
    A book object contains a collection of chapter objects
    A chapter object contains a collection of paragraph objects
    A paragraph object contains a collection of sentence objects
    A sentence object contains a collection of word objects.
    Add functions to each object to provide a service
    Example: A library object should have a:
    public void addBook(Book book)
    public Book getBook(String title)
    public boolean isBookInLibrary(String title)
    The key is to add functions to provide a service to anyone who uses your object(s)
    For example, what functions (service) should a paragraph object provide?
    It shouldn't provide a function that tells how many words there are in a sentence. That function belongs to a sentence object.
    Lets say you want to add a new chapter to a book. The task is easy to read
    if you write your objects well:
    Sentence sentence1=new Sentence("It was a dark and stormy night");
    Sentence sentence2=new Sentence("Suddenly, a shot ran out");
    Paragraph paragraph=new Paragraph();
    paragraph.addSentence(sentence1);
    paragraph.addSentence(sentence2);
    Paragraphs paragraphs=new Paragraphs();
    paragraphs.addParagraph(paragraph);
    Library library= new Library();
    library.getBook("My Novel").addChapter("Chapter 1",paragraphs).
    Now, lets say you want to have a word count for the entire book.
    The book should ask each chapter how many words it contains.
    Each chapter should ask its paragraphs, each paragraph should ask
    its sentences. The total of words should ripple up and be tallied at each
    stage until it reaches the book. The book can then report the total.
    Only the sentence object actually counts words. The other objects just tallies the counts.
    Now, where would you assign a librarian? What object(s) and functions would you provide?
    If written well, the project is easily extensible.

Maybe you are looking for

  • Macbook Pro i7 running slow

    I just picked up a new Macbook Pro i7 Mid-2012 w/ 8GB of RAM.  I am running VMWare Windows 8 (or Windows 7), Apple Mail, LibreOffice, Text Edit, Safari and Firefox.  According to MemoryClean, and I have 3.17GB of RAM free.  Checked with Disk Unility,

  • BO slow when accessing reports through the web but not with a installed client.

    Hi We have installed BO 4.0 SP08 in a virtual machine with 32 RAM and 8 CPU processors. We have divided the APS in a number of instance with different services. We have also 8 Web Intelligence Processing servers. The application is slow when trying t

  • Size Of Using Serialization

    Hi I would like to implement a size of method in Java. I know it is impossible but I also know that there are turn arounds to the problem using methods such as gc and serialization which give satiffactory results. In my case acurracy is not of utmost

  • Add rows to tabular form with apex_item.checkbox?

    Hi, I have created a data manipulation process to add a row to a tabular form. The issue is that I have some checkboxes and when I click the button to call the add row process it doesn't create any of the checkboxes only the text fields. Is there any

  • How to make sure m4v files do notopen in iTunes?

    If I download an .m4v file from the internet, it defaults to copying and then opening in iTunes. How do I stop this behavoir? Thanks, Henry