Question about objects referencing objects?

I have 3 objects. I call two methods from one, two from another and one method from the last object. I do this in a couple of places. Should I put this particular process into an object method (sixth object) rather than always having to code these calls?
It seems doing that would violate an object being responsible for itself. Unless I pass all five object methods as parameters into a sixth object. This sixth object will package all these calls for me. Suggestions?
Thanks,
Brett

When you say put the new method on that class, are
you referring to wrapping all five object methods
calls in the new method or taking out the specific
lines of code and wrapping them in the new method?Yes. I don't understand the difference between these two options. Use the "extract method" refactoring on the common lines.
I assume you mean wrapping object calls into one
method. Doesn't that violate object orientation
principles? These method calls won't be coming in
as parameters right? If so, they'll just be there in
the method and I won't have a way to verify them.Huh? I don't know what an "object call" is. The common lines will be in a method. What do you mean by "verify them"?
Also, if these method calls are additional lines of
code in the new method, what happens when one of
those methods changes? That could change behavior in
the new method. Behavior I don't want.It doesn't matter where the method is called. Changes to the behavior of the method will potentially impact every caller. The new method wouldn't be changed any more than the multiple occurences of the same lines in multiple methods you have now. By extracting them to a common method you can deal with the changes in a single place.

Similar Messages

  • Questions about erasing an object from a picture

    How does one erase something from a picture???? Something as basic as this should be easily explained but it is not in Photoshop.
    #2 How do you change the color of a sky to make it blue rather than white???

    How does one erase something from a picture???? Something as basic as this should be easily explained but it is not in Photoshop.
    Duplicate the background layer
    Work on the backgrouind copy layer, and shut off the visibility of the background layer by clicking on its eye icon in the layers palette.
    Use one of the selection tools (e.g. selection brush, lasso tool) to select the object that you wish to remove. Once the selection is complete, you will  see "marching ants" surrounding the selection. Hit delete on the keyboard.
    Now fill the hole with whatever you want.
    #2 How do you change the color of a sky to make it blue rather than white???
    You can use the Smart brush tool, the one with the gears, for this purpose.
    There are other ways as well. Please review this comprehensive thread that pertains to this issue, esp. the referenced Alibony technique:
    http://www.elementsvillage.com/forums/showthread.php?t=79424

  • A question about the create object command

    Hi, I met some problems when created type and view:
    In sqlplus,
    1) I first create a address_ty:
    create or replace type address_ty as object
    (street varchar2(50),
    city varchar2(25),
    state char(2),
    zip number);
    type created
    2) Then I created a person_ty;
    create type person_ty as object
    (name varchar2(25),
    address address_ty);
    type created
    3) create the table customer;
    create or replace table customer
    (customer_id number,
    person person_ty);
    table created
    4) create the view based on the customer table;
    create view customer_0v(customer_id, person) as
    select customer_id,
    person_ty(name,
    address_ty(street,city,state,zip))
    from customer;
    ***There is a error message :
    error at line 4: address_ty(street,city,state,zip))
    invalid column name.
    I think it should work but ...
    5) Another question is could I insert into table customer values like this:
    insert into customer values
    (123,'SIGMUND','47 HAFFNER RD','LEWISTON','NJ',22222);
    It does not work in my pc and give a erro message like ' too many valuesj'.
    But some of books said it works.
    Thanks for any help !
    echo
    null

    Why does not the Object itself implement the interface
    CloneableBecause then every object would be cloneable.

  • Question about using file objects

    Hi,
    I have two somewhat related issues in using file objects.
    In one app, a simple swing gui that passes a file to a sax parsing class and reports back any errors, if I parse a file using the app, then try to edit the file I'm parsing (in another application) and save, I get an error message. I need to close the parsing app before I can save the file.
    In another app I wrote, one that takes a group of files and runs an xslt stylesheet on them, if I select too many files, I get an OutOfMemory error, which leads me to believe that as the files go through multilple processes, they stay alive on the heap.
    a file object is basically just a pathname, right? If I'm not using a BufferedWriter, or InputStreamReader or whatever, you can't really close a file...will the notifiy() method let the jvm know that it can let go of the file?
    thanks,
    bp

    A File object is just a path, it doesn't open the file or lock it, etc.. But if you are parsing the file, you must be opening (and forgetting to close it).

  • Question about creating new objects

    When creating a DocumentBuilderFactory Object, why is the code written like this:
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();as opposed to
    DocumentBuilderFactory docBuilderFactory = new DocumentBuilderFactory();???

    Factory classes like this are typically abstract classes which do little more than define an interface and the getInstance() methods. The class that getInstance() will actually instanciate will be a concrete implementation from a particular implementation of the DOM parser. This pattern allows whatever implementation happens to have been supplied to be automatically be used without your code having to concern itself.
    The concrete factory will then create concrete implementations of the various interfaces like DOMPaser, using the implementations in the actual library.

  • Ole2 question about inserting document object in Word

    I thought I had it figured out but it doesn't seem to work. From a Oracle Forms 6i application, I want to insert an object(a file) in a word document as an icon.
    The vb code generated when I record the macro of inserting an object as an icon is:
    Selection.InlineShapes.AddOLEObject ClassType:="Word.Document.8", FileName _
    :="string defining the location of the file object", LinkToFile:=False _
    , DisplayAsIcon:=True, IconFileName:= _
    "C:\WINDOWS\Installer\{90110409-6000-11D3-8CFE-0050048383C9}\wordicon.exe" _
    , IconIndex:=1, IconLabel:= _
    "string defining the location of the file object"
    Using this I wrote the following code: ( I am leaving out the declaration of the ole2.obj_type and other variables)
    args := ole2.create_arglist;
    ole2.add_arg (args, 'string defining the location of the file object');
    hinlineshapes :=
    ole2.get_obj_property (hselection, 'InlineShapes');
    ole2.invoke (hinlineshapes
    ,'AddOLEObject'
    ,args
    ole2.destroy_arglist (args);
    holeformat := ole2.get_obj_property (hinlineshapes, 'OLEFormat');
    ole2.set_property (holeformat
    ,'ClassType'
    ,'Word.Document.8'
    ole2.set_property (holeformat
    ,'DisplayAsIcon'
    ,TRUE
    ole2.set_property (holeformat
    ,'IconLabel'
    ,'string defining the location of the file object'
    When I run the code I get the following message from MS Word:
    " This object was created in 'string defining the location of the file object'.
    This application is not available to open this object.
    Make sure the application is properly installed and that it has not deleted, moved or renamed."
    Can someone please help? Thanks in advance.

    Second, when it inserts the date, it makes it an "update automatically" date that updates to the current time every time I open the document
    Sure, that's because you specifically tell it to. Your script inserts a 'new field' which is analogous to Word's dynamic text objects (date, time, page number, etc.)
    Instead, what you want to do is insert an actual string of characters - sure, to you and I that string of characters might look like a date and time, but to Word it's nothing more than a series of characters.
    For that we can fall back on AppleScript's date features, specifically current date, like:
    tell application "Microsoft Word"
      tell selection
        type text text "Left message " & (current date as text)
      end tell
    end tell
    Note that current date as text returns a rather verbose form of the date. If that's too much for you there are alternate options, such as:
    short date string of (current date) & space & time string of (current date)
    which will look more like: "6/10/10 3:26:50 PM"
    But there is also a myriad of other ways (with seconds, without seconds, 12/24 hr, etc.) depending on what you want.
    Third, if possible, I would also like it to be in italics.
    I'll have to look at that one, unless someone else beats me to it.

  • Question about SNRO - Range objects

    Hi experts,
    i've created a object range from SNRO, and configurate it an interval. But i need Objet works with parameters. For example BUKRS and GJAHR.
    For each BUKRS/GJAHR, i need the range's inverval restart, or has its particular counter.
    is this possible?
    thanks..
    Edited by: Renato Calderon on Mar 18, 2010 11:25 PM

    check this link. it might be helpful to you.
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=50004015
    thks
    Abhi

  • Question about the Timer Objects

    According to the API docs, the method Schedule for a Timer object takes the following constructor:
    schedule
    public void schedule(TimerTask task,
    Date time)
    Schedules the specified task for execution at the specified time. If the time is in the past, the task is scheduled for immediate execution.
    Parameters:
    task - task to be scheduled.
    time - time at which task is to be executed.
    Source: [link]http://java.sun.com/j2se/1.4.2/docs/api/java/util/TimerTask.html[link]
    However, I am getting the following error:
    The method Schedule(TimerTask, Date) is undefined for the type Timer.
    Any idea why I would be getting this message?

    However, I am getting the following error:
    The method Schedule(TimerTask, Date) is undefined for
    the type Timer.
    Any idea why I would be getting this message?Yeah. Could be 2 things:
    1. It's "schedule" not "Schedule" (case matters)
    2. You're using java.sql.Data instead of java.util.Date.

  • Question about "java.lang.Object.equals()".

    public class TestEquals {
      private int a;
      private int b;
      public TestEquals(int a,int b) {
        setA(a);
        setB(b);
      public int getA() {
        return a;
      public void setA(int a) {
        this.a = a;
      public int getB() {
        return b;
      public void setB(int b) {
        this.b = b;
      public static void main(String[] args) {
        TestEquals te01 = new TestEquals(1,2);
        TestEquals te02 = new TestEquals(1,2);
        System.out.println("te01 equals to te02: " + te01.equals(te02));
        te01.setA(2);
        System.out.println("te01 equals to te02: " + te01.equals(te02));
    }The result is:
    te01 equals to te02: false
    te01 equals to te02: false
    Why the first case is false?

    You didn't override Object.equals() in your TestEquals class. So, you are calling Object.equals(), which just compares reference values. You need to write your own equals() method (presumably, make sure te01.a==te02.a and te01.b==te02.b). Depending on what you do with your objects, you would want to override Object.hashCode(), too.

  • Some questions about the carousel object

    Hello,
    I think it is not possible to configure a non circular carousel, isn't it?, i.e., I want a carousel with 13 cells, but when the user is viewing the cell 13 I don't want the cell 1, cell 2, and so on to be viewed as the next ones.
    If this is not possible, I am thinking this:
    The user can see 5 cells (I am using an horizontal carousel) and the focus is in the 3rd cell. What I want to do is when the focus is in the 3rd cell, the user can't move to the cell in its left. Is this possible? The user only can move to the cells in the right until he reaches the third from last.
    Is this possible?
    Thanks in advance!!

    Hi jkhan!
    Thanks a lot for your reply!
    I'm trying the carousel view as a kind of timeline and the curved effect it provides I can't get it with the gallery view.
    If I could disable the carousel movement in a direction when I reached a cell it would be perfect...

  • Question about multiple resource objects using the same OID target account

    In Oracle Identity Manager 11g with OID connector as a target system.
    Is it possible to create multiple resources that use the same OID IT Resource. Each resource is responsible for provisioning certain OID attributes of the same OID account. For example 'OID User' would provision the basic account and a separate resource called 'Department1 User' would provision attributes not provisioned by OID User.

    Yes, definitely. Here is how it would work:
    - You would have to make sure that the resource OID User always gets provisioned first, so that the account exist when these additional attributes are being set for the user via the other resource Department1 User. You can do this with Resource Dependency in OIM.
    - Now for using the same IT Resource, just create the new form and in the IT Resource type form field, map the properties to the same IT Resource Definition, so when the Provisioning Process gets invoked it uses the same IT Resource instead.
    Thanks
    SRS

  • ANOTHER question about moving referenced files.....

    After reading through most of the posts I could find, I am still not finding the answer to my question. I assume it's simple, but I'm a (second-guessing?) LR2 convert, and while I love Aperture's UI, I'm really struggling with file management.
    Here's how I like to work. Insert card into reader, and copy the folder (100CANON) to my desktop. Open Aperture, import all the photos from their current location. I like to edit, keyword, rename, etc at this point.
    Let's say I had 10 photos in that folder, 5 of my dog, 5 of my car. Here's where my confusion begins:
    I want to select the 5 dog photos, and move their physical location to my Pictures/Dogs folder on my hard drive, as well as to my Dogs project in Aperture. I try 'Relocate Master', which moves the file to the desired path on my hard drive. Unfortunately, the thumbnail still resides in the 100CANON project.
    So therein lies my question, if I want these dog photos in the Dogs project I now have to drag the thumbnails from the 100CANON project to the Dogs project.
    That seems like extra steps, and I can see that causing a lot of confusion, especially when trying to sort a folder with images that need to go in several different projects. I can't help but think I'm missing something obvious - why can't I go into my 100CANON project and drag the thumbnails to the appropriate project, and have the finder path update as well?
    Save the "you should let Aperture manage your files" discussion, I'm not interested in that. I need to use referenced masters.

    JF wrote:
    what do -you- do with your photos when you import them?
    I take the CF card and Finder-copy the contents to a hard drive where they will ideally live forever. Then I eject the CF card (very important error-avoidance step). If the folder contents are not a single shoot at this point from the Finder I review the folder to see if I want the images to comprise more than one project; if so, each project is split into a separate folder with its own name.
    Next I back up the folder of images which is labeled something like "101113Buckleymstrs." 101113 is 2010/Nov/13, Buckley is the job/project/event and mstrs indicates those images are the Masters. The backup folder is named "101113Buckley_mstrsbkup."
    Note that at this point and forever I can Finder-search for the date or for the job/project/event or for mstrs or for bkup to find images. No Aperture involved yet. Also note that the year/month/day format at the start of the file name properly alphabetizes the folders by date on the hard drives. Most of the files on my hard drives are done that way.
    Next I start to import into Aperture by reference into a new Project named "101113_Buckley" using the exact nomenclature used for "101113Buckleymstrs" except without "_mstrs" appended. If Aperture irrevocably lost the link to the masters I could Finder-search on the "101113_Buckley" and find them. At this step before import I review the pix Aperture is set to import and uncheck any obvious duds before clicking to import. The duds remain in the masters and backup folders but I do not care because hard drive capacity is cheap while my time and improved error avoidance have significant value.
    I always shoot RAW+JPEG and sometimes I make two Aperture Project imports, one of the RAWs and another of the JPEGs: "101113Buckley_mstrsRAW" and "101113Buckley_mstrsJPEG."
    For specific issues like "dogs" I use keywords to create Albums. Or if Buckley is a construction project, for instance, over time multiple Aperture Projects related to the Buckley construction will be created, all of which will point to a Buckley Construction Album. Other albums might be "Buckley Site Work," "Buckley Foundation," etc. Albums are very powerful and take up essentially zero space because they are comprised only of pointers.
    I assume you're letting Aperture manage them? I think the issue is that I'm not ready to let Aperture take control of my library.
    I manage every image very intentionally, using the tools Aperture makes available.
    Do you have random folders strung out all over your Pictures folder with the various imports you've done over the years?
    Folders are not random. They are sequential (which is how photos by definition always occur) and they are named identically to the corresponding Aperture Projects as noted above.
    It boils down to this for me. I have preferred being able to navigate a file structure within LR to find that one image I'm after. Yes, I realize I could search for it by keyword, whatever, but sometimes I might not even remember how I categorized it. I used to do commercial interior shoots, and had them labeled by address. It's nice to traverse a folder hierarchy if you need to, and it seems like if I turn over control to Aperture I'd be giving that up.
    I understand the need some folks have for what I call "film-think" or "folder-think." If you must use folders IMO best is to do it with the Masters before going into Aperture. Within Aperture IMO folder-think is debilitating to optimal use of the images database tools.
    I analogize each Aperture Project to a roll of film that occurred at a point in time (an hour or a day or whatever). It gets dated and named in the hard drive archives and in Aperture. Aperture's pointers and key words allow us to create an infinite variety of Albums without relocating the hundreds of original Projects/Rolls of film.
    HTH
    -Allen

  • Question about css referenced images with spry

    Using the Dreamweaver templae downloads design #1 and design #2, I pasted the spry assets and images from design #2 (accordion) into my website which is a copy of design #1.  In addition to the accordion images, This gives me the SpryAccordion.css and SpryAccordion.js which reference the accordion images as ../accordion_255_tab_normal.gif, etc., but in Dreamweaver designer and at runtime the accordion images to not appear.  Can someone please advise me where my issue might be? 
    Thanks,
    Jay

    Hi Jay,
    accordions? You could have a look about the possibilities of (translated from my German DW) Insert > jQuery UI. And for example these out of providers great number:
    http://jqueryui.com/accordion/
    http://users.tpg.com.au/j_birch/plugins/superfish/
    http://www.egrappler.com/a-stylo-modern-jquery-accordion-akordeon/
    http://www.dynamicdrive.com/dynamicindex1/indexb.html
    http://css3menu.com/?gclid=CI2FuNjPurYCFQpZ3godciQAAA
    aso (Google could be your friend).
    Hans-Günter
    P.S.
    Naturally you can remain at "good old" Spry, but some of the modern hardware will get their difficulties, so my hint is a preventative one. BUT in this case you really should load up your website, no matter how it looks like.

  • A question about creating packages as local objects in ABAP

    Hi,
    I have a question about creating packages with SE80. Whenever I create a new package it is assigned a new transport request. After that, I can create new programs inside this package, and each time I can choose whether to assign the new program to a transport request or just save it as a local object (I often do this for test programs that I don't transport and I remove them once my tests have been done).
    What I would like to ask is that, is it possible to create a package (and not just programs inside a given package) as a local object? so that every new object created in this package will be considered as a local object?
    Thanks in advane,
    Kind Regards,
    Dariyoosh

    Thomas Zloch wrote:
    Please also check the F1 help for the package field e.g. in SE80, SAP standard is in range A-S and U-X, namespaces start with "/", so you should be save. I am using the T namespace for temporary stuff since a long time and did not have a problem so far.
    > Thomas
    >
    > P.S. this applies to the package name only, of course
    Thank you very much for this remark, I checked F1 help for the package field and in fact as you mentioned these ranges are for local objects.
    Once again, thank you very much for your help.
    Kind Regards,
    Dariyoosh

  • Docs about RowSet, and Object RowSet questions?

    Docs about RowSet, and Object RowSet questions?
    I can find RowSet forum, so I ask here!
    Can you give me URLs where I can find more about RowSet and URLs for any RowSet implementation?
    Does Borlans, Oracle, IBM, etc., have RowSet implementation?
    I find out about Sun's RowSet implementation, but I can't find Object Rowset in this implementation?
    Is it possible to develop Object RowSet and is it useful?
    I know about O/R tools like Hibernate, but Object RowSet can be useful?
    Run SQL query and get Objects, or maybe even run Object query (like EJB or Hibernate or JDO have) and get Objects.
    No XML mapping mess and simmilar, like with EJB or Hibernate or JDO?

    You can try
    http://java.sun.com/developer/Books/JDBCTutorial/chapter5.html
    This is a tutorail for RowSet

Maybe you are looking for