Ways to implement factory pattern

Hi I have following implmentation to factory
Method 1:
interface Product(){
public void method();
interface Factory(){
public Product createProduct();
class ConcreteProduct1 implements Product{
public void method(){
System.out.println("Concrete Product 1");
class ConcreteFactory1 implements Factory{
public Product createProduct(){
return new ConcreteProdct1();
}similarly ConcreteFactory 2 & 3
in mainclass we create as
Factory f = new ConcreteFactory1(); Product p = f.createProduct();Method 2:
Product creation as above and factory comes below as
public class Factory{
public Product createProduct(int type){
if(type == 1)
return new ConcreteProduct1();
else
return new ConcreteProdct2();
return null;
}main class comes as
Factory f = new Factory();
Product p = f.createProduct(1); which implementation is better and how?
Thanks,..

You should absolutely use method 1 because it is more object oriented and you don't have to keep track of a type key (if you DO should it then be implemented as an enum and not as an, ughh, int!). Actually, you may also extend the first solution with more products and concrete factories without access to the source as you just need to implement the interfaces. You don't need to edit the factory class that use type keys to track which product type to instantiate.
Well, this is at least my opinion and it is built on what I have learnt so far from reading the two good books Effective Java Programming Language Guide of Joshua Bloch and Refactoring of Martin Fowler. If you want to learn more about good use of Java and good object oriented design in practise are these books you should read.

Similar Messages

  • Designs for interface/implementation factory APIs

    I've been building a complex data store for geographical information based on JNDI.
    The store is basically working but I've been trying to make the API for programs accessing it more regular.
    I'm dissatisfied with the way that new objects for addition to the store are instanciated. It's all a bit ad-hoc at the moment so I want to create a proper factory system, separating interface from implementation and allowing for the case where the interface has a different implentation for remote and local contexts.
    I'm thinking the best approach would be to have a single create method, probably as a member of the extended context interface.
    What I want to get is a sample of how programmers feal about different methods of passing creation parameters to such a factory method (or for that matter, to invite comments on the basic idea).
    One possibility would be as a Hashtable or Hashmap. Generic keys (like datastore path) would be defined as constants in the context or factory interface, type specific keys in the interface which is used to access the object being created.
    e.g.
    Hashtable fsCreate = new Hashtable(5);
    fgCreate.put(DataContext.PATH_KEY, "test.features");
    fgCreate.put(DataContext.FORMAT_KEY, format);
    fgCreate.put(DataContext.BOUNDS_KEY, boundaryRectangle);
    FeatureSet fs = (FeatureSet)dataContext.create(FeatureSet.TYPE_VALUE,fsCreate);Another possibility would be some kind of parameter bean, with an fundamental parameter class and different extensions for each type of object to be created.
    FeatureSetParams fsCreate = new fsCreate();
    fsCreate.setPath("test.features");
    fsCreate.setFormat(format);
    fgCreate.setBounds(boundaryRectangle);
    FeatureSet fs = (FeatureSet)dataContext.create(fgCreate);The Hashtable method has a slightly clumbsy feel, but it does avoid directly instanciating a whole bunch of new concrete classes (which seems to go against the spirit of interface/implementation separation).

    If there's a create method in the interface, wouldn't
    that make it accessible from anything that knows about
    the interface? This would nullify the factory
    pattern, wouldn't it?Not necesasrilly, that would depend how the create method was implemented. I already have a "retriever" object associated with each implentation class that can be retrieved from the data store. I can add a "create" method, effectively adding a factory class function to these. These retrievers are already registered with the concrete implentation of the JNDI Context.
    Granted the implentations are in several different packages, so I can't restrict acces to these retriever objects to the package level.

  • Factory Patterns with Generics

    I am trying to combine the good old factory pattern with generics and could use some advice.
    I have the following
    //Base class from which all my things extend
    public abstract class Thing {
    //one kind of thing
    public class ThingOne extends Thing {
    //another kind of thing
    public class ThingTwo extends Thing {
    //interface for my factory
    public interface ThingFactory<T> {
    public T create(long id);
    //a factory for thingones
    public class ThingOneFactory<T> implements ThingFactory<T> {
    public T create(long id) {
    return (T) new ThingOne();
    public class TestClass{
    public <T extends Thing> T getThing(ThingFactory<T> tf){
    //do a bunch of generic stuff to figure out id to call create
    ThingFactory<T> instance = tf;
    return (T) instance.create(Long id);
    }My calling code would know what kind of thing it needs but necessarily the things id. Which can be computed in a generic way.
    TestClass gt = new TestClass();
    gt.getThing(new ThingOneFactory<ThingOne>());This all seems to work properly but I am getting "Type safety: Unchecked cast from ThingOne to T" in my ThingOneFactory
    My T's will always extend Thing, what am I missing? Is there a better way to do this?
    Edited by: nedry on Dec 29, 2009 5:39 PM

    I thought of that after I posted. But that just moves my unsafe cast warning into TestClass.Why?
    return (T) instance.create(Long id);That can't have ever compiled. What is the exact code? And why did you have to cast (what was the warning/error)?

  • Builder vs Factory Patterns

    Hi,
    I read about builder and factory patterns. But both of them look quite similar.
    Can u plz help me to understand the difference between them.
    Thanking You,
    Chamal.

    I puzzled over this too. The UML is almost identical for both patterns. A great example of how UML class diagram leave a lot to be desired.
    This is my take, which may not be absolutely correct or orthodox.
    The difference is that in the abstract factory, the point is to hide the implementation of the abstract type. In the builder it's other way around. The point is to hide the implementation of the callers of the builder or really, what is being built.
    So a user of a abstract factory should not know (or care) about what type the abstract factory returns. In the builder pattern, the code could potentially make references to specific builder types (a text builder for debugging or console mode, for example) but the implementation of what is being built is not known to the builder.
    You can easily combine the two and get a lot of flexibility.

  • Implementing Factory/Singleton in Java?

    Hi, I am doing a program and was told to do one of the classes as Singleton as it should only run once. This I have no real problem with and I did it. I was then told that the spec may change so I should do a Factory pattern on that same class so that further implementations can be added later.
    For sanity reasons, I decided to remove my singleton, add the factory pattern and then put in the Singleton again. Now I have done the Factory pattern and looking at it, I am unsure where to put the singleton. Should I put it in the factory class or originally where I put?
    I am trying each way but am getting visibility issues so I think it is best to ask before trying to resolve the errors.
    Thanks a lot
    Sunny

    I'm not sure what class you're taking.
    Singleton doesn't mean "run once". It means "only one instance", hence the name. Doesn't "several different implementations" fly in the face of "only one instance"? It does to me.
    %

  • Displaying Multiple Values on GUI components - best way to implement

    Hi,
    my program needs to implement a basic function that most commercial programs use very widely: If the program requires that a GUI component (say a JTextField) needs to display multiple values it either goes <blank> or say something more meaningfull like "multiple values". What is the best way of implementing it?
    In particular:
    My data is a class called "Student" that among other things has a field for the student name, like: protected String name; and the usual accessor methods (getName, setName) for it.
    Assuming that the above data (i.e. Student objects) is stored in a ListModel and the user can select multiple "Students", if a JTextField is required to display the user selection (blank for multiple selections, or the student "name" for a single selection), what is the best (OO) way of implementing it? Is there any design pattern (best practice) for this basic piece of functionality? A crude way is to have the JTextField check and compare all the time the user selections one by one, but I'm sure there must be a more OO/better approach.
    Any ideas much appreciated.
    Kyri.

    Ok, I will focus on building a solution on 12c.
    right now I have used a USER_DATASTORE with a procedure to glue all the field together in one document.
    This works fine for the search.
    I have created a dummy table on which the index is created and also has an extra field which contains the key related to all the tables.
    So, I have the following tables:
    dummy_search
    contracts
    contract_ref
    person_data
    nac_data
    and some other tables...
    the current design is:
    the index is on dummy_search.
    When we update contracts table a trigger will update dummy_search.
    same configuration for the other tables.
    Now we see locking issues when having a lot of updates on these tables as the same time.
    What is you advice for this situation?
    Thanks,
    Edward

  • Implementing DAO Pattern in ABAP

    This discussion implement DAO pattern asked the question of how to develop a DAO pattern in ABAP but i'd like to go a little deeper.
    The only answer given suggested the following design pattern:
    I don't have an coded example here, but isn't it sufficient for this pattern  to build an interface with some get- and set-methods? This interface can be implemented by several classes with different data retrieval logic. Then a static factory-method could do the job to decide during runtime which actual class is instantiated, returning the interface.
    Can anyone give an abstract description of this implementation relative to an SAP module (How would one approach this implementation in MM, PM, FICO, HR)
    Can anyone see any issues in this design?
    Can anyone provide an alternate design?
    Are we missing any steps?
    Together we can build a solid abap DAO everyone can use.

    I started to read about DAO pattern some days ago and found this great blog post:
    ABAP Unit Tests without database dependency - DAO concept
    I am starting to implement unit test in my developments and DAO pattern seems to be a clever choice.
    Regards,
    Felipe

  • Display Server Name on the title of the WINDOW : Best Way to Implement

    our weblogic is deployed in a clustered environment(group of weblogic instances)(say for eg) Server01,Server02,Server03). Every time the request will go to any one of the weblogic instances. Now i need to display the server name on the title of the IE window.
    Web Application : - Server02(request 1)
    Web Application : - Server03(request 2)
    For that i've followed the following approach.
    <filter>
    <filter-name>AppFilter</filter-name>
    <filter-class>com.src.app.AppFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>AppFilter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    All request will go thro' the filter.
    In filter, dofilter method of AppFilter, set the server name as below.
    request.setAttribute("HOSTNAME", (" " + InetAddress.getLocalHost().getHostName()));
    In all jsp title,do the following.
    <title>WEB Application <%= request.getAttribute("HOSTNAME") %></title>
    This is working fine. I would like to know, if there's any better way of doing this?

    Thanks for all your replies
    user13118480,
    We have one admin server and 3 managed servers.
    3 managed servers are in different machines(sprd01,sprd02,sprd03).
    we have a big ip configured against these managed servers. we expose only the big ip to the end user.
    Based on load, the admin server will route the request to any one of the managed servers.
    Reason for displaying the server name on window
    The reason for displaying the Server Name (m/c name where managed server is running) on the window , is to help the developers to find out
    the current logs.
    log (app.log - logger file - log4j ) will go to sprd01,sprd02,sprd03.
    now if we display the servername on the window, then we can direct go the machine and look for the logs.
    otherwise,developer has to search for all in all the boxes.(sprd01,sprd02,sprd03)
    Questions:
    --Now i would like here more abt the Host HTTP header.
    *1. is my approach to retreive the host machine name is good? is there any other simple way to get the host name?*
    *2. as per your answer, are you asking me to get the host name from httpheader. request.getRemoteHost()?*
    *3. is there any way i can set the title of the browser window from filter itself instead of setting requestAttribute in filter and reading the same in*
    all the jsp's?
    4. Is there any better way to implement this requirement?
    baftos,
    Reason for using a filter.
    Tomorrow if i dont want to display the machine name in the window,
    then all i need to do , is to change the filter statement as follows, instead of changing all the jsp's.
    request.setAttribute("HOSTNAME", "");

  • Factory pattern question

    Hi, I'm using a factory pattern to return different objects depending on whats needed:
    synchronized Worker getWorker(final byte[] request, String type) {
            int poolIndex = -1;
            for (int i = 0; i < workerCount; i++) {
                if (workerPool[i] == null) {
                    poolIndex = i;
                    if (type.equals("TypeA")) {
                        workerPool[i] = new TypeA(request, poolIndex);
                        workerPool.setType("TypeA");
    } else if (type.equals("TypeB")) {
    workerPool[i] = new TypeB(request, poolIndex);
    workerPool[i].setType("TypeB");
    return workerPool[poolIndex];
    return null;
    My problem is that they return ok, however. If TypeA has a function called Test1. and TypeB has a function Test6. If I try Worker.Test6 it wont recognise it. Is this just my ignorance? Should both just contain the same methods as Worker and override them?

    Hi, I'm using a factory pattern to return different
    objects depending on whats needed:
    synchronized Worker getWorker(final byte[] request,
    String type) {
    int poolIndex = -1;
    for (int i = 0; i < workerCount; i++) {
    if (workerPool[i] == null) {
    poolIndex = i;
    if (type.equals("TypeA")) {
    workerPool[i] = new
    workerPool[i] = new TypeA(request, poolIndex);
    workerPool.setType("TypeA");
    } else if (type.equals("TypeB")) {
    workerPool[i] = new
    workerPool[i] = new TypeB(request, poolIndex);
    workerPool[i].setType("TypeB");
    return workerPool[poolIndex];
    return null;
    My problem is that they return ok, however. If TypeA
    has a function called Test1. and TypeB has a function
    Test6. If I try Worker.Test6 it wont recognise it. Is
    this just my ignorance? Should both just contain the
    same methods as Worker and override them?
    indeed, the factory pattern is intended to shield the user code from implementation details of the returned interface. It (ie. the user code) MUST NOT know about which actual implementations it receives, otherwise, the factory has no use.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • LVOOP Factory Pattern

    Factory Pattern..
    I am using factory pattern for its advantage of loading classes into memory when it is called dynamically.
    But I am able to see all the classes loaded into memory by looking into LabVIEW Class Hierarchy window and VI Hierarchy window.
    Where this not happen. Please suggest solution for this query.
    nilesh
    Attachments:
    Factory Pattern.zip ‏136 KB

    I'll reply but I am no OOPer expert.
    THe factory pattern as implemented in LV is just anum driven case structure where each case can have a different instance of a class constant. All of the Class constants exit through the same tunnel that LV cast as the common ancestor class of all of the constants in the case structre.
    The exiting wire can be wired to any method available for the common parent class.
    So it is a code construct that lets you choose the type of data on the wire.
    The Actor Frame work is another fancy term for a generic barckground task.
    Actors can be instaciated using using teh Factory Pattern to choose the "flavor" of background task.
    Re: All in memory
    If the classes are in the project and the project is open then all of the classes are loaded to make sure they are healty.
    In an exe that is not always the case as is the situation when the classes are not part of the project or the project is closed.
    This image (and the others in that album) show a method I used to find and use compatable classes to create the background task (Active Object).
    Active Object (as I understand them) are instances of a Class that function indepenently once created and provided a method to allow other objects to invoke its exposed methods.
    Example DAQ_Collector
    Child of an I/O class that runs in the background and acepts commands(invoked methods) like "Start", Stop, Exit.
    I will now step back to let those who know more correct what I havge posted.
    Have fun!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • RMI & Factory Patterns

    Hey,
    I'm developing a Chat RMI app for a college assignment. One of the features that's required is to use the Factory Pattern(FP). I've read about Factory patterns and have a bit of an understanding of them but I'm not sure what I developed actually implements a FP. Would the code below be considered a Factory Pattern?
    I've created an interface class called ChatServer and a class which implements this interface called ChatServerImpl. The server with the main method is as follows:
    public class Server {
      public static void main(String[] args) {
        if (System.getSecurityManager() == null) {
          System.setSecurityManager(new RMISecurityManager());
        try {
          ChatServerImpl server = new ChatServerImpl();
          Naming.rebind("DSChat",server);
          System.out.println("DSChat bound in registry");
        catch (RemoteException remoteExc) {
          remoteExc.printStackTrace();
        catch(MalformedURLException malformedURLExc){
          malformedURLExc.printStackTrace();
      }I have a ChatServer, the interface class, object in the Client UI class that calls the server methods, e.g.
    ClientUI
    public class ClientUI extends JApplet implements ActionListener, ClientMonitor
         ChatServer server;
         public void init()
              try
                   server = (ChatServer) Naming.lookup("//" + getCodeBase().getHost()
                             + "/" + serviceName);
              catch (NotBoundException notBoundExc)
                   notBoundExc.printStackTrace();
              catch (MalformedURLException malformedURLExc)
                   malformedURLExc.printStackTrace();
              catch (RemoteException remoteExc)
                   remoteExc.printStackTrace();
         public void start()
              try
                   authenticate = server.authenticate(sessionUser);
              catch (RemoteException remoteExc)
                   remoteExc.printStackTrace();
              if (authenticate)
                   this.componentInit();
                   this.layoutComponents();
                   try
                        UnicastRemoteObject.exportObject(this); // Allow server to
                        // connect.
                        server.registerClient(this);
                   catch (RemoteException remoteExc)
                        remoteExc.printStackTrace();
              else
                   String errMsg = "Sorry you are already logged on to this chat room";
                   JOptionPane.showMessageDialog(this, errMsg, "You're already here",
                             JOptionPane.OK_OPTION);
                   server = null;
         public void actionPerformed(ActionEvent e)
              if (e.getSource() == btnSend)
              {//Checks if textbox is empty
              if (txtInput.getText().compareTo("") != 0)
                   String input = txtInput.getText();
                   txtInput.setText(""); // Clear text field.
                   txtInput.requestFocus();
                   Message msg = new Message(input);
                   server.sendMessage(msg);               
         public void receiveMessage(Message msg)
              // Display received message.
              txtMessages.setText(txtMessages.getText() + "\n" + msg.toString());
              txtMessages.setCaretPosition(txtMessages.getText().length());
    ChatServer Interface
    //Interface
    public interface ChatServer extends Remote{
      public void sendMessage(Message msg) throws RemoteException;
      public boolean authenticate(ChatUser usr) throws RemoteException;
    ChatServerImpl
    public class ChatServerImpl extends UnicastRemoteObject implements ChatServer
         public ChatServerImpl() throws RemoteException
              super();
         public boolean authenticate(ChatUser usr) throws RemoteException
              ClientMonitor client = registeredUsersTMap.get(usr.getUsername());
              if (client == null)
                   return true;
              return false;
          * ChatServer interface method implementation. Sends messages between two
          * users.
         public void sendMessage(Message msg) throws RemoteException
              //Thread sends message to client
              SendMessageThread sendMessage = new SendMessageThread(
                        this.roomUsersHMap, this.registeredUsersTMap, msg);
              Thread tSendMsg = new Thread(sendMessage);
              tSendMsg.run();
    }Any help would be appreciated.

    Question: Does the code compile and run properly?
    Since the Gang of Four published their pattern book, everyone is obsessed with patterns.
    A factory basically creates and returns a new object. The following does that and technically could be called a factory.
    public MyObject createA() {};Just what object does your code create and return to the caller?

  • Difference between Builder Pattern and Factory Pattern

    difference between Builder Pattern and Factory Pattern

    You are right Both of these patterns are creational design patterns Purpose of these two patterns is very different as Abstract Factory Patterns (which is commonly known as Factory pattern ) is used to create a object in a scenario when you have a product & there is a possibility of many vandors providing implementation for it. So it is good to come up with a abastract factory which provides create method for the product. Each vendor can implement you abstract factory & provide a concrete implementation which will return a product of Vendor implementation.
    Builder patter is used in case you have a very complex object creation process involved & you realy want to abstract the client from doing all those complex steps. In such situation you create a builder class which takes care of all complex steps & client just needs to use this builder class to create your complex object.
    Hope it clarifies your doubts.

  • Standard way of implementing different timezones.

    Wanted to know the standard way of implementing timezones for an international web application.
    I have the different companies information in a table called company.
    Is it a good idea to store the timeoffset from GMT in the database or create a new table timzone and link this table with the company table.

    The decorator pattern was meant for this =). Look it up; I believe you will find it useful. You can use the decorator pattern with your Weapons.
    Enums do make sense, since the weapon types will be considered constants. Just to let you know, 2D arrays are really only useful for data structures that have a finite 2D shape, such as those found in tictactoe programs. I'd suggest that you look into the topic of data structures sometime.
    I think that a better way to implement the attacking system would be to have the Weapon object do the damage itself -- assign the logic to the object that contains the data necessary to carry out the logic. This way the program is more modular and setter/getter requests, which threaten the maintenance of a program (changes in implementation will ripple throughout), are avoided. (If the player is to carry out the task of doing the attacking, it will have to retrieve information from the weapon. And if all the Weapon objects do is store Weapon-related information, then they're weak objects and it's a clue that you're giving their responsibility to other objects when you shouldn't be.) I would go would this idea.
    Now that I think more about it, your player class could interpret input from the UI (or do stuff based on UI-generated events) and create the appropriate weapon and have the weapon do the damage/attacking itself, as I described above.

  • Beginner Factory Pattern help needed please

    hi people,
    Can someone please explain to me in laymans terms what the use of the Factory pattern is. I went to http://www.research.umbc.edu/~tarr/dp/lectures/Factory.pdf
    and it did nit help me too much.
    I'd really appreciate it if someone could give me an abstract example of when the Factory pattern would be useful. The reason I ask is because I am researching into JDO and have come across PersistenceManagerFactory and think I would underdstand this better if I understand Factory's.
    Many thanks.

    Is the reason for the ConnectionHelper to allow us to use that as the return type in the getHelper() method, thus allowing us to have either the OracleConnectionHelper or DB2ConnectionHelper?
    Yes. You want to achieve polymorphism. You are interested in the connect() method, not necessarily what database is used (not the best example in the world, normally you would care as different vendors have slightly different SQL syntax, but assume you were using no triggers, procedures or non-ANSI SQL).
    So, are you basically saying that a Factory is a class that can be used to decide which of the two databases we are going to connect to?
    Depends. In this instance, you name the database you want and the factory is responsible for returning the proper class. In other cases, you might have developed a program that works across databases and only uses one at a time. In this case, you would probably read in a setting at application startup, and the factory would always return the same object type.
    If there is a PersistentManagerFactory, does it mean this would be used to decide what PersistentDataStore we are going to use (i.e. flat file, database, serialised object etc)?
    Again, it depends. You can make your factories 'smart' by deciding where to serialize a given object (say, every domain model object has a method save() and your DAO uses the factory to get a connection to do its work). In other cases, you have a 'bare-bones' factory that simply returns the requested object type. Why go through all that effort? Well, one advantage is that I can put the factory, interface and any implementations in the same package. The only ones that (normally) would need to be public would be the interface and the factory. You can hide the implementation details using the security features of the language.
    Also, why is OracleConnectionHelper a final class?[i]
    In general, I make all variables, method signature parameters and classes final. Once I need to sub-class or re-assign a variable value, I remove the final clause. I can't count the number of times the compiler caught an error (rather than at runtime) because of the additional 'safety' declaring everything final gives you. Only make variables and classes (and method signature variables) non-final when you need to. IMHO, of course.
    - Saish

  • My Factory Pattern

    Here is the factory pattern I have implemented. I want to know, exactly which pattern this belongs to. I liked this. Comments and suggestions are welcome.
    // ViewFactory.java
    // Implementation of the Class ViewFactory
    // Generated by Enterprise Architect
    // Created on: 9/28/02
    // Original author: Vijendra Kotian
    // Modification history:
    public class ViewFactory implements ViewFactoryInterface {
         private ViewFactoryInterface vf;
         protected ViewFactory(){
         public ViewFactory(String type){
              System.out.println("ViewFactory created");
              vf=createNewView(type);
         public void finalize() throws Throwable {
              super.finalize();
         private ViewFactoryInterface createNewView(String type){
              char c=(char)type.charAt(0);
              switch(c){
              case 'a':
              case 'A':
                   return new AWTViewFactory();
              case 'm':
              case 'M':
                   return new MotifViewFactory();
              return null;
         public void openView(ViewFactoryInterface param){
              vf=param;
         public void print(){
              if(vf!=null) vf.print();
              else System.out.println("Vf is null!!!");
         public static void main(String[] s){
              ViewFactoryInterface vf=new ViewFactory("MOTIF");
              vf.print();
              ViewFactoryInterface vf1=new ViewFactory("Awt");
              vf1.print();
              vf1.openView(vf);
              vf1.print();
              ViewFactoryInterface vf2=new ViewFactory();
              vf2.print();
    public interface ViewFactoryInterface {
         public void print();
         public void openView(ViewFactoryInterface vfi);
    import ViewFactory;
    public class MotifViewFactory extends ViewFactory{
         public MotifViewFactory(){
              //super("Motif");
              System.out.println("New Motif view factory created");
         public void finalize() throws Throwable {
              super.finalize();
         public void print(){
              System.out.println("Motif print");
    import ViewFactory;
    public class AWTViewFactory extends ViewFactory{
         public AWTViewFactory(){
              //super("AWT");
              System.out.println("Awt View Factory created");
         public void finalize() throws Throwable {
              super.finalize();
         public void print(){
              System.out.println("AWT Print");
    -Vijendra K

    http://forum.java.sun.com/faq.jsp#messageformat

Maybe you are looking for

  • Exchange rate for imports PO

    Dear All, I created a PO with exchange rate defined as per OB08. I want to know the implications of the following changes. 1. Suppose user changed an exchange rate in PO at the time of GR, which rate syatem will pick? 2. Suppose user changed an excha

  • OSX 10.7.5 compatiblity on macbook 2009

    I have a late 2009 macbook and I'm running OSX 10.5.8, I was thinking to upgrade to 10.7.5 and I was wondering will it affect my macs performance in a postive or negative way... Thanks

  • Data Control from Java Class

    Using JDev 11gPS4 I have a java class that i want to use as a DC: (simplified) public class AccountDC {     public AccountDC() {         super();     public void insertAccount(Account account){         //Do some things }Account: public class Account

  • Apache Server in OSX will not start up

    I have installed Darwin Quicktime Streming server on to my iBook and I think it has effected my Web Sharing. I can not start up my web server anymore. MSQL still runs, but I can't start web sharing. I have turn off MYSQL, but still no joy. I also don

  • Sites for user-made .pst/.cst exchanges?

    I recently posted a little guitar "riff sketch" I'd recorded with GarageBand to a forum, and had one user write me back asking about the settings I'd used since he'd been trying to get similar sounds. I wrote back providing links to zipped copies of