"new" resulting brittle code

A client developer on one my projects commented that using the keyword "new" results in brittle code and creates interclass dependencies.
Why would this result in brittle code?
Which design patterns alleviate these interclass dependencies?
Thanks in advance

A client developer on one my projects commented that
using the keyword "new" results in brittle code and
creates interclass dependencies.
Why would this result in brittle code?It's a bit of an overgeneralization, but the point is that if you do Foo foo = new FooImpl(); then you are coupling that code to a specific implementation of Foo. If you find a reason to use a different implementation, you have to change the code. You don't get to decide the implementation at runtime.
This is not always a bad thing. You don't go around specifying or optimizing implementations for every single type at runtime. However, as a slightly extreme example, it would be a bad idea in a JDBC context to do Connection con = new com.oracle.jdbc.Connection() (assuming that were the actual class name and it had a public constructor).
Which design patterns alleviate these interclass
dependencies? Abstract Factory or Factory Methd I guess.

Similar Messages

  • Need new result file for each iteration of a loop

    I am using TestStand 2010 SP1.  I have a main sequence that essentially does the following:
    Initialize the test equipment and set up the test environment [Sequence Call]
    Start Loop
    Run Tests [Sequence Call]
    End Loop
    Because testing can continue for hours, the resultant report file is enormous and difficult to evaluate. I need to create a new result file for each loop iteration.  I know that starting a new execution of “Run Tests” will create a result file for each iteration of the loop, but the new execution will not have access to the handles to the test equipment that were made during initialization.  The testing is time critical, therefore initializing the test equipment and setting up the test environment must occur outside of the loop. 
    How can I programmatically create a new result file at the beginning of the loop and close the result file at the end of the loop?  I am open to any other suggestions.  Thank you in advance for your help!

    Hi,
    You could modify your process model by making a copy of Test UUTs entry point. Then make the loop that usually tests multiple UUTs into your loop. Take the loop and init out of your sequence. You can init in PreUUTLoop or the other pre loop sequence, and maybe store your references in runstate.root.Locals and pass them to MainSequence. Then you can use Report Options to set it for separate report files.
    cc

  • How to create new logical function codes for Subtype

    Hi all
      I'm developing an WF that must be started when the user makes any change in a employee position. The problem is that this change can be made by many transactions, I know that it´s possible to do it by PA30/PA40, and today it´s made here using PP01. The Functional Consultant said to me that the better way to map all possible trasactions which made that kind of changes in an employee data is by adding new "Logical Funcion codes" (or Activities) for our specif subinfotypes.
      The table that contains such information is T77FLC. How can I add that new activities for a subinfotype, by a costumizing or just adding new entries in this table?
    Thanks in Advance

    Josie,
    You can configure your own workflow events based on HR objects/infotypes/subtypes/update type/activity type combinations using transaction SWEHR3.  Look at SWEHR2 for the standard events to get some idea of what you need to enter in SWEHR3.
    The relationship between the infotype and the matching business object type is held in SWEHR1.
    Regards,
    Jocelyn

  • How to create new logical function codes for Subinfotype

    Hi all
    I'm developing an WF that must be started when the user makes any change in a employee position. The problem is that this change can be made by many transactions, I know that it´s possible to do it by PA30/PA40, and today it´s made here using PP01. The Functional Consultant said to me that the better way to map all possible trasactions which made that kind of changes in an employee data is by adding new "Logical Funcion codes" (or Activities) for our specif subinfotypes.
    The table that contains such information is T77FLC. How can I add that new activities for a subinfotype, by a costumizing or just adding new entries in this table?
    Thanks in Advance

    Josie,
    You can configure your own workflow events based on HR objects/infotypes/subtypes/update type/activity type combinations using transaction SWEHR3.  Look at SWEHR2 for the standard events to get some idea of what you need to enter in SWEHR3.
    The relationship between the infotype and the matching business object type is held in SWEHR1.
    Regards,
    Jocelyn

  • New G/L codes not reflecting in Reports

    Dear all,
    i have created New G/L codes in FS00 and added to financial statement version that is FSE2 to reflect in the reports.New G/L codes can see in standard report S_ALR_87012301 that is G/L balances report, but not reflecting in Cusotmised reports defined from standard reports which P/L reports Y_CD1_69000001,2&4.
    my question is after creation of New G/L codes what are the steps need to do to reflect that new G/L codes in reports.
    can anyone help me on this.since all the reports are production repots.
    Thanks & Regards,
    Usha

    Hi,
    When i check the code code of this program GPEFBVPXJFT2D7N4QCER9ARVOYQ i found all the old  G/L codes except which i have created newly like this.pls check the below  code for reference.
    FORM CHECK_0001
    IF  RFRRS02-SAKN1 EQ '0000033034'.
                PERFORM CHECK_2017.
              ELSEIF RFRRS02-SAKN1 EQ '0000033035'.
                PERFORM CHECK_2030.
              ELSEIF RFRRS02-SAKN1 EQ '0000033036'.
                PERFORM CHECK_2043.
              ELSEIF RFRRS02-SAKN1 EQ '0000033037'.
                PERFORM CHECK_2056.
              ELSEIF RFRRS02-SAKN1 EQ '0000033038'.
                PERFORM CHECK_2069.
              ELSEIF RFRRS02-SAKN1 EQ '0000033040'.
                PERFORM CHECK_2082.
              ELSEIF RFRRS02-SAKN1 EQ '0000033043'.
                PERFORM CHECK_2095.
              ELSEIF RFRRS02-SAKN1 EQ '0000033045'.
                PERFORM CHECK_2108.
              ELSEIF RFRRS02-SAKN1 EQ '0000033052'.
                PERFORM CHECK_2121.
              ELSEIF RFRRS02-SAKN1 EQ '0000033053'.
                PERFORM CHECK_2134.
              ELSEIF RFRRS02-SAKN1 EQ '0000033054'.
                PERFORM CHECK_2147.
              ELSEIF RFRRS02-SAKN1 EQ '0000033055'.
                PERFORM CHECK_2160.
              ELSEIF RFRRS02-SAKN1 EQ '0000033056'.
                PERFORM CHECK_2173.
              ELSEIF RFRRS02-SAKN1 EQ '0000033057'.
                PERFORM CHECK_2186.
              ELSEIF RFRRS02-SAKN1 EQ '0000033058'.
                PERFORM CHECK_2199.
              ENDIF.
            ENDFORM.
    pls advise.
    Thanks,
    Ramana

  • Syst allows, using both old & new tax jurisdiction codes on PO after Vertex

    Hello All,
    We have recent gone for Vertex implementation in our concern and have an interface with SAP.
    Now , after the implementation, system allows me to use both old and new tax jurisdiction codes on POs. This will be an issue so can someone help me and let me know if any note has to be applied or any other solution.
    Thanks in advance
    Arun

    There is difference between old and new Jurisdiction codes because as per Vertex GEO codes to SAP jurisdiction codes, there are 2 differences. 
    1) The first 2 characters in Vertex are the GEO numeric code (i.e. 01 = AL in SAP), and
    2) There is an additional zero at the end of the jurisdiction code in SAP TTXJ table. 
        Example:  Vertex 010030420 equals AL00304200 in SAP.
    Thanks
    Arun

  • New Organizational Unit Code

    Dear Folks,
    I want to create a new Organizational Unit code for a rollout project.
    For Example, the current company organization unit say 500000000 - Pepsi Corporation Limited and now I need to create a new company code and for that company code I need the Organizational Unit as 6000000 - India Beverages.
    I hope you have understood, what I wanted to create.
    Can anyone suggest me, how to make the above configuration changes.
    Regards,
    Somu Sekar. P

    Hello,
    First check whether u are maintaining number ranges if yes then create new no. ranges for org unit and proceed with creating.
    ask fi/co people to create company code and then you can assign credentials as per your requirement.
    thanks
    rafi

  • New cluster sample code

    Hello,
    There is a new cluster sample code under the sample code directory.
    Description:
    Giving a new collection of documents or a document hitlist from a new query, it will be more efficient for
    users to known what is in the collection by organizing the collection based on the document sementics. To
    partition a collection is the task of clustering. Here is an implementation and sample code of clustering
    based on Oracle Text.
    http://otn.oracle.com/sample_code/products/text/htdocs/cluster.html

    You'll find all the details you need to accomplish this in the ADF Developer's Guide for Forms/4GL Developers on the ADF Learning Center at http://www.oracle.com/technology/products/adf/learnadf.html.
    Section "8.3 Adding a Custom Service Method" explains how to add a service method to your application module.
    Section "7.8.3 Example of Creating a New Service Request" shows the code required to create a new row in a view object.
    Then you would just use the setAttribute() method on the target row to set the desired attributes to the new values based on the values from the source row.
    Section "8.4.1 How to Publish Custom Service Methods to Clients" describes how you would publish your service method to clients.
    Section "10.3.3 How the Data Model and Service Methods Appear in the Data Control Palette" describes where to look to see your published client methods in the data control palette to drop them as a button on a page.
    Section "4.5 Understanding the Active Data Model" explains why the UI will automatically refresh to display the changes you've made in your application module method when it's invoked.

  • Creating a new custom language code?

    Hi!
    What would be the process to create a new custom language code to MDMP enabled SAP (6.20)? And the same question for a Unicode system ECC6.0?
    The new language (let's call it ZZ) would be an exact copy of Chinese language ZH.
    As far as I have understood, the requirement is to maintain different Chinese material descriptions and tax rates for the same material in different Chinese customs areas. Standard SAP doesn't support this it seems. So, ZH would be used for custom area 1 and ZZ for customs area 2. Each with their own descriptions and tax rates.
    Solution-wise I appreciate any good tips but if we really  have to go down to this "second Chinese language" path I'd like to know how big a task it is.

    Hi,
    in a Non-Unicode system, SAP notes 112065 and 302063 describe possibilities to use additional language keys.
    In a Unicode system, SAP note 73606 (attachment supportedlanguages2.xls) shows all supported language keys.
    However these additional language keys enable you to maintain additional descriptions (e.g. for display or printing).
    But in general it is not possible to enable different tax rates depending on language keys.
    This sounds rather like a localization requirement. For this area there are usually other attributes which can be used (like e.g. company code).
    Best regards,
    Nils Buerckel
    SAP AG

  • How to embed new youtube embed code in iweb

    For some reason neither the embed code pasted into an HTML snippet nor the youtube URL pasted into a youtube widget display the youtube video when I publish the site.
    The youtube video shows up in iweb the moment I paste either the URL into the youtube widget or the embed code into the html widget, but when I publish it, the youtube video doesn't display.
    I thought it might have to do with the old vs. new embed code on youtube - the new makes it work as html 5 as well, but I've tried both the new and old code and can't get it to show up.
    The last bit of info is that I have noticed that when i publish the changes, the snippet folder in the folder that gets published isn't updating - there doesn't seem to be anything in that folder that gets changed when i add, delete or edit any widget.

    The YouTube widget no longer works as it was dependent on software on the MMe servers which are no more.
    How are you publishing the site?  Are you publishing to a folder on your hard drive and then uploading to the server with a 3rd party FTP client?  Does the video play when you access the locally published site with your browser? If so then the problem lies with the uploading of the files.
    If you're using iWeb 2 (08) be aware that there are compatibiliy problems with it and Mt. Lion when it comes  to publishing.  So check the site locally to make sure all is well before uploading.
    This test page has two occurrances of a YouTube video, one with the old code, one with the old code and HTTPS and with HTTPS only: Page 2
    OT

  • Why do I keep getting new keychain verification codes sent to my iphone?

    Why do I keep getting new keychain verification codes sent to my iphone?

    Because you haven't verified the phone?

  • New Service Tax code ( FTXP)

    Hi All
    As you all are aware that service tax rate has changed from 12.36% to 10.3% my client is using TAXINN , i have to creat new service tax code that i will do from copy from one service tax to another , but my concern is that i shoul have to maintain condition record for this tax code or the earlier conditon work for the new tax code
    Thanks & Regards
    Amit Kumar

    Hi Amith
    I am new to the TAXINN procedure. I am trying to configure the new service tax code but not getting thru. Can you please share the detailed steps for creation of new service tax code.
    However, I am giving below the the steps which I have done :
    1) FTXP where new code is created
    2) OB40 - GL is assigned
    Do i need to work on FV11 ? Or did I miss anything ?
    Please guide me the further steps to be configured. My requirment is very critical and needs to be configured immediately.
    Thanks
    Gemini

  • Guide misidentifies reruns as new, resulting in unwanted recordings

    The FiOS guide this week is misidentifing reruns as new, resulting in unwanted recordings.  Who do I complain to about this?

    http://www.fyitelevision.com/   does verizon's guide data.
    There is a contact us form at their website and an email address as well at the contact us > contact info page.
    Channel Lineup Additions & Changes
    [email protected]

  • Create new time entry code

    Hi Friends,
    Please let me know what is Time entry code and how to create the new time enrty code. Which is used Via CATS.
    Thanks & Regards,
    John

    Hi John,
    I'll try to answer with wide brush stroke notes.  The details will depend on your need where you will need to dive deeper into the IMG.
    (1) In  the IMG, go to Time Mgmt > Time Data Recording and Administration > Absences > Absence Catalog > Group Personnel Subareas for Attendances and Absences. Make sure all of your Personnel Subarea Groupings (PSG) are setup.
    (2) In the IMG, go to Time Mgmt > Time Data Recording and Administration > Absences > Absence Catalog > Absence Types.  Under each appropriate PSG setup your Absence/Attendance Type (A/A Type).
    (3) In the IMG, go to Time Mgmt > Time Data Recording and Administration > Absences > Absence Catalog > Determine Entry Screens and Time Contstraint Classes.   This may have been setup for you in (2) above.
    (4)  In the IMG, go to Time Mgmt > Time Data Recording and Administration > Absences > Absence Counting > Assign Counting Rules to Absence Types.  This may have been setup for you in (2) above.
    (5)  In the IMG, go to Time Mgmt > Time Data Recording and Administration > Absences > Absence Counting > Determine Daily Work Schedule Variants for Absence. This may have been setup for you in (2) above.
    (6) In the IMG, go to Time Mgmt > Time Data Recording and Administration > Absences > Absence Counting > Define Indicators for the Personal Calendar. This may have been setup for you in (2) above.
    (7) Like Absences, do the same for Attendances. 
    (8)  For Quotas (like vacation/paid tiome off), in the IMG, go to Time Mgmt > Time Data Recording and Administration > Managing Time Accounts Using Attendance/Absence Quotas > Calculating Absence Entitlements > Rules for Generating Absence Quotas. Review all of your settings.
    (9) In the IMG, go to Time Management > Time Evaluation.  Here, you may need to adjust your schema, rules and other config. We use a custome schema "ZM04" modeled after "TM04".  I had some changes to a custom rule "ZP20" (modeled after TP20).  You may have other changes.
    I hope this helps send you down the right path.  Thanks.
    Erik

  • Yahoo search has no link to news results

    I tried to like new Yahoo search, but I like to search for news, and Yahoo result page has no clickable link taking me to news results.
    I know normal Yahoo search has this, why is Firefox customized Yahoo results lacking of this?
    Back to Bing for now.

    My search page from Yahoo has a news link
    * https://uk.search.yahoo.com/search?p=hi&ei=UTF-8
    **https://uk.news.yahoo.com/
    * Generic links search.yahoo.com & news.yahoo.com
    Possibly you are just looking at the Firefox homepage about:home or the newtab page about:newtab Feel free to bookmark such pages or set them as a homepage {If you set multiple homepages, multiple tabs open) or newtab page.
    * [[Startup, home page and download settings]]
    * [[New Tab Page – show, hide and customize top sites]]
    I am aware Yahoo has previously made available a Yahoo toolbar but it appears at present that is broken and being worked on by Yahoo[https://support.mozilla.org/en-US/forums/contributors/711130 .] The toolbar will apparently only work in outdated unsafe Firefox versions.

Maybe you are looking for

  • Generic datasource creation in IS-HTCM

    Gurus Has anyone worked with IS-HTCM on CRM? and creating of reports with HTCM as source system? We want to create a few generic Datasources ....BWA1 is one option and RSO2 is the other...But can the BWA1 concept of CRM be tried in HTCM as well? or d

  • Change of Reconciliation Account from Customer to Vendor

    Is it possible to change the Recon Account Type from Customer to Vendor if it already has posted entries in it ? If yes, please advise the procedure. Thanks Ravi 9849393564

  • Officejet Pro L7680 won't print full Page from Win 8.1

    Installed driver for this printer on a 64bit Dell XPS running 8.1. The data on the computer says the installation is satisfactory. The printer printed a full page fax report and self diagnostic page. But when prining a full page from Word, or the int

  • "Partner Determination Steps  for Customer Master" clarification

    Hi, Let me clear myself at the outset itself, that I searched SDN for my below mentioned query, however I could not find any answer to my satisfaction....here I am posting again In "Partner Determination for Customer Master", the following steps are

  • Printing report in calendar format

    I need to print a report in a calendar format with monthly view in Reports 9i. I am aware of Portal and APEX but its not an option. There is a table which consists data for several months, and I am trying to use oracle forms as parameter form to pass