Use Interfaces?

I try to develop a small web-based game.
I have a Player class:
public class Player{
private String name;
public getName(){
return this.name;
For my Presentation Layer I have a Buisiness Delegate -Interface:
public interface IFacade {
public Player getPlayer(String name);
Schould I better define a Player interface (IPlayer) and return a IPlayer-Object instead of Player-class Object?
Lena

First of all, don't start interfaces with 'I'. That's annoying. Just call the interface Player.
Secondly, whether you should use an interface depends on whether there will possibly be more than one type of Player. If you just want to try using intefaces to learn about them, that would be fine too.

Similar Messages

  • What is difference between using interface as source and table as source?

    I am working on a batch flow which need several steps to populate data from source to target. For example, I need 5 interfaces to finish final data loading. I can either use interface or use temporary table as source and target for the interface 2, 3, and 4. It looks like both case will use tables no matter use interface or use temporary table. So my question is if there is any difference between these two (using interface as source or use temporary table as source)?
    Thanks

    if you use a Table as source for the intermediate process, it will create a physical temporary table i your work rep(depends on you choice) and populate the data into the table. if you use a interface as a source, just it will create a sub query instead of temporary table.
    Thanks
    nidhi

  • Import invoices using interface table

    Dear all ,
    I want to import invoice from legacy system to oracle EBS R12 , and i use interface table to import the invoice.
    The problem is when i run Payable open interface import concurrent program to import the invoices , it didn't import any invoices
    and the report output didn't show any error or any data according to the invoices.
    Report output :
    Report Date: 27-JUN-2010 11:25
    Page: 1
    Payables Open Interface Import Report
    Hold Name:
    Source Name: Manual Invoice Entry Hold Reason:
    Group: GL Date:
    Purge: No
    Summarize Report N
    Report Date: 27-JUN-2010 11:25
    Page: 2
    Payables Open Interface Import Report
    Hold Name:
    Source Name: Manual Invoice Entry Hold Reason:
    Group: GL Date:
    Purge: No
    Summarize Report N
    So i go to the db and open the interface table and the status was null ,
    i dont know why????????

    Hi ,
    100% org_id problem Please check. Same i faced after i update the org_id it is working fine and showing the output with inovice and rejection details also
    Thanks
    Venkat

  • Is there an example to use interface to replace if then else pattern in F#

    is there an example to use interface to replace if then else pattern in F#
    i want to make match pattern with only one rule to represent dynamic number of rules which is use 
    let rec fun1 m number fun2param =
        match m with
        | fun2param(a,b,number) -> ****rewrite terms ****
    let fun2param number =
        if number = 1 then
                 function.....
        elif number = 2 then
                function ....
    computing nightmare

    In general, you use a match
    let fun2param number =
    match number with
    | 1 -> function.....
    | 2 -> function ....
    in the same way as you would use a `switch` construct in 'C' in place of a repeated if/elif...elif/else
    Your request is somewhat vague, so I'm not sure whether you would benefit from wrapping that behind an active pattern.

  • Looking for simple sample of iphone apps without using Interface Builder

    I successfully went through the 'iphone app tutorial' and used Interface Builder, but now want to try creating apps without it.
    The UI Catalog sample is too complex, but didn't see anything that just had a view and a button or label.
    Ideally I want code that doesn't require any IB usage, but I can't tell if that is possible yet...
    Anyone have a link to an easy sample?
    Or has anyone created a test app themselves and wouldn't mind posting?
    I took a stab at creating one and posted it on the "101" forum, but it would be hard for somebody to try and figure out what I was attempting
    Thx for any links/___sbsstatic___/migration-images/migration-img-not-avail.png
    ps
    I really need a good book, especially "cookbook" style

    hey dear
    I have one solution of your problem
    just go to in iphone developer search for FAQ
    In faq their is one section how to use prohramming in this you can see
    the how to ceate label,button etc.
    after that simply add the view or remove theview.

  • No data found error while creating po using interface

    Hi all,
    I am a beginner in Oracle applications. I am trying to create a PO and line using interface tables.
    I am getting the below error when I run my concurrent program:
    I do see my records in my staging tables and in PO HEADERS INTERFACE and
    PO LINES INTERFACE table and there are no errors in the my sql loader programs.
    However there is an error in Import Standard Purchase Orders program:
    The below is the error from log:
    ora nodata found in package PO.PLSQL.PO_PDOI_PVT
    user defined exception in package PO.PLSQL.PO_PDOI_CONCURRENT
    There is no record in fng log messages table with the AUDSID provided in the log file!
    I am not sure what to do.
    Any suggestions?
    Thanks.

    Hi.
    Can you please advise the value for column "PROCESS_CODE" in the PO_HEADERS_INTERFACE table? Did you check the Purchasing Interface Errors report also for any errors?
    Additionally, it will help if you can copy/paste the insert code for the interface tables ....
    A good detailed explanation of the Purchase Order interface is in the following document:
    http://docs.oracle.com/cd/A85683_01/acrobat/115mfgoim.pdf
    See if that helps.
    Cheers
    JD

  • How to instantiate a control in code instead of using Interface Builder ?

    I really appreciate the combination of the interface builder and Xcode altogether.
    However when I am learning QT, I realize I had been pampered by Apple's Design to a certain extend as I only need to create say a NSLabel instance and use Interface Builder to do the linking and never have to worry about instantiating the Object myself.
    But I'm curious, what is the way to instantiate a new hmmm say...NSLabel in the code ?
    NSLabel* label = new NSLabel();
    Then what ?
    What you are seeing here is how QT did it, could anyone create an equivalent in ObjC ? No fancy code please, just bare minimum.
    #include <QApplication>
    #include <QWidget>
    #include <QLabel>
    int main (int argc, char * argv [ ])
    QApplication app(argc, argv); //NSApplication in ObjC
    //These two lines merely created a window and set the title bar text.
    QWidget* window = new QWidget();
    window->setWindowTitle("Hello World");
    QLabel* label = new QLabel(window);//Create a label and inform the it belongs to window.
    label->setText("Hello World");
    window->show();
    return app.exec();
    Message was edited by: Bracer Jack

    Hi Jack -
    I think my best answer will be something of a disappointment, because I don't know how to show a one-to-one correspondence between the code you're working with and a Cocoa program. The main function of a Cocoa GUI program for OS X will look something like this:
    #import <Cocoa/Cocoa.h>
    int main(int argc, char *argv[])
    return NSApplicationMain(argc, (const char **) argv);
    As you commented, we could draw a correspondence between the first statements, but after that the functionality of the Cocoa program is going to be spread out in a way that makes for a rather tedious comparison. The only way I know to answer your question in less than 5000 words, is to skip ahead to one of several points in the startup sequence where the programmer can intervene with custom code.
    For example, a common way to get control would be to program a custom controller class and add an object of that class to the main nib file which is loaded during the startup sequence. By making a connection to the Application object in that nib file, the custom object could be made the delegate of the Application object, and if we then added a method named applicationDidFinishLaunching, our code would run as soon as the application's run loop was started.
    Now I finally have enough context to directly answer your question, so here is the code to create a label and add it to the key window at launch time:
    // MyAppController.m
    #import "AppController.h"
    @implementation AppController
    - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    NSLog(@"applicationDidFinishLaunching");
    NSRect frameRect = NSMakeRect(150, 300, 150, 30);
    NSTextField *label = [[NSTextField alloc] initWithFrame:frameRect];
    [label setEditable:NO];
    [label setStringValue:@"Hello World!"];
    [label setFont:[NSFont labelFontOfSize:20]];
    [label setAlignment:NSCenterTextAlignment];
    NSView *contentView = [self.window contentView];
    [contentView addSubview:label];
    @end
    If I needed to develop a worst case scenario for this thread, the next question would be, "Ok sure, but your code still needs a nib to start up. I want to see a Cocoa GUI program that doesn't require any nib".
    It turns out that it's quite easy to build a simple iPhone app without any nib, but it's considerably more difficult for an OS X app. If anyone wants to see my nib-less iPhone code, I'll be happy to post it (I think I did post it here once before, and the response was underwhelming). But I've never attempted the much more difficult nib-less OS X app. Just in case you really want to go there, here's a blog that goes into the details: [http://lapcatsoftware.com/blog/2007/07/10/working-without-a-nib-part-5-open-re cent-menu>.
    Hope some of the above is helpful!
    - Ray

  • Problem while determining receivers using interface mapping: "SYSTEM FAILURE" during JCo call. Bean SMPP_CALL_JAVA_RUNTIME3 not found

    We have a SOAP to PROXY scenario Which is in Production.
    We keep getting the Error:
    " Problem while determining receivers using interface mapping: "SYSTEM FAILURE" during JCo call. Bean SMPP_CALL_JAVA_RUNTIME3 not found on host XXXXXX, ProgId =AI_RUNTIME_XXX.
    We are using Standard Receiver Determination with single receiver without any condition. And no mapping being used in interface determination.
    What are all the possible situation where we face such as this issue in Production.

    Please check the SAP note
    # 1706936 - messages fails with error java.lang.RuntimeException Bean SMPP_CALL_JAVA_RUNTIME3 not found
    1944248 - PI unstable due to JCO_SYSTEM_FAILURE mapping issues

  • Why to use Interface if methods are not implemented??

    Hello,
    I am having a problem to clearify as, why to use the interfaces which defines only methods and no implementation??
    When a class implements an interface the methods are implemented by the class itself, don't you think that the same functionality can be achieved if the class defined the method itself...
    The why to use interfaces, just that the same method name can be used by many classes or some other reasons..

    did you google on that? There is lots of information I am sure explaining why you code to an interface defined type rather than a class defined type.
    However, fundamentally you are correct, classes define their own type. The idea is that you use an interface because it allows you to have more than one implementation. Plus you can more easily change the structure of your program if you later wish if you did not use the class type directly.
    You get better answers if you ask in the Patterns forum below.

  • Loading metadata into EPMA applications using Interface tables-Automation

    Hi,
    I am loading the metadata into epma applications using interface tables as ODI dont perit to load metadata into epma applications. Is there any way of using ODI and interface tables together to load the metadata
    This process also need to be automated.

    Hi,
    It is certainly possible and has be done, though there is not anything available that will do it for you, you will have to put in some effort learning the structure of the interface tables, then build interfaces and then a package in ODI to streamline the process.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Using interface builder to create a table view and add a cell

    So I am using interface builder to make a table view. Should be easy. I drag a table view controller to my view, then it seems I should be able to drag a table view cell to the table view but it won't let me drop it down. If I do it in the documents window it just replaces the table view with a cell. Seems like this shouldn't be hard, but it's one of those things that should take 2 seconds but I have been messing with it for hours. It seems like most of the examples I have looked at in the same code don't use iB so I haven't found a good reference. If somebody can point me in the write direction let me know.

    I struggled a bit too. Here's what I did on my recently completed app. I used IB to create the basic view and add the table. That's it. Then ensure your UIViewController based class implements the UITableViewDelegate and UITableViewDataSource protocols. Your cells will come from those methods, not anything you do in IB.
    If you're creating a set of screens that just have tables that allow you to navigate up and down through the data then IB isn't worth using at all.
    Just have your views extends UITableViewController and follow some of the supplied table based example apps.
    I rewrote my first app 3 times as I slowly figured all of this out.
    Hope that helps.

  • When should I use abstract classes and when should I use interfaces?

    Can any body tell me in which scenario we use /we go for Interface and which scenario we go for abstract class, because as per my knowledge what ever thing we can do by using Interface that thing can also done through abstract class i mean to say that the
    behavior of the two class.
    And other thing i also want to know that which concept comes first into the programming abstract class or Interface.
    S.K Nayak

    The main differences between an abstract class and an interface:
    Abstract
    An abstract class can contain actual working code (default functionality), and can have either virtual or abstract method.
    An abstract class must be sub-classed and only the sub-classes can be instantiated. Abstract methods must be implemented in the sub-class. Virtual methods may be overridden in the sub-class (although virtual methods typically contain code, you still may
    need/want to override them). A good use for an abstract class is if you want to implement the majority of the functionality that a class will need, but individual sub-classes may need slightly different additional functioality.
    Interface
    An interface only contains the method signatures (method name and parameters), there is no code and it is not a class.
    An interface must be implemented by a class. An interface is not a class and so it cannot be sub-classed. It can only be implemented by a class. When a class implements an interface, it must have code in it for each method in the interface's definition.
    I have a blog post about interfaces:
    http://geek-goddess-bonnie.blogspot.com/2010/06/program-to-interface.html
    (sorry, I have no blog posts specific to abstract classes)
    ~~Bonnie DeWitt [C# MVP]
    http://geek-goddess-bonnie.blogspot.com

  • What is the advantages of using Interface?

    Hi,
    I still don't get what's the advantages of using interface. Reusability? is it the main advantage? thanks in advance.

    What is GOF?
    Interface is a good program practice when working with RMI (Remote Method Invocation) application. Imagine your anti-virus. When you connect to internet your software invoke a method into your software vendor site and download the new definitions. Now every anti-virus Subscription is different. The method you invoke, will depends on your Subscription. If you hard code the method abstractly, you will not achieve this functionality.
    Another concept is that because Java does not practice multile inheritance interface is a goog way to interface into another class.
    Example
    I want to extends to multiple class which java do not support. I will write an interface i.e I want to extends to FileOutputStream, OutputStream, Object, Integer, String, ActionEvent, Window etc.
    I will write an interface like this
    interface MyClass {
    pulic void setFileOutputStream ( FileOutputStream file );
    public void setOutputStream ( OutputStream );
    public Object getObject ( );
    public Seriable getInterget ( )
    ------------------- //You get the gist
    With this interface you can implement they behaviours
    You could say, why don't we just import them. When yo import them you have already hard coded there behaviour. But this way you can apply diferent behaviour throughout you application development. And any class that implement them must provide ways of using it.

  • Create session bean using interfaces, not implementation classes

    Hi,
    I'm using interfaces and session beans for my persistence/data layer in my adf application.
    I've created a data control for my session bean and during creation of this data control, javabean.xml files are created for the different interfaces that are used in my session bean.
    If I create bindings on these methods, interfaces in jspx-documents I will get errors because he can't find the impl-classes that implement these interfaces.
    When using interfaces in your session bean (as return values or parameters) instead of classes you need to manually create javabean.xml files for the implementation classes.
    It's required by the databindings/datacontrol that the implementation-classes are described in a javabean-format as well? Is this a spec we need to adhere to?
    Could someone verify that you need to create javabean.xml-files for as well the interfaces as the classes when you're working with interfaces in your session beans?
    regards,
    Nathalie

    A patch was released by Oracle to be able to work with Interfaces and so it's not required to work with implementation-classes.
    Patch for 5726754(Base bug 5657179)

  • Share context between two DC:s, use Interface controllers or not?

    Hi, I'm trying to decouple an application which fetches its data though a webservice, which is about to change. So I want to have all the logic that fetches the data in a separate DC, so I can change the fetch-logic and not change anything in the display logic.
    My question now is how this is done in a proper way.
    I realized that I can add the Component Controller of A (the fething DC) in its "public parts", and then in DC B add A in the "Used DC" part, and then add the exposed Component Controller from A in B:s "Used Web Dynpro Components". However I was led to believe that I should use interface for this kind of usage.
    With the usage lined out above, I do not use any Interfaces at all!
    So bascially, should I use any interfaces in DC A, if so are there any advantages of doing so over just adding the Component Controller to the public part of the DC?
    /Best regards, Bjorn Bergenheim

    Hi Bjorn Bergenheim,
    1.) If you add the Web Dynpro Component of the child DC to the public part then internally the Interface Controller of the Child DC will also added to the Public Part.
    2.) Then you have to Reload + Rebuild and Build your Child DC.
    3.) Go to Parent DC add Child DC to Used DCs, Reload + Rebuild and Build your Parent DC.
    4.) In the Parent DC --> Right Click on Used Web Dynpro Components --> Add Used Component --> External Window Appears --> Click on " Browse " Button for Used Web Dynpro Component --> Select Child DC's Component Controller  ( It Internally adds Child DC's Interface Controller itself to the Parent DC's Data Modeler )  --> Reload + Rebuild and Build your Parent DC .
    5.) Create Mappings acc. to your Requirement.
    I think Point No. 4 Solves your Problem.
       If you have still any Doubts Post them Clearly for Quick Reply.
    With Regards,
    Roop Kumar.

  • Why not use interfaces for constants?

    Hi,
    I have been getting conflicting views about why not use interfaces for constants?
    Can anyone shed some light on it?
    Piyush

    How so?
    If the constants are only used in a single classhow
    does it help to put them in a separate structute?
    (Ignoring the a type safe enumeration of course.)Well, mainly for readability. Suppose that you have a
    web application which has a servlet class
    "RedirectServlet", which takes a variable to redirect
    to a given JSP file. In the JSP files, you want to
    create forms which take this servlet as their action.
    You could of course put all these "redirect"
    constants in the RedirectServlet itself, but then
    it's kind of weird that you have to import a
    servlet in your jsp file to include these constants
    and to be able to write
    <form action="servlet/RedirectServlet?key=<%=
    RedirectServlet.HOMEPAGE %>> or so.
    Instead, you could create an interface called
    "RedirectConstants", and then your servlet
    RedirectServlet could implement this interface. Then
    your JSP can also access these constants via this
    interface.
    But then again, this is merely a matter of style, I
    fully agree that there is never a real _need_ to put
    constants in a separate structure if they're only used
    in a single class.Are you claiming that your example above is a single class?

Maybe you are looking for

  • Should the Goods Receipt Inventory Transaction include Item Cost selection?

    When processing a Goods Receipt inventory transaction, the Price List pull down does not display "Item Cost" as a selection. The user can make the Unit Price field visible and active, compare the cost displayed from the Price List selected to the cur

  • Data from excel to table

    DB:10.2.0.4 can any one help me to know how to insert the data from excel to a table? Regards, BK

  • Could you help me verify the authenticity of this disk?

    Yes, I bought photoshop on ebay. Yes, it was stupid. Yes, I've read the mega sticky on how insane it is. Let's just say I was drunk that day. Anyhoo, I want to make sure that this copy is definitely pirated before I go after this guy. Just wanted to

  • Upload image from server in jdev release2 11.1.2.4.0?????

    HI i am using jdev 11.1.2.4.0 my requirments are 1.upload image from server 2.display image and edited by using editor page like paint. 3.save that edited copy also i am new i jdev,is this requirements are done by jdev,please help,i dont have any ide

  • File-opening glitch in CS5.5

    After installing CS5.5 (Design Premium), attempting to open an InDesign file (double-click, drag icon over icon, or from File Menu) causes ID CS5.5 to freeze up, the file does not open, and a Force Quit is necessary. This only happens when ID is alre