I have an application with enum, that's behaviour changes based on the value of the enumerated type, see http://java.sun.com/developer/JDCTechTips/2005/tt0208.html#2 for more detail. The problem that I see in this Design Pattern that client of the enum should decide what VisitorImpl should be ...
Hi all,I have a situation where I feel the need of combining Annotations and the Observer pattern. I would like to record field changes on an Object. So I decided to use the Observer pattern this way:class PersonObserver implements Observer{private List<String> changedFields = new ...
Im stressing and havent had time to do my final project for this class can someone help.. thanksDesign a Java art program that will give an artist a great variety of capabilities to draw, use images and use animations to create a dynamic multimedia art displayif you can help that would be ...
156 byte By
yael800a at 2007-11-27 11:20:40
<p>Hi,</p><p>I would like to know if this book is good:</p><p>"Design Patterns In Java" - Steven John Metsker William C. Wake.</p><p>Thank's</p><p>Yael</p>
8055 byte By
AQ_Javaa at 2007-11-27 11:20:00
The question:Design a small, prototype, application, which creates, stores and amends warehouse records. This may have little more than a StockItem class.Using each of the patterns Strategy, Decorator, Adaptor and in turn provide three different adaptations to your prototype application which will ...
I have a question regarding using interfaces, in particular for domain objects, and visbility regarding bidirectional associations.Let me explain the problem I am having using this exampleinterface INode {INode getParent;void addNode(INode node);}class Node implements INode {private INode ...
511 byte By
jvmana at 2007-11-27 11:01:10
Hi all,I am having some doubt in Transfer Object pattern.. How should we implement that pattern exactly? Lets take an example of displaying data from customer table. In my customerDAO iam creating an arraylist (containing records retrieved) and sending back to the presentation tier through ...
117 byte By
mammaa at 2007-11-27 10:55:33
<p>I want to develop a drag and drop based IDE.</p><p>How should I proceed ? Should I go for an example to follow</p>
<p>Hi,</p><p>Can any of u tell me the limitations of factory pattern.</p>
I have architectural question. At server side we have .Net web service, at client side we have java desktop application.Issue is that we have an object (large object), let say ObjectA, on client side and its copy on server side. We get ObjectA by calling web service.Now we need these two object ...
Dear allI have recently joined a project that is 2/3 through development of a medium sized application providing synchronous and asynchronous implementations for a number of Use Cases exposed as Web Services. The design is one that I have not come across before and am keen to understand.Web Service ...
<p>For me, The Eclipse IDE is the best IDE out there...</p>
3679 byte By
jdupreza at 2007-11-27 10:22:33
Hello,I am maintening a client/server app (Swing client, no Web pages), basically an order processing system. The biggest part of it is to verify the conformity of orders to a set of business rules.As usual, some of the verification can be made early on the client-side, but most of the verification ...
Hi friends i have done a school management software it collects overall details of the students,exam,marks,report. i have done in java swings.now i need to convert this stand alone proj into nertworking ie windows based. Which concept i need to use how can i do this.by ...
227 byte By
vatora at 2007-11-27 10:18:19
<p>If you are going to implement the MVC pattern in a webapp, what is the best framework to use? </p><p>I've done a tutorial with Struts. Is that a good framework?</p><p>Is there any disadvantages by using such frameworks?</p>
105 byte By
Shebua at 2007-11-27 9:59:17
Hi...Can any one explain me what is the differnce between Java patterns and J2EE patterns ?
473 byte By
_AM__a at 2007-11-27 9:55:47
Hi, I was asked this in an interview.. 1) how would you a design a app. when database connection is lot. 2) will you have a database replica in another machine, so that if the connection is lost, take the data from the secondary database. I am not sure about this. But I strongly feel we never ...
Hi, I want to implement Role-Module wise security for the User. e.g. Admin can do everything in the site.High Profile users can Insert/Update/View all the modules.Medium Profile users can Insert/Update/View limited modules.Visitors can only view static pages. I hear about Role pattern but no ...
Dear all,I'm trying to create a singleton webservice. (a webservice of which only 1 instance is allowed. All calls to the webservice should 'end' in this singleton)Reason for this; the application uses a multithreaded back-end controlled by a ThreadPoolExecutor. This only has effect when ...
851 byte By
minkeya at 2007-11-27 9:20:56
Hi All,I am trying to understand Factory Method pattern from HF- Design pattern. However i am unable to understand how Subclassing the PizzaStore is better than creating the invidiual region specific PizzaFactories.The author gives an example of SimpleFactory and then creates region specific ...
467 byte By
AlienXa at 2007-11-27 9:16:02
hi,is it possible to use the reverse of observer patterni.e - observer pattern is described normally as there is 1 subject & many observers.So when the subject changes, it notifies the observers. My problem is I only 1 observer but many things change, so when each of the things (subjects ) ...
Before I start work on a DB- I thought to execute code with JSP- Formbean- Action Servlet- Business Class- DAO flow. Is it possible to hardcode values and retrieve it from DAO? Pardon me if this sounds dumb question. Thanks,
Hi All, Currently I am in the process of evaluating different design ideas for the search functionality of my application. I am looking for a best option for retrieving the data by executing some complex sql queries with huge query criteria and showing the single or multiple records to the ...
Hi friends.I want use DAO for create a Swing application, that acess to PostgreSQL.I want to retrieve a list of objects ( for example: clients), How is the best implementation?Client[] clients = ClientDAO.getClients();or javax.sql.RowSet clients = ClientDAO.getClients();I'll use result ...
I have 2 DB's (sybase & oracle). I need to pull information from both of them and put it in another DB- table (may be oracle). I am planning to implement DAO and here is my problem:-1. ShouldI use 2 DAO's for two DB- tables? or just one is sufficient using a DAO factory?
I have 2 DB's (sybase & oracle). I need to pull information from both of them and put it in another DB- table (may be oracle). I am planning to implement DAO and here is my problem:-1. ShouldI use 2 DAO's for two DB- tables? or just one is sufficient using a DAO factory?
399 byte By
Bhishmaa at 2007-11-27 8:53:29
Hello, I have 2 classes. Address & User. The relationship is Address belongs to User (& is a 1-1 in my case). As such I have an Address reference in my User class.Class User { Address addr; ...}Under what circumstances should I also include a reference to User within Address ?Class ...
Hi all,I've been reading about the Proxy Pattern and it seems like just normal encapsulation to me or do I misunderstand it?To me, Proxy looks like using a "middleman" class to delegate requests to the actual class so that the implementation of the actual class is hidden from the user.Another ...
Hi all,I have a superclass Person and 2 subclasses Male and Female that extend the superclass.public class Person { // name stringprotected String name;// gender : M or Fprotected String gender;public String getName() {return name;}public String getGender() {return gender;}}// End of ...
Hi all,I am new to patterns and need some help with DAO's. I want to work on a sample app using struts. Please give me the links so that I can go ahead. Your answer may help hundreds of others who are using this forum.Thanks,
1992 byte By
smokinga at 2007-11-27 7:55:42
Hello everybody!I am working to a project and I have a issue about giving responsabilities in OO Analysis for which I kindly ask your suggestions.The project, in brief, is about a system which has to manage the money an institution (e.g: Association for cancer research) donates to a research ...
Hi all,My web application has a SearchManager. (which obviously doing search).class SearchManager{SearchFactory factory = new MySearchFactory();public SomeClass onSubmit(HttpRequest request, HttpResponse response, SomeCl obj){factory.search();}}I need a connection (instance of MyConnection) for ...
Hi,I have developed an application that allows an user to perform several operations. Now, I need to add a new feature to it: some operation is classified "unsafe". The application can therefore be run in two modes: safe mode (allows only safe operations) and unsafe mode (allows safe and unsafe ...
Hi Experts,I have a problem in designing an ApiI define a bunch of annotations for my value objects at runtime, currently I have a AnnotationUtil class in which read all fields of the given classes and put the field name and its annotation in a Map structure so whenever I need to know the ...
I was recently asked this question in an interview .. as to how I would design a traffic signal mechanism , although I have some ideas I was wondering if I could invite some more thoughts from forum members . Surely the solution would involve application of design patterns .
Hi Friends,Need urgent help.I working on a project where there will be multiple ear ,each for one application.There are 4 project and 4 ears and one common util war file which will be shared by all ears.Problem is : 3 of the projects will use same database tables. I am using hibernate ORM ...
Hi all,I'm facing the problem I'll try to explain.I've the following abstract definitions.1) Business Object - It's any object of my business that application has to handle (it might be a currency, a bank, a customer...a report etc)2) Transaction .-It's is not the transaction concept of ...
Hi,I have following problem with the current plugin mechanism of our application:In general, plugins can easily be integrated into the application. But some plugins need some sort of persistence mechanism (i.e., some database tables). And here the problem arises. The application itself uses an ...
733 byte By
vatora at 2007-11-27 6:28:43
I'm using a mvc design pattern for my webapp. In some of the books I've read it seems like they are suggesting to use one controller for each of the usecase. Is this the right way to do it?For me it seems like you get so many classes. If you are dealing with a User, and has to modify info ...
649 byte By
basharfa at 2007-11-27 6:26:40
Hello All,i could use some help..Regarding EJB, when using enitiy beans from tables; the question is, for each table will have an entity bean ?for each user using these instances .. will each user have his own instance or one instance for all users ?so what about if we have 1000 tables, and we ...
Hi,I just want to know, how did you (as experienced Java developers) learn the way to design your application in a professional way.How do you design your application (before start writing a single line of code) to give it the features like scalability? How do you manage conceptual application ...
Hi,I'm creating a class to my SCJD cert impl that has a protected RandomAccessFile reference member. I've designed this member as protected since subclasses really need to access it.My dilema is that I thought of this class as a wrapper to that member, but, the way it is, classes from the ...
Suppose I'm writing an implementation to an interface:public interface WeatherReader {public double readTemperature(int zipCode) throws ZipNotFoundException;}The client code passes in a zip code and expects to receive the temperature or a "zip code not found" exception as a response.My ...
158 byte By
rejeepa at 2007-11-27 6:00:25
Hi!I am trying to learn about the Observer, MVC pattern.The problem is that I cant find any good tutorial... Does anyone know any?
how can we implement aggregation and composition in java?
2393 byte By
smokinga at 2007-11-27 5:50:30
Hello there!I am facing for the 1st time in my life the problems of projecting and developing an application using "serious" OO analysis and design within the Rational Unified Process..What I have to do for the final exam of my course is a web application which has to respect the MVC pattern ...
HiLets have a look at this example.public interface MyInterface {public void init() throws MyException;}public class MyClassImpl implements MyInterface {public void init(){//Not throwing MyException}}Is it a good practice that the MyException should not be thrown in the init() of the ...
1444 byte By
jakain2a at 2007-11-27 5:48:23
I have a Constants class that defines some constant values that are used in various places in my web application. Some of these constant values are set by a startup servlet so cannot be declared final. For example:public class Constants { public static int SOME_VALUE; public static String[] ...
Hello I am using DAO for persistent layer in my project. There are cases when i need to access more than one DAO to manage transaction .To achive this i am passing Connection object in every method which isneeded in transaction .But for this i have to duplicate every method of every DAO .I ...
Hi guys,I have the following question: I have some functionality which is divided in two parts: basic functionality that is created implementing only one interface , i.e. IBasicClient, and functionality that is methods with different data types as parameters , i.e.:ISDOClient, IStAXClient , ...