Brief conclusion of Boss class and there interface concept or basic programming architecture ?

I am new in this indesign development so i am studying the  documentation provide by sdk till date i think lots of concept are clear to me but still while doing practicle implementation many concept intermixed in my mind .one of them is "command" .so please tell me in brief about it with practical example of creating new document having text frame in indesigen using it .also there are  lots of question in my mind  regarding interface and boss class anyone please share there knowledge regarding them in brief

Due to a copy/paste glitch, some necessary spaces have inadvertently been removed.  If I could fix this, I would.

Similar Messages

  • What is the diff b/w Abstract class and an interface ?

    Hey
    I am always confused as with this issue : diff b/w Abstract class and an interface ?
    Which is more powerful in what situation.
    Regards
    Vinay

    Hi, Don't worry I am teach you
    Abstract class and Interface
    An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract. An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private, protected, etc.), but has some abstract methods.
    Edited by SASIKUMARA
    SIT INNOVATIONS- Chennai
    Message was edited by:
    sasikumara
    Message was edited by:
    sasikumara

  • Newbie - Boss classes and interfaces

    I'm currently going through Kris Coppieters' "Adobe InDesign CS3/CS4 SDK Programming Getting Started" book and I'm stuck at one of the exercise (11.9) It asks me to create a new boss 'kIDSDKTrainerBoss' which aggregates 2 interfaces 'ISDKTrainerName' and 'ISDKTrainerBlob'.
    Now here is what I added in my .fr file:
    Class
            kIDSDKTrainerBoss,
              kDialogBoss,
                IID_ISDKTRAINERNAME, kISDKTrainerNameImpl,
                IID_ISDKTRAINERBLOB, kISDKTrainerBlobImpl,
    First of all I'm not quite sure about the interface IDs. Are IID_ISDKTRAINERNAME and IID_ISDKTRAINERBLOB suitable?
    What are the files that I need to create? I guess there will be a ISDKTrainerName.cpp and ISDKTrainerBlob.cpp but apart from those?
    How to know which parent Boss ID to use? Here I've put kDialogBoss, but that was just to mimic the other bosses in the .fr file.
    Is there somewhere where I can get the source code with the solution, it's not in the zip file provided along with the book?
    Thanks in advance for your help
    -- Bastien

    Hi Bastien,
    Instead of using kDialogBoss, you should use kInvalidClass. That means 'this boss does not have a superclass at all' - making it a 'root boss class', which does not inherit from anything.
    The goal of the exercise is to build a totally new, detached boss class - something that's not tied into any other boss classes in the InDesign ecosystem.
    The interface IDs are whatever you want to make them - the ones you have there are fine, but you can make something else up. The main thing is to try and follow the convention - but also realize that it's only convention. If you wanted to you could use IID_BOBTHEBUILDER and IID_THOMASTHETANKENGINE. By convention, you'd then probably name the implementations kBobTheBuilderImpl and kThomasTheTankEngineImpl
    Define those IDs in your ...ID.h file - they're yours, and you're the master and decider of how you call them - whether it's IID_ISDKTRAINERNAME or IID_BOBTHEBUILDER.
    For a clue on the source code file names - look at the figure on page 120 - that sample uses IID_ISOMETHING and IID_ISOMETHINGOTHER as 'silly' names, and also shows the names of the source code files that by convention would go with them.
    Cheers,
    Kris

  • How to RMI Classes and sigar interface

    HI all,
    Actually i want check CPU usage and i am using sigar api for this..
    i made a class using sigar api and now i want to use that class in RMI but i don't know to use that class in RMI concept.
    i just want to use that class which shows CPU usage in RMI classes which i will make..
    thanks

    HI all,
    Actually i want check CPU usage and i am using sigar api for this..
    i made a class using sigar api and now i want to use that class in RMI but i don't know to use that class in RMI concept.
    i just want to use that class which shows CPU usage in RMI classes which i will make..
    thanks

  • When we will go for an abstract class and when we will go for an interface?

    it's always some what confusing to choose an abstract class and an interface,can anybody post a suitable answer for this.

    jwenting wrote:
    with experience and the insight it brings, you will know which to use when.
    Without it, it can't be explained.
    More often than not there's no X OR Y anyway.It's fortunate that there are posters here who possess the insight and experience necessary to explain this. The principal differences between an abstract class and an interface are,
    1. An abstract class can carry implementation, whereas an interface cannot.
    2. An abstract class is singly inherited, wheras an interface is multiply inherited.
    So use an abstract class when the implementation it can carry outweights the fact that it cannot be multiply inherited That's the gist of it.
    The inheritance relationship where this happens is when the supertype is a general concept of which all potential subtypes are special cases. This is called a specialization (or sometimes a generalization) relationship. For example Apple and Banana are Fruit. Or Car and Bike are Vechicle. The Fruit and Vechicle supertypes are general concepts of which their subtypes are special cases. In this case make Fruit and Vechicle abstract classes because the subtypes will benefit from a shared implementation.
    If you don't have a clearcut specialization/generalization relationship make the supertype an interface. An example could be the Comparable supertype. The potential subtypes aren't supposed to be specializations of the Comparable concept, they're suppose to become Comparable (and make this property an integral part of their being). This is not a specialization/generalization relationship. Instead the supertype is intended to add character to the subtypes. The subtypes are unlikely to benefit from an inherited implementation. So make Comparable an interface.

  • 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

  • Abstract class and interface having same method

    Hello,
    Here is my problem. Suppose we have one abstarct class and one interface.Here is code-
    //Abstarct class
    abstract class X{
    abstract void myMethod();
    //Interface
    public interface Y{
    abstract void myMethod(){}
    Now i have a class which extends both abstarct class X and interface Y.
    If i call myMethod() from this class. Whose myMethod would be called.Will it be of abstract class or interface?
    Many Thanks

    Hello,
    Here is my problem. Suppose we have one abstarct class
    and one interface.Here is code-
    //Abstarct class
    abstract class X{
    abstract void myMethod();
    }OK, so far...
    //Interface
    public interface Y{
    abstract void myMethod(){}
    }An interface cannot have code (the {} part), so this won't work.
    Lets pretend though, it read
    //Interface
    public interface Y{
    abstract void myMethod();
    However, the abstract class above can have code;
    If you extended X and implemented Y (with no code in it), you would have to have a myMethod() implementation in your code. That's the one that would run.
    Now, let's pretend the abstract class above did have code in it.
    //Abstract class
    abstract class X {
    abstract void myMethod() { System.out.println("Hello"); }
    Then, you wouldn't have to have a myMethod() implementation in your class which extends X and implements Y (it's defined in X). If you didn't have one, the method in X would run. If you defined your own myMethod() implementation in your class (which extends X and implements Y), then your own implementation would run.

  • Upgrade labview project that has classes and subVi's

    We have a  LabVIEW  project in LV 8.5( freated by a different developer) that has classes, and various Vi's , subVi's.
    I am looking to upgrade it to LV 2014.  To be safe, I wanto to copy everthing into new classes( renamed from old ones), rename all the Vis( I hav ealready done that in Windows explorere, though not yet added them to project), and use them with renamed subVI's.
    The old classes and VI's should remain in the same folder. 
    What is best way to do that?
    I found something here
    https://lavag.org/topic/17741-the-nightmare-that-is-renaming-a-class-and-its-folder/
    but this basically suggests many methods, and then, would delete the old structure.
    Also, what happens to the "controls" that show up under "private" folder?
    I have never worked with LV classes, so pardon any lack of knowledge.
    sed_y

    4) All the subVI's that are being used and reside in different directories, will be made copy of into their own subdirectories, with the originals zipped.
    That's the one you need to be careful of. If you have any shared code or re-use libraries outside of the project folder then these will get loaded and saved in LV2014. Use the 'files' tab of the project folder to see which files aren't in your project subdirectory.
    Anything that is in user.lib you can copy from the 8.5 user.lib to the LV2014 user.lib folder and your project will automatically find them.
    There are some useful tips here about working with LabVIEW projects and keeping all of your code in sensible locations. Anything relating to your project should be within the project subfolder and any shared code should go in the respective user.lib/vi.lib of the appropriate LabVIEW version - this does mean that you have a copy of the VI for each version of LabVIEW so you will need to be careful about making sure if you change it in one version you change it in the other. Even better still is to make your shared code into VI packages - then you can install them for any LabVIEW version and it will automatically save/compile them for the appropriate version. We used to have all of our re-use code in user.lib but it made moving between LabVIEW versions a pain so we started using VI packages and haven't looked back.
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets

  • A question about class and interface? please help me!

    the following is program:
    interface A{
    public class B implements A{
    public static void main(String [] args){
    A a = new B();
    System.out.println(a.toString());
    }i want to ask a question, the method toString() is not belong to interface A, why a can call method toString()? the interface call the method that isn't belong to, why? please help me...

    because a.toString() call the method toString() of class Object because B implements A, but extends Object and in the class Object there is a method toString(). infact if you override the method toString() in class B, a.toString() call toString() in class B.
    try this:
    interface A {}
    public class B implements A
      public String toString()
        return "B";
      public static void main(String [] args)
        A a = new B();
        System.out.println(a.toString());
      }by gino

  • Compiling Nested Classes and Interfaces

    I am looking for documentation about compiling nested classes and interfaces. I have found something in the JVM Specification, but there does not explain how a nested class is compiled and what is included in the top level class to mark a "place holder" to the nested class. The JVM Specification in this topic cite the web page http://java.sun.com/products/jdk/1.1/docs/guide/innerclasses/spec/innerclasses.doc.html that does not exists any more.
    My root problem is that: I am compiling a class with a private nested class, but in the class file generated TopLevelClass$NestedClass.class the class does not have the private modifier. So I am not understanding why the "private" modifier was removed during compilation.
    I performed the same test with a protected nested class and the result was the nested class with the public modifier. So I am not understanding why the "protected" modifier was changed to "public".
    Thanks in advance,
    Mardoqueu.

    This should not be happening. What compiler are you using? If it's a reasonably recent Sun compiler, could you post a minimal example?

  • Abstract classes and Interfaces

    Why would you use these? Why not make a concrete class and extend them? I see why JAVA doesn't use mutiple inheritance but I don't see how allowing interfaces correctes that, after all what happens if two interfaces implemented by one class have two fully defined methods with the same signature but differant outputs?
    I tryed googleing this but just got articles on when to use Abstract over interface and interface over abstract, which should have helped some but it didn't.
    Can someone explain or post a link for a good example.

    Why would you use these? Why not make a concrete
    class and extend them? Check out the JDBC interfac (java.sql package).
    The core Java API defines what types and methods it wants to use for DB interactions. But because every DB and driver is so different, there's no concrete implementation that the core API could provide for those types. It's up to the vendors to provide all the "how"--all the concrete implementations of the methods.
    interfaces correctes that, after all what happens if
    two interfaces implemented by one class have two
    fully defined methods with the same signature but
    differant outputs?That rarely happens (it has never happened to me in about 8 years of Java programming) and if it does, you just have to find a different approach--you can't meet both contracts.

  • Comparison between constants in class and interface

    Hi,
    I have recently read an article which says it is a better use of your memory if you declare constants in an Interface rather than in a Class. Can any one explain this is more detail? Have a great day.
    Thank you,
    npaila

    @ricardo_moral
    Hm ...
    we are talking of constants in this topic - constants are always final, otherwise it would not be garanteed, that they cannot change. Also we are not talking of holding a copy of this constant field in a class, we are talking of directly referring to this static final field, regardless if it is declared in an interface or in a class.
    I prefer using an interface - my reason is that I can use it the same way, I can use a class, which declares this constant - via qualifier - AND I can implement it, if I want to - so, I follow the swing route and declare constants, which are shared by many classes, in an interface - but I implement it only there, where these constants are heavily used.
    greetings Marsian

  • Question about Classes, Abstract  Classes and Interfaces.

    I have been experimenting with Classes, Abstract Classes and Interfaces and wonder if anyone can explain this to me.
    I was looking for a way to assign a value to a variable and then keep it fixed for the session and have devised this.
    First I create an abstract class like this:
    public abstract class DatabaseConnection {
    private static String ServerName = null;
    public static void setServerName(String serverName) {
              ServerName = serverName;
         public static String getServerName() {
              return ServerName;
    }and then I created an interface
    public interface DatabaseAccess {
         String servername = DatabaseConnection.getServerName();
    }And finally the class itself with some test lines in it so I could see what was going on:
    public class CreateDatabase extends DatabaseConnection implements DatabaseAccess {
         public static void main (String args[]){
              new CreateDatabase();
         public CreateDatabase(){     
              setServerName("Server Name 1");
              System.out.println ("Before update ");
              System.out.println ("ServerName from Interface           = " + servername);
              System.out.println ("ServerName from Abstract Class = " + getServerName());
              System.out.println ("After update ");
              setServerName("Server Name 2");
              System.out.println ("ServerName from Interface           = " + servername);
              System.out.println ("ServerName from Abstract Class = " + getServerName());
              System.out.println ("==========================");
    }The output I get from the above is:
    Before update
    ServerName from Interface           = Server Name 1
    ServerName from Abstract Class = Server Name 1
    After update
    ServerName from Interface           = Server Name 1
    ServerName from Abstract Class = Server Name 2
    ==========================I also tried this in another class which calls the above class to see if I get the same effect
    public class CheckDatabaseAccess {
         public static void main (String args[]){
              new CreateDatabase();
              CreateDatabase.setServerName("Server 3");
              System.out.println("CreateDatabase "+CreateDatabase.servername);
              CreateDatabase.setServerName("Server 4");
              System.out.println("CreateDatabase "+CreateDatabase.servername);
              CreateDatabase.setServerName("Server 5");
              System.out.println("CreateDatabase "+CreateDatabase.servername);
    }The output of which is this:
    Before update
    ServerName from Interface           = Server Name 1
    ServerName from Abstract Class = Server Name 1
    After update
    ServerName from Interface           = Server Name 1
    ServerName from Abstract Class = Server Name 2
    ==========================
    CreateDatabase Server Name 1
    CreateDatabase Server Name 1
    CreateDatabase Server Name 1Can anyone explain why I appear to only be able to change or set the ServerName only the once?
    Is this the correct way to do it? If it is it's exactly what I am looking for, a way to set the value of variable once in a session and then prevent it being changed.
    Or is there a better way of doing this.
    What I want to use this for is for example, storing the accesses to a database on a server. I won't know what server the database will be stored on nor what the database is called so I create an INI file which stores this information in encrypted format, which is set by the database administrator. It occurs to me I can use this method to then retrieve that data once and once only from the INI file and use that throughout the life of the session to access the database.
    Any help appreciated
    Regards
    John

    Not gonna read all of it, but this jumps out:
    public abstract class DatabaseConnection {
    private static String ServerName = null;
    public interface DatabaseAccess {
         String servername = DatabaseConnection.getServerName();
    }You have two completely separate variables (with two different names, for that matter, since you were inconsistent in your capitalization, but it wouldn't make a difference if they did have the same name with the same case). And the one in the interface is implicitly public, static, and final.
    Anytime you refer to "servername" through a reference of type DatabaseAccess, it refers to the one declared in the interface.
    Anytime you refer to "ServerName" inside the DatabaseConnection class, it refers to the one declared in that class.

  • Difference between abstract classes and interfaces

    I actually wonder about what are the differences between abstract classes and interfaces may somebody give an example code about it?
    and i have one more question how can i use interfaces like multiple inheritance ? i mean when i implement an interface like
    class a extends b implements c,di have to use all c and d methods but what that methods means?
    I mean as i know we cannot make implementations of methods in interfaces
    but for example in runnable interface there is a method like run() and it has been defined somewhere because it knows what to do(i mean when it will run), i just write my code into that method .

    Once you get past the starting point (I am referring to the OP here), there are a few salient differences:
    You can only extend (or generalize) a single superclass; however, you can implement (or realize) multiple interfaces. As such, all things being equal, using an interface in lieu of an abstract class 'frees' your design. Later, if you want the implementor of an interface to inherit from another class, there is not issue.
    Any abstract method specifies a contract. However, abstract classes allow you to also add common behavior to subclasses. This is an overused justification for abstract classes, IMO. You can achieve the same effect using delegation and still having interfaces.
    Always program to interfaces wherever possible. This means that you define an interface and have an implementing class (usually at a minimum). Do not do this for all your classes, but rather the ones that make your system unique (the domain model or M in MVC architecture). This allows you to later change implementation with a minimal amount of refactoring. This is a core precept from the Group of Four and any number of decent programming books.Best of luck.
    - Saish

  • Is there any statement to indentify if a class implements an interface?

    Is there any statement to indentify if a class implements a particular interface?

    If you want to check if a class implements an interface, look up the interface here:
    http://java.sun.com/j2se/1.4.2/docs/api/index.html
    and look under "All Known Subinterfaces:"
    If you want to check if an object is of that interface:if(yourObject instanceof SomeInterface)
        // do something
    }

Maybe you are looking for