Design question - new to ISW

Sun-AD Identity synch working great in testing mode (bidirectional password and attributes), but some questions for a production implementation.
Ad Forest has multiple domains, but our Sun Dir only has one - o=company.com. There's no real relation between Sun/AD structure...
What would be the best way to implement a multiple AD directory source (one per domain) to the one Sun Dir domain?
Does this mean I should restructure my Sun Directory??
Thanks!

All set. Used the synthetic attribute for AD which is derived from the domain name.

Similar Messages

  • LDAP design question for multiple sites

    LDAP design question for multiple sites
    I'm planning to implement the Sun Java System Directory Server 5.2 2005Q1 for replacing the NIS.
    Currently we have 3 sites with different NIS domains.
    Since the NFS over the WAN connection is very unreliable, I would like to implement as follows:
    1. 3 LDAP servers + replica for each sites.
    2. Single username and password for every end user cross those 3 sites.
    3. Different auto_master, auto_home and auto_local maps for three sites. So when user login to different site, the password is the same but the home directory is different (local).
    So the questions are
    1. Should I need to have 3 domains for LDAP?
    2. If yes for question 1, then how can I keep the username password sync for three domains? If no for question 1, then what is the DIT (Directory Infrastructure Tree) or directory structure I should use?
    3. How to make auto map work on LDAP as well as mount local home directory?
    I really appreciate that some LDAP experta can light me up on this project.

    Thanks for your information.
    My current environment has 3 sites with 3 different NIS domainname: SiteA: A.com, SiteB:B.A.com, SiteC:C.A.com (A.com is our company domainname).
    So everytime I add a new user account and I need to create on three NIS domains separately. Also, the password is out of sync if user change the password on one site.
    I would like to migrate NIS to LDAP.
    I want to have single username and password for each user on 3 sites. However, the home directory is on local NFS filer.
    Say for userA, his home directory is /user/userA in passwd file/map. On location X, his home directory will mount FilerX:/vol/user/userA,
    On location Y, userA's home directory will mount FilerY:/vol/user/userA.
    So the mount drive is determined by auto_user map in NIS.
    In other words, there will be 3 different auto_user maps in 3 different LDAP servers.
    So userA login hostX in location X will mount home directory on local FilerX, and login hostY in location Y will mount home directory on local FilerY.
    But the username and password will be the same on three sites.
    That'd my goal.
    Some LDAP expert suggest me the MMR (Multiple-Master-Replication). But I still no quite sure how to do MMR.
    It would be appreciated if some LDAP guru can give me some guideline at start point.
    Best wishes

  • Design question for database connection in multithreaded socket-server

    Dear community,
    I am programming a multithreaded socket server. The server creates a new thread for each connection.
    The threads and several objects witch are instanced by each thread have to access database-connectivity. Therefore I implemented factory class which administer database connection in a pool. At this point I have a design question.
    How should I access the connections from the threads? There are two options:
    a) Should I implement in my server class a new method like "getDatabaseConnection" which calls the factory class and returns a pooled connection to the database? In this case each object has to know the server-object and have to call this method in order to get a database connection. That could become very complex as I have to safe a instance of the server object in each object ...
    b) Should I develop a static method in my factory class so that each thread could get a database connection by calling the static method of the factory?
    Thank you very much for your answer!
    Kind regards,
    Dak
    Message was edited by:
    dakger

    So your suggestion is to use a static method from a
    central class. But those static-methods are not realy
    object oriented, are they?There's only one static method, and that's getInstance
    If I use singleton pattern, I only create one
    instance of the database pooling class in order to
    cionfigure it (driver, access data to database and so
    on). The threads use than a static method of this
    class to get database connection?They use a static method to get the pool instance, getConnection is not static.
    Kaj

  • Workflow design questions: FM vs WF to call FM

    Hereu2019s a couple of workflow design questions.
    1. We have Workitem 123 that allow user to navigate to a custom transaction TX1. User can make changes in TX1.  At save or at user command of TX1, the program will call a FM (FM1) to delete WI 123 and create a new WI to send to a different agent. 
    Since Workitem 123 is still open and lock, the FM1 cannot delete it immediately, it has to use a DO loop to check if the Workitem 123 is dequeued before performing the WI delete.
    Alternative: instead of calling the FM1, the program can raise an event which calls a new workflow, which has 1 step/task/new method which call the FM1.  Even with this alternative, the Workitem 123 can still be locked when the new workflowu2019s task/method calls the FM1.
    I do not like the alternative, which calls the same FM1 indirectly via a new workflow/step/task/method.
    2. When an application object changes, the user exit will call a FMx which is related to workflow.  The ABAP developer do not want to call the FMx directly, she wants to raise an event which call a workflow .. step .. task .. method .. FMx indirectly.  This way any commit that happens in the FMx will not affect the application objectu2019s COMMIT.
    My recommendation is to call the FMx using u2018in Update tasku2019 so that the FMx is only called after the COMMIT of the application object.
    Any recommendation?
    Amy

    Mike,
    Yes, in my first design, the TX can 1. raise a terminating event for the existing workitem/workflow and then 2. raise another event to call another workflow.   Both 1 and 2 will be in FM1. 
    Then the design question is: Should the FM1 be called from TX directly or should the TX raise an event to call a new workflow which has 1 step/task, which calls a method in the Business object, and the method calls the FM1?
    In my second design question, when an application object changes, the user exit will call a FMx which is related to workflow.  The ABAP developer do not want to call the FMx directly, she wants to raise an event which call a workflow, which has 1 step/task, which calls a method, which calls the FMx indirectly.  This way any commit that happens in the FMx will not affect the application objectu2019s COMMIT.
    My recommendation is either call the FMx using u2018in Update tasku2019 so that the FMx is only called after the COMMIT of the application object or raise an event to call a receiver FM (FMx).
    Thanks.
    Amy

  • Method design question...and passing object as parameter to webserice

    I am new to webservice...one design question
    i am writing a webservice to check whether a user is valid user or not. The users are categorized as Member, Admin and Professional. For each user type I have to hit different data source to verify.
    I can get this user type as parameter. What is the best approach to define the method?
    Having one single method �isValidUser � and all the client web service can always call this method and provide user type or should I define method for each type like isValidMember, isValidAdmin ?
    One more thing...in future the requirement may change for professional to have more required field in that case the parameter need to have more attribute. But on client side not much change if I have a single isValidUser method...all they have to do is pass additional values
    isValidUser(String username, String usertype, String[] userAttributes){
    if usertype == member
    call member code
    else if usertype = professional
    call professional code
    else if usertype = admin
    call admin code
    else
    throw error
    or
    isValidMember(String username, String[] userAttributes){
    call member code
    One last question, can the parameter be passed as object in web service like USER object.

    First of all, here is my code
    CREATE OR REPLACE
    TYPE USERCONTEXT AS OBJECT
    user_login varchar2,
    user_id integer,
    CONSTRUCTOR FUNCTION USERCONTEXT (
    P_LOGIN IN INTEGER
    P_ID_ID IN INTEGER
    ) RETURN SELF AS RESULT
    Either your type wont be compiled or this is not the real code..

  • Dreamweaver design question

    Hi all. I'm new to the forum and ha da design question. My site took about 3 weeks to complete and after finishing what I though was a pretty error free website I noticed that dreamwever 8 was coming up with numerous errors that matched http://validator.w3.org's scans. My question is this. Why does dreamwever ( regardless of the release ) allow the designer of the website he/she is creating without pointing out the errors as they go along with simple instructions on how to fx them.  As an example My meta tags
    <META NAME="keywords" CONTENT="xxxxxxx">
    <META NAME="description" CONTENT="xxxxxxxx">
    <META NAME="robots" CONTENT="xxxxx">
    <META NAME="author" CONTENT="xxxxxx">
    <META NAME="copyright" CONTENT="xxxxxx">
    all had to be changed over to
    <meta name="keywords" xxxxxxxxxxxxx">
    <meta name="description" CONTENT="xxxxxxx">
    <meta name="robots" CONTENT="xxxxxx">
    <meta name="author" CONTENT="xxxxxxxx">
    <meta name="copyright" CONTENT="xxxxxxxx">
    all because dreamweaver didnt tell me that the <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    didnt fit the original design. Now my site ( if you wish to view the code ) is www.gamblingwhore.com and if you look at the page source you will see that the code has been corrected on dw 8 but still shows more than 30 errors on http://validator.w3.org. Does dreamwevaer not have the basic tool available to fix these errors without such hassle. Its not just my site either, many sites built in dreamwever can be checked with the http://validator.w3.org website only to find more than 20 -100 different errors.
    Dream weaver creators need to focus on these errors because they hinder seo and they create alot of extra work
    Thank you

    The w3c and XHTML have come a ways since the release of Dreamweaver 8 (I used it in late 2004 and 2005).
    Dreamweaver 8 will build transitional XHTML files as well as old style single tag HTML. It all depends on the personal preferences of the designer.
    Just for kicks, go to say... 20 random websites and see just how many get a green light when you validate them. If its half, you're lucky. This page doesn't even validate;
    Dreamweaver has the menu option (at least in CS3 an CS4) under the Commands menu to "Clean Up HTML" or "Clean Up XHTML" depending on what you're building. I make a point of running that command as I build along with Apply Source Formatting.
    I also use a local validator program to check my code before putting anything.
    That's why they call it WYSIWYG software.
    If it did everything perfectly for everyone every single time, good web designers would find themselves out of work.

  • OSPF Area Addition - Design Question

    Hello,
    I have a design question regarding OSPF. I am looking to add a new ospf area (1). The area will live on two Core routers and two Distribution routers. Can you please look at the attached Pics and tell me which design is better.
    I would like to be able to connect Core-01 to Dist-01 and Core-02 to Dist-02 with a connection between Dist-01 and Dist-02, but this will result in a discontiguous area, correct?
    Thanks,
    Lee

    I would say that the more common design is to have just backbone area links between the core routers. But there is no real issue with having an area 1 link between them...
    If I were you, I would not make the area a totally NSSA. Here are my reasons for that:
    - you will get sub-optimal routing out of the area since you have two ABRs and each distribution router will pick the closest one of them to get out to the backbone even though it may be more optimal to use the other one
    - in an NSSA case, one of the two ABRs will be designated as the NSSA translator, which means that if you are doing summarisation on the ABRs, all traffic destined for these summarised routes will be drawn to the area through that one ABR.
    Paresh

  • Web design questions (Was: A number of questions..)

    Ok so!
    What fonts are known to go well together when making banners or headers? I have been messing around with a lot of fonts and im really just looking for some new ones!
    I know this question really depends on the banner itself but what is a recommended size of a font when making a header? lets say 860x250 ?
    Are there any real kind of "must nots" when designing banners?
    When Placing text onto A banner where is the usual place you would see it? I know it changes from site to site but from just looking around a lot of text seems to be in the left bottom corner, is this a norm of some sort?
    Are there any known font combinations which would go together well when making a full webpage? As in fonts for the sidebar, content area, footer etc, any combinations?
    Thank you very much!

    You are asking design questions, but most web designers, including those who frequent this forum, have  no design expertise.
    Your questions are good, but  incomplete. The right typeface and size depends on the impression you are trying to create. For instance, you wouldn't want to use the typeface "Comic" for a website selling financial services.
    Many corporations have lengthy documents detailing their identity for graphic design and advertising. Such documents define which typefaces may be used where, and how. Assuming that you don't have such a document to work with for the creation of this web banner, think about the business, organization (or whatever) the website is for. Should it convey conservative dependability? Edginess? Family friendliness? The typefaces you choose should take such qualities into consideration.
    There's no definite answer to any of the questions you have asked. But that's OK. You should research websites that create the kind of impression you want to make and study how they accomplish it.

  • VS2013 Express Report Viewer - Design a New Report

    I just installed VS2013 Express and added ReportViewer to the .NET Framework Components.  I then added a ReportViewer to a Form in a new project, added a SQL Server 2008 Object using the object explorer, followed by adding a DataSet of one of my SQL
    Server 2008 Database Tables.  All good so far as I was following Mario Scopel's youtube video on "Creating Reports in C# - Part 1 of 2".
    The next step was to Design a New Report using the ReportViewer's Task arrow and clicking "Design a New Report" but it does nothing!!! What is wrong with this software?  Am I missing something regarding the RDL schema?  What do I need
    to do to create a new report to this local database?
    Thanks.
    JT

    HI JT,
    Visual C# forum is discuss and ask questions about the C# programming language. Based on your description, your case related to VS report.  I will move your thread to
    Other Forums    >  
    Visual Studio Report Controls forum for better support.
    Best wishes!
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Design questions on using JMX

    I have been reading about JMX and trying to understand it
    I have some specific design realted questions and wanted some opinions to validate my understanding
    Assume a simple j2ee application that exposes 2 webservices .
    I would like to find out how many times each service is called and the total number of success/faults/errors
    encountered for each service along with params like starttime etc
    From what I have understood , I will have to first create a Bean , say "StatsCollector"
    and then creae a StatsCollectorMBean interface.
    The StatsCollector will provide the methods to set/update the above values and those will also be exposed by the StatsCollectorMBean interface
    1) I have trouble understanding how to create and maintain the MBean Resource...
    Shouldnt there be always 1 instance of this resource ? ie shouldnt there be only one StatsCollector ?
    Most of the examples create a simple class "Hello implements HelloMBean" and that makes it a MBean
    but they create Hello hello = new Hello() and then register it with the MBean server
    What if we create multiple objects of Hello? Wouldnt that defeat the porpose of the MBean ?
    I think that we need to make sure that this resource is always created once only.
    Is that correct ?
    2) Is it the right practice to separate your MBean and your "managed" resource ?
    ie in the above case , should there be a Singleton StatsCollector POJO that stores the Appliction
    statistics and another StatsMBean that will be the MBean that will access the POJO ? This makes sure that your Resource does not have
    dependency management classes.
    3) How does the application update the values in the MBean ?
    In the above example , how do you update the success and failure counts in the MBean from the application ?
    Can I update the singleton StatsCollector directly or do I have to go through the MBean Server to update
    any value in the MBean ?
    If I update them directly , will they be "visible" thru the MBean server ?
    4) Assuming that the above app gets deployed in a appserver like WebSphere and in a Clustered environment ,
    how to ensure that statisitcs are collected for all the services on all servers cummulativly ?
    Is this something that the appserver should provide ? Do we register the MBean with the Appserver
    MBean server ?
    Any ideas/suggestions will be helpful !
    thanks
    Pat

    Hello pat,
    very interesting questions. You are covering the main JMX design questions there.
    You should have a look (if you not already did) to the JMX best practices : http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/best-practices.jsp
    This document summarize common JMX design patterns.
    Answers to your questions:
    1) The resources you want to manage/monitor are Web Services. The life cycle of these services is handled by the J2EE container itself. As you say, the tricky part is to link the WebService resource life cycle to the MBean resource
    The MBean leaves inside its own container, the MBeanServer.
    You should identify an initialization phase in which you create your MBeans and register them inside the MBeanServer once.
    In your case, you can go for a single collector that monitors the 2 Web Services or a collector per Web Service. It seems that you want to track each service independently. Having 2 MBeans should offer a more flexible solution.
    If you go for 1 MBean, you should name it "<your management domain>:type=StatsCollector". This name identify an MBean for which you have a single instance. Once the collector registered with this name, the MBeanServer will guarantee that no MBean with the same name can be registered.
    If you go for 2 MBeans, you should add the Web Service name to each MBean ObjectName. For example:
    MBean 1 : "<your management domain>:type=StatsCollector,name=MyWebService1"
    MBean 2 : "<your management domain>:type=StatsCollector,name=MyWebService2"
    Example of MBean creation and registration code :
    StatsCollector collector1 = new StatsCollector();
    ManagementFactory.getPlatformMBeanServer().registerMBean(collector1,
    new ObjectName("com.foo.bar:type=StatsCollector,name=WebService1");
    At this point you have an MBean registered inside the platform MBeanServer.
    2) A Standard MBean is formed of a java interface and a class. Generally the interface and the class are not separated. They could be but I don't see a strong reason in your case to have the POJO and interface not being the same object.
    3) You shouldn't expose the methods to set the values in your MBean interface. Only getters should be visible. It means that you will have to keep a direct reference to the collectors to update the statistics. During your initialization phase, you could use JNDI to register the collector instances. The WebServices will then use JNDI to retrieve the collectors.
    An example of a simplified StatsCollector class and StatsCollectorMBean interface
    public interface StatsCollectorMBean {
    public int getNumRequests();
    public class StatsCollector implements StatsCollectorMBean {
    private int numRequests.
    public int getNumRequests() {
    return average;
    public serviceCalled() {
    numRequests++;
    In the above example, serviceCalled is not part of the management interface and is called by the Web Service.
    4) Difficult question for which I can't provide you with a reply. JMX doesn't offer such cumulative service in a standard way. In some appserver (glassfish for instance), MBeans are cascaded inside the domain server. There is no cumulative representation offered, but you could implement your own by defining new MBeans linked to the StatsCollector ones.
    To conclude, Appservers are offering some "out of the box" management and monitoring features . For example glassfish relies on the AMX framework (that is JMX based) . AMX (https://glassfish.dev.java.net/javaee5/amx/) allows you to monitor and manage your services. A possible solution would be to rely on this infrastructure to build your own management and monitoring.
    Hope this help.
    Regards.
    Jean-Francois Denise

  • Database Connection design question

    Hello, I have a design question. Awhile back I needed to create a database connection to SQL Server, so I created a class to do it
    import java.sql.*;
    import java.io.*;
    import java.net.MalformedURLException;
    import org.w3c.dom.Document;
    import org.w3c.dom.*;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    public class SQLServerConnection
         private static Connection connection = null;
         public SQLServerConnection(String user, String password, String dbName) throws java.sql.SQLException
              getDBConnection(user, password, dbName);
         public SQLServerConnection(String configFileName) throws java.sql.SQLException
              getDBConnection(configFileName);
         private void getDBConnection(String user, String password, String dbName) throws java.sql.SQLException
             DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
             connection = DriverManager.getConnection(
                  "jdbc:microsoft:sqlserver:" + dbName, user, password);              
         private void getDBConnection(String configFileName) throws java.sql.SQLException
              String user;
              String password;
              String dbName;
              try
                   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   DocumentBuilder db = factory.newDocumentBuilder();
                   Document doc = db.parse(configFileName);
                   doc.getDocumentElement().normalize();
                   // get the configuration information
                   password = getConfigParameter("password", doc);
                   user = getConfigParameter("username", doc);
                   dbName = getConfigParameter("databasename", doc);
                   getDBConnection(user, password, dbName);
              catch (MalformedURLException murle)
                   System.out.println("Unable to connect to: " + configFileName + " -- " + murle);
                   System.exit(1);
              catch (FileNotFoundException fnfe)
                   System.out.println("Configuration file " + configFileName + " not found.");
                   System.exit(1);
              catch (IOException ioe)
                   System.out.println("IOException: " + ioe);
                   System.exit(1);
              catch (javax.xml.parsers.ParserConfigurationException pce)
                   System.out.println ("Parser Configuration Error: " + pce);
              catch (SAXException saxe)
                   System.out.println ("SAXException: " + saxe);
         private String getConfigParameter(String paramName, org.w3c.dom.Document doc)
              NodeList nl = doc.getElementsByTagName(paramName);
              if(nl != null)
                   Node n = null;
                   for (int i = 0; i < nl.getLength(); i++)
                        n = nl.item(i);          
                        if(n.hasChildNodes())
                             NodeList children = n.getChildNodes();
                             return ((Node)children.item(0)).getNodeValue();
              else
                   System.out.println ("nl is null");
              return "";          
         public void setCatalog(String catalogName) throws java.sql.SQLException
              connection.setCatalog(catalogName);
         public Connection getConnection()
              return connection;
         public void closeConnection()
              try
                   connection.close();
              catch(java.sql.SQLException sqle)
                   System.err.println ("SQL Server Connection failed to close: " + sqle);
    }Later on, I needed to do the same thing for MySQL, so I created a class for that, MySQLServerConnection which is exactly the same as above, except for:
    private void getDBConnection(String user, String password, String dbName) throws java.sql.SQLException
              try
                   Class.forName("com.mysql.jdbc.Driver").newInstance();
                   connection = DriverManager.getConnection(dbName, user, password);     
              catch(java.lang.ClassNotFoundException cnfe)
                   System.out.println (cnfe);
              catch(java.lang.InstantiationException ie)
                   System.out.println (ie);
              catch(java.lang.IllegalAccessException iae)
                   System.out.println (iae);
         }Later, on, I did the same thing with OracleServerConnection. My question is, I know this is probably not optimal code. For example, I didn't originally have a close connection method, so I had to go in and code one for all 3. I'm assuming that an interface would be a good idea so that if I have to code another database connection class I make sure and include all of the appropriate methods. I'm also assuming that it would have been smart to have a master class, maybe something like DatabaseConnection and extended these classes from that. Am I on the right track? Totally offbase?

    @nclow - I will work on trying the Factory Pattern for this over the weekend and post when I finish to see what you think.
    @abillconsl - just to make sure I understand, you're saying that I just try to connect and it will cycle through the different database connection possibilities and connect when it finds the right one? If it fails all 3, log an appropriate message. One question I have about this is, I thought I was being object oriented by separating the different types of db connections (Oracle, SQL Server, MySql) into different classes. Am I missing the point of OOP by what I was/am trying to accomplish? Going overboard? Also, does your way try and connect to all 3 even if I connected to one already?
    Thx, Grantarchy
    Edited by: grantarchy on May 9, 2008 9:50 PM

  • Design Question: Parent/Child Distribution

    Hi,
    I have what I think is a straightforward design question. I tried
    searching this forum for the answer, but struggled with what keywords
    to use in the searches. (I also struggled with what to put on the
    subject line for this post!)
    Anyhow, here is my question: Given:
    public class Pet {...}
    public class Dog extends Pet {...}
    public class Cat extends Pet {...}
    public class Pig extends Pet {...}
    Which is the better design?
    DESIGN A:
    public abstract class PetOwner {
    private Pet pet;
    PetOwner(Pet pet) {
    this.pet = pet;
    public Pet getPet() { return this.pet; }
    public class DogOwner extends PetOwner {
    public DogOwner(Dog dog) {
    super(dog);
    public class CatOwner extends PetOwner {
    public CatOwner(Cat cat) {
    super(cat);
    public class PigOwner extends PetOwner {
    public PigOwner(Pig pig) {
    super(pig);
    ===============================================
    or DESIGN B:
    public abstract class PetOwner {
    PetOwner() {
    public class DogOwner extends PetOwner {
    private Dog dog;
    public DogOwner(Dog dog) {
    super();
    this.dog = dog;
    public class CatOwner extends PetOwner {
    private Cat cat;
    public CatOwner(Cat cat) {
    super();
    this.cat = cat;
    public class PigOwner extends PetOwner {
    private Pig pig;
    public PigOwner(Pig pig) {
    super();
    this.pig = pig;
    This is a somewhat contrived example, so don't take it too literally.
    My question is where should I put the field that holds a Pet object?
    All pet owners own a pet, so should I put it in the parent class
    (Design A)? Note the constructors for the child classes (e.g.
    DogOwner) are designed so that the correct type of pet is checked
    for. Or should each child class hold its own type of pet (Design B)?
    If the answer is "it depends" (as I suspect it is), then what are
    the questions I should be asking myself in order to decide?
    Thanks very much, in advance!!
    Chris

    eg,
    import java.util.*;
    class Pet {
        private String name = null;
        public Pet( String n ) {
         this.name = n;
        public String toString() {
         return name;
    class Dog extends Pet {
        public Dog( String n ) {
         super( n );
    class Pig extends Pet {
        public Pig( String n ) {
         super( n );
    class Cat extends Pet {
        public Cat( String n ) {
         super( n );
    class PetOwner {
        private Vector pets = new Vector();
        private int dogs = 0;
        private int cats = 0;
        private int pigs = 0;
        public void add( Dog d ) {
         pets.add( d );
         dogs++;
        public void add( Cat c ) {
         pets.add( c );
         cats++;
        public void add( Pig p ) {
         pets.add( p );
         pigs++;
        public boolean isCatOwner() {
         return cats > 0;
        public boolean isDogOwner() {
         return dogs > 0;
        public boolean isPigOwner() {
         return pigs > 0;
        public int numberOfPets() {
         return pets.size();
        public String toString() {
         String s = "";
         Enumeration en = pets.elements();
         while( en.hasMoreElements() ) {
             Pet pp = (Pet) en.nextElement();
             s += pp.toString() + "\n";
         return s;
    public class Pets {
        private PetOwner po = new PetOwner();
        public Pets() {
         po.add( new Dog( "doggy" ) );
         po.add( new Cat( "catty" ) );
        public String toString() {
         String s = "";
         s += po.toString();
         s += po.isDogOwner() + "\n";
         s += po.isPigOwner() + "\n";
         s += po.isCatOwner() + "\n";
         s += po.numberOfPets();
         return s;
        public static void main( String[] args ) {
         Pets p = new Pets();
         System.out.println( p );
    }

  • Design question: Link data between JFrames

    Dear all,
    I have a design question. I have this form in a JFrame where you can set an icon as a property. To achieve this, I have a "Set" button on the form which will open a new window with all the available icons. When you click an icon, I want the "icon" frame to be closed and the selected icon to be send to the original form. This is the way I do it now:
    Interface :
    public interface IconUpdate
    public void updateIcon(Icon icon);
    }Main frame with the "Set" button:
    public class Test extends JFrame implements IconUpdate, ActionListener
        private Icon icon = null;
        public Test()
            // add button and actionlistener and that kind of stuff
        public void actionPerformed(ActionEvent e)
            if(e.getSource() == btnSetIcon)
                new IconFrame(this);
        public void updateIcon(Icon icon)
            this.icon = icon;
    }The Icon frame:
    public class IconFrame extends JFrame implements ActionListener
        IconUpdate parent = null;
        public IconFrame(IconUpdate parent)
            this.parent = parent;
            // Initialize table,"Pick" button etc.
        public void actionPerformed(ActionEvent e)
            if(e.getSource() == btnPick)
                parent.updateIcon((Icon)list.getSelectedValue());
                this.dispose();
    }Maybe I made some spelling faults, but this is the way I implement it. Now my question is: is there another way to achieve my goal? If I have to create an interface for every "popup choose dialog" in my program, I have to create many of them. I know using a combobox in the main frame is an option, but I just want to use it this way. Can anyone tell me how I can rewrite this code to make it better / more professional?
    Tx in advance!!!
    Peter

    I can think of a couple options:
    1) Let IconFrame's constructor accept a Test parameter, instead of creating an interface.
    2) Make IconFrame into a modal dialog & have it store the user's selection in a variable. Then when you show the dialog, your action listener will block until the user selects an icon. Then you can call "getSelectedIcon()" to retrieve his/her selection. This would be much like the JOptionPane.showXXX() methods, and probably the cleaner solution.

  • Design question about instant download a patch

    Hi All,
    Here is a design question for you:
    Background:
    The application we built is being upgraded from time to time and we send it to our users.
    our users use it on a network so there is only one file to upgrade (and being done by the sys admin)
    We send them a �patch�; actually, it�s a new version of the application they place it in the relevant folder and continue to work with a new version.
    Problems:
    1. We send them the patch via email - sometimes it takes a while until they read their email and at they are using an �old version of the system�.
    2. Some of them are not computer savvy (when it�s not the sys admin) and we need to guide them as where exactly to place the file (there are 3 files)
    Our (conceptual never build yet) Solution:
    Build a program just like Norton antivirus (or other) that prompts the user from the task bar (next to the clock) that a new version is available and by
    clicking once it will automatically download the file and store it in the correct folder.
    Question:
    1. Did anyone try anything like this before (or something like) who can tell me about it?
    2. Do you think this kind of system will work for us?
    3. Does anyone have a better solution?
    Thanks
    Peter

    thanks, I posted it there.No, he meant that Webstart is the mechanism you should use. It supports net-based distribution and automatic centralized updates of apps. Exactly what you want.

  • Design question about instant download from

    Hi All,
    Here is a design question for you:
    Background:
    The application we built is being upgraded from time to time and we send it to our users.
    our users use it on a network so there is only one file to upgrade (and being done by the sys admin)
    We send them a �patch�; actually, it�s a new version of the application they place it in the relevant folder and continue to work with a new version.
    Problems:
    1. We send them the patch via email - sometimes it takes a while until they read their email and at they are using an �old version of the system�.
    2. Some of them are not computer savvy (when it�s not the sys admin) and we need to guide them as where exactly to place the file (there are 3 files)
    Our (conceptual never build yet) Solution:
    Build a program just like Norton antivirus (or other) that prompts the user from the task bar (next to the clock) that a new version is available and by
    clicking once it will automatically download the file and store it in the correct folder.
    Question:
    1. Did anyone try anything like this before (or something like) who can tell me about it?
    2. Do you think this kind of system will work for us?
    3. Does anyone have a better solution?
    Thanks
    Peter

    Java WebStart is the deployment technique suited for your purposes.
    The deployment will be done via a webserver running a jnlp servlet (provided).
    The applications may either run offline, or check online for automatic updates.
    You have several configuration options.
    ArgoUML and jEdit are two open source apps delivered this way.
    Your app will need to be adapted though.
    And your customers need an online browser with installed jvm.

Maybe you are looking for

  • How to get the total page number when using Crystal Report in JSP

    In my JSP, I use the class CrystalReportViewer to generate and display the report views. But this class only sypply the function to get the info of the active view. Thus with this info, I only can get the active view's page number. How can I get the

  • Different Payment terms for Same supplier

    Dear All, We are creating Shopping Cart and once Shopping CArt is fully approved, PO gets Automatically created in SRMa nd copy of sma ein ECC system. We are udng extended classic Scenario. We have one scenario in which Same Supplier can have differe

  • Just lost out on £200.00 from a client because of Youtube and HTML5 ;(

    Hi All, Youtube now caters for both flash and html 5 - because of this I have lost £200.00 today. The client wants both pcs and ipads to see their videos. Any one els feeling Apples pinch, because it's Jobs who started this war. And when is Adobe goi

  • X6 problem connecting BH-214

    I just bought the BH-214 headset. I don't seem to get it to work. I can connect the headset through bluetooth to the phone. But when initiating the music player, the music keeps comming out of the speakers, not through the headphone. I tested the ear

  • Zip file read problem

    Hi iam jayakumar from Inatech(oracle partner).I want to read the zip, write the zip file and create the zip file from BPEL .Is it possible? or use only java embedding in bpel to achieve this? or any config changes required? normal file adapter not re