What is the difference between Service and Component?
Hi!can somebody tell me about any good resource where i can get knowledge of designing controller on basis of command pattern and an example will help me a lot....I want to develop a controller for my application which except's data from swing client and calls the appropriate business ...
Hi,Should we use common user defined Data structure to communicate between layers (say between presentation layer and business layer)....Actuallly i have build a common data structre of that type in which i am using a Vector having vectors of name value pairs like MainVector| Name Value ...
Hello,The web tier framework I'm working utilizes Struts, and I have a question about using interfaces in base action classes. We have created static utility wrapper methods for accessing different scopes and services. Now in our base action class we have wrapper methods which wrap calls to ...
I have built JSP/Servlet/Struts application in the past on a cluster of app servers. Each app server has its own JVM running the Servlel Container. All of the HTTP requests come into a hardware load balancer, which directs the requests to one of the app servers in the cluster. I have wanted to ...
If we want only 5 instances to be created and find out which one is used and which one is free the how to implement it.
998 byte By
jlarkina at 2007-10-1 6:23:08
I am developing a app that is utilizing a proxy pattern to "wrap" instances of a few classes. The consumer of the proxy then does not need an instance of the inner class and the inner class is shared among all of the proxy consumers. However, I need the ability for the underlying class to be ...
Suppose we have a PersonVO (java bean) with simple attributes i.e. first and last name then the DAO is quite simple and clients of the DAO layer pass VO back and forth (really cleanly).But it is a different story if a person has a picture. If the picture is small then wecould define a field ...
Dear helper,I have assigned enhancement project for old system.the old system divided into three pakages:1. listener : listen to a data feed from a gateway using socket2. analyser: connects to the listner and analyse the feed using some basic string processing like substring() ...
1062 byte By
fedetxfa at 2007-10-1 6:34:50
I am coding a small standalone application for my grade thesis. I have a few User,Context and Resource objects. I have a relationship between a User and a Resource in a Context or between 2 users in a Context. User is a special case or Resource. I need to store that simple model in a persistent ...
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.pdfand it did nit help me too much.I'd really appreciate it if someone could give me an abstract example of when the Factory ...
Hi,I'm currently in the process of writing my first 'big' java app, mainly as a learning process (can say that again) and I'm struggling with the dao aspect of it. The application is a small client/server app that runs on a network with the need to persist objects to some sort of simple DB. ...
The Concept I know about Singleton is "one and only one instance of a class at any given point of time in a single JVM ". The moment the clustered environment come, it would end up having multiple JVMs and hence each JVM would have an instance of this Singleton classCan anybody know how can we ...
1855 byte By
hdevaana at 2007-10-1 6:56:30
LS,I'm curious about a design issue regarding singleton objects. I know that the whole idea of singletons is debatable (for instance, see: http://c2.com/cgi/wiki?SingletonsAreEvil), but for the purpose of this topic, let's just assume that we want to create a singleton.I'd like to hear what ...
727 byte By
graysa at 2007-10-1 6:56:31
I'm currently designing an application in which there are three objects that extend a basic object, e.g:BasicObjectMyObject1 extends BasicObjectMyObject2 extends BasicObjectMyObject3 extends BasicObjectAny one of these three objects can then be used depending on what is selected within the ...
What is the best way to implement a cluster-wide object ID generator?
I have a some high level sequence diagrams, I want to know if there is a specific notation i should use for relating the steps to particular use cases by ID. e.g I have use case Document Processing (ID UC-01-01) as a step in a high level sequence diagram and i need to somehow link the Document ...
1117 byte By
graysa at 2007-10-1 7:04:00
Ok, heres a question for the Java Masters. I have a situation in which I want my application to be governed by modules. Each of these modules is just a class which extends a class called StandardPanel (which itself extends JPanel) and implements a class called BasicModule. Now, to have ...
Hi All,Anybody please tell me what is Singleton Design Pattern ?What is the right definition of it and where can I get the right information about it.Please help and reply soonThanksAmitindia
447 byte By
balteoa at 2007-10-1 7:10:11
Hello,I am building an application and I would like to have an api jar (used at compile time) and an impl jar (used at runtime) as you get with most java apis. (One api.jar containing the interfaces and one impl.jar containing the classes). Can anyone give me a skeleton for that please? How can ...
Hi All,I have 30 - > 40 classes and I want to know if there is a tool available which parses all the Java files and creates a UML diagram from it?It should run on Unix. All the tools I have seen and for UML - > Java. Any go the other way.Thanks
I had posted a query earlier.. I wanted to design an asynchronous application where I was not able to do a wait/notify as there are multiple requests and assigning a thread to each request was impossible. If I use callback approachMy code could have been something like this:public void ...
1060 byte By
0zero7a at 2007-10-1 7:22:16
Hi all!I would like to extend a HashSet in order to override the "equals" method to detect the addition of an object "MyObject" previously added.Can anybody explain how should I implement this method?If I have:public class myObject {int x;int y;}How should be the overrided equals method?public ...
public abstract class AbstractSpoon implements Cloneable{ String spoonName; public void setSpoonName(String spoonName) {this.spoonName = spoonName;} public String getSpoonName() {return this.spoonName;} public Object clone() ...
We are creating a J2EE application with an O-R mapper to solve the persistence problems. We plan to create Java objects which encapsulate certain aspects by creating a service interface. These services use persistent objects backed by some database tables.Now we have some decisions which need ...
1136 byte By
osammota at 2007-10-1 7:33:58
Hello, I would need some hint about defining signatures of BD implementation, respectively to web interface behaviour. I would like to understand the best practice starting from stratch, postponing refactoring considerations.I would expect more or less a 1-1 relationship between WUI controls ...
I have been working on a project that has both some web functionality and a client side GUI app, both connecting to the same back end. It is using java for the web side and VB for the client GUI. I am curious to know, as I haven't been able to find good examples, what the best way would be to ...
If I want to ensure that a function does not change the instance variables, or in other words, I want to ensure that a method invocation does not change the invoking object. How do I do it, in C++ adding a const at the end of the method declaration would do the job and I dont think that Java ...
I want to sort a Collection with a Comparator.I define a class that implements Comparator, thus it implements compare method:public int compare(Object o1, Object o2) {//My objects are actually stirngsString str1 = (String)o1;String str2 = (String)o2;//I perform some transformation on the ...
816 byte By
jkumarta at 2007-10-1 7:47:39
public class ClassA {public void methodOne(int i) {}public void methodTwo(int i) {}public static void methodThree(int i) {}public static void methodFour(int i) {}}public class ClassB extends ClassA {public static void methodOne(int i) {}public void methodTwo(int i) {}public void methodThree(int ...
Hi all,What we would like to do is create a platform that will enable our company to keep very tight control over data entry quality. It would need to be generic enough to be able to handle basically all kinds of data entry, even classing things like scanning as such (images being data). The ...
I was going through Bruce Eckel's Thinking In Patterns and was not too sure as to what was required in an exercise question"Create a registry/lookup service that accepts a Java interface and produces a reference to an object that implements that interface."Is the question asking for an ...
448 byte By
kmthiena at 2007-10-1 8:00:20
Hi guys,I am really stuck in designing the OO way for product category, subcategory and classification stuff like that. I need something like this: http://list.auctions.shopping.yahoo.com/sg/0-submit.htmlCan somebody recommend the best way to design OO like that? This is because some category ...
314 byte By
NCS_Onea at 2007-10-1 8:01:28
Hi Im trying to create : class MySomething extends Component { public MySomething() {} public void paint(Graphics g) { g.drawString("MySomething",10,10); } } but when i call it from a applet it doesnt draw in the applet. Thanks for all the ...
I am implementing a Customer business object (remember its not an EJB) in my java project where I will be implementing addCustomer(),removeCustomer() and selectCustomer() methods to start with.public class Customer{public void addCustomer(){/*Implentation*/}public void removeCustomer(int ...
408 byte By
sbainsa at 2007-10-1 8:09:37
hi,I am trying to send an object from class Waiter to class Kitchen via the kitchenInterface class. The interface class has a sendOrder method which is envoked from class Waiter. This sendOrder() method would also have to be in Kitchen ? KitchenInterface can only call methods contained in ...
3127 byte By
heavyza at 2007-10-1 8:09:38
hi everybody,I'd like to know how to write threadsafe singleton. For example, i have a singleton like:public class MySingleton {private static MySingleton instance = null;private MySingleton() {// construct the singleton instance}public static MySingleton getInstance() {if (instance == null) ...
Hello,I don't know whether this is the right forum or not. I need a free tool that draws UML diagrams. All what I need is to draw quite large UML diagrams and draw packages in it. Then I will print it. I do not need any advanced features like code generation and reverse engineering. I tried ...
977 byte By
sbainsa at 2007-10-1 8:19:06
Hi,can anyone point me in the right direction of how java Interface works? I am trying to implemnt a client server application that uses interfaces. There is only one server Interface that the client will talk too, however there will be multiple instances of client Interfaces that the server ...
789 byte By
sodagala at 2007-10-1 8:23:21
i have a problem implementing the factory pattern.Pls pls help........ the problem is "I have a program called HomeApplianceCenter that is used by a home management system to control AC and Refrigerator. To support client preference of runnig the appliances I have a Preference class. I need to ...
629 byte By
valjoka at 2007-10-1 8:33:11
Please, consider a design as hierarchies of basic cells. Some of them are roots, others have a reference to their parents. You have two options: [1] define a general node object with parent reference specifying the root by pulling the reference to ground. This is how matematitions do, for ex: ...
2816 byte By
jc.csca at 2007-10-1 8:34:47
Hi there,I have a Singleton and TimerTask class in the same web application that deployed into Jboss. Both TimerTask.run() and test.jsp have the same line of code:Singleton.getInstance().some()What I did is:1. when I started the web app, and load test.jsp, the Singleton object is created.2. ...
Hi All,Is the "Factory" and "Enumeration" is a design pattern if so what are they and where we used them.ThanksAmitindia
Hi,I am developing a program using (or trying to use) MVC pattern and I need to use the same View for a number of models. Is there any specific pattern/approach?In detail (simplified):1. I've got my model: a simple class called Birthday, that simply stores a the "name" of a person (a String), ...
i have to develop a web base applecation which is database indepandent, to achive this functionlity i have to use DAO design pattern. can some one explane me more about this............................
HiI have an entity bean that represents a user. (UserEntity)I have an entity bean that represents accounts of users. (AccountEntity)I have also these:DTOUser, DTOAccountDTOUser contains a DTOAccountA user can have multiple accounts.Above my entity beans i have objects that contains some more ...
Hi. First let me apologize for the long post. I could see no other way. I抦 building a system that quite large and I need some advice. The system is a type of transaction system, let抯 suppose a shopping cart. I抦 using struts taglibs and tiles for presentation, struts proper for controller, and ...
Dear Sirs,I'm a student and I'm doing a little project regarding a compiler. This compiler should generate an executable program that wiil be interpreted by a virtual machine(RASP machine). The instruction of the executable language should be implemented by the Command Pattern, but when I ...
I've seen the state pattern applied to a situation where I am not sure if a state pattern applies.Can you please tell me if the state pattern is good for this situation?It is that only a few operations can be called for a certain state. If you call "wrong" operations for that state, an ...
196 byte By
gcsrosa at 2007-10-1 8:56:41
I have a property of type hashtable with get/set methods. When I XMLEncode the object it looses the info in the hashtable. DOes anyone know how to go about this?ThanksR