Hi,I want to create an API for the GUI piece of my application to hook up to. The GUI will basically query a database and display the results, it will also be used to edit database rows. Are there any patterns that I can use for this activity so that either the front or back end technologies ...
851 byte By
Isaaka at 2007-11-26 20:43:03
Hi,I think you are better than me in oop so you could easily show my error in a oop. My Code makes an error ArrayIndexOutOfBoundsException [0].Where is my fault? class C{A a;C(){a = new A();} }class A{ B []b; A(){b = new B[0];b[0] = new B(); }}class ...
Hello Evryone,I'm designing a new application for Incident Management.There is an existing Incident System But, our application is targeted to end user facility.So, we have to use the existing Incident Management system to store and get data, so that Incident can be loaded on booth side.We ...
1780 byte By
jdupreza at 2007-11-26 20:52:50
Hello,using JDK 5/6 for a few months, I've just started playing with standard annotations (which by the way are not extremely well documented in the JDK docs, I had to go look at the javadoc for package java.lang.annotations to find them out).I'm finding the @Override annotation quite useful, ...
1384 byte By
Anteksia at 2007-11-26 21:24:04
Hello,We are about to develop a new business application with about 1000 clients. Our IT staff consists of two groups, Java programmers and system analysts. A fight has just been started about one question between the two groups. The question is: "Who should design the database, and how?"Our ...
514 byte By
kanaiyaa at 2007-11-26 21:42:48
we have a Business tier. There are different types of the client c,c++,corba, java client , soap based etc. How can i provide a generic interface so that it works well for all types of the client. i..e. all the client use the same api model communicate to the business tier(ejb-tier).Pls suggest ...
I was just restructuring some of my code and I decided to extract interfaces out of some concreteclasses. I'm not really expecting to have multiple impls for them, but I did it to reinforce thinking in interfaces and to have a good view over the class without having to look at implemntation ...
1208 byte By
jfreebsda at 2007-11-26 22:08:23
There's a lot of -Project- objects stored in some collection on server.The GUI uses the server facade to perform services.There're several Frames and each one related to one server -Project- object.Performing any operation on server from any GUI Frame would be calling methods like ...
Hi!I know this is a classic issue, but I 'd really need some advice on this topic.Considering possible harmful consequences to this practice, I would like to know if there is a way to use the Template pattern within a constructor.In my context, I think it would be reasonable to have an ...
292 byte By
Isaaka at 2007-11-26 22:39:49
HI,My multi-threading downloader makes freezing the editor. Input streams and output streams are in a synchronized block. Classes are extended from Thread. I don't know what else could I do to correct my code, so I think to use any safe pattern.What could you recommend?
1073 byte By
radicjesa at 2007-11-26 23:22:20
I have a problem with Object Relational Mapping which I can't find anywhere.From visiting dozens of sites I finally found some usefull info to model the database to code in ORM style.But now my head is against a wall again after modeling a big part of the ORM.What im having now is something ...
hi all,I am developing a J2SE application which is communicating with two DB schemas.Do any one suggest any good design pattern to manage these type of situation. I was thinking to create two DAO classess for two different DB schemas?I am using oracle 10g as ...
We are currently in the design process for an application that will use an ORM and are trying to create an object model that will make the most sense for using the ORM to save data to the database. At this time, we will not be using the ORM to instantiate objects from the relational data.The ...
317 byte By
sri1025a at 2007-11-26 23:41:52
I have always admired the design of a lot of classes and frameworks in the JDK. I read the source code a lot to see how the developers coded a particular class, how they designed it and how they write the javadocs.But one thing I observed was the improper indentation of the source code. Why is ...
I'm writing a position paper on persistence layer query returns. It deals with querying for a single object or a collection of objects and what to do if the object or collection of objects are not found in the database. I've googled many different search terms and have not come up with any ...
Hello!We are discussing to implement a DSF, and we argue about the pattern Observer and logging. We have read several documents that recommend monitoring for any kind of distributed system because the high number of unexpected failures, bugs, etc.The problem we are discussing is regarding the ...
Hi,I am a new bee to the J2EE world. Can anybody point me too or help me in finding a technical Design document template for a J2EE based project.Thanks
Hi,I've a servlet that will handle page redirection and page flow. I've read about various design pattern and was hoping that I could implement some of them onto my codes.However, there are various patterns that seems to be applicable and was wondering which is a better option. 2 patterns in ...
Hello Everyone,I'm developing a WebApplication with GWT.I'm planning to work with a Rules engine.So, i'm looking for Best practices, Design pattern to allow a flexible way to construct UI screen and workflow based on Rule.So the screens shoud wotk with an interface provided by the business ...
Hello all,Wow this forum is exactly what I was looking for!Am kinda new to design paterns and have stumbled upon a design problem....I am trying to add SVG based graphics support to an existing Struts/JSP/Servlet based web application. Basically I wanted to display a network diagram comprising ...
Hi,I am facing a problem in using pagination using display tag:When I do the search first time on my page,pagination works perfectly fine. But after persisting the data in database when I show the search results again from the session, pagination does not work.It shows the page numbers but all ...
We are using Hibernate for ORM in a non-managed environment.In Presentation tier there is Struts which interacts with a POJO-based business model. In the Action class we instantiate a persistent object with data derived from the ActionForm. In the Action class we call the business method using ...
Hello everyone,I'm working on a complaint registration application.For getting Complaint we use WebServices provided by another application.I think DAO can be a good solution but i'm not 100% sure there isn't others solution.The WebService methods are related to the complaint lifecycle like ...
Hi you all,I am about to start a project for our JCommunicator device.https://jcommunicator.dev.java.net/We thought about starting with a Rest approach because it is lightweight and because it can be nicelly couple with AJAX applications.The problem is that we dont have enought experience on ...
3086 byte By
Hombrea at 2007-11-27 1:58:55
Hi!I was wondering whether it is bad or good to use private getter methods in a class rather than directly accessing private fields?For instance, I have a getter method for each Swig component used in my program: private JButton run;private JButton getRun() {if (run != null) {return run;}run = ...
Hi all I've a class hierarchy problem. I'm trying, to create classes that will parse XML files for different sports, and display them in the table. I've no influence on XML files which I read, and they are different for each sport. To avoid code repeating I've created such a ...
580 byte By
dodida at 2007-11-27 2:52:10
I have defined a tree of database classes, extended from the root class R. Now I want to define a caching database class A, so that for any two subclasses, B and C, of R, I can use 'a = new A(new B(), new C())' to create a database instance that works like B and all changes to B are backed up ...
Hi there, I am currently working on a distributed clients-server system where a GUI resides on the clients whereas the programmer programs to server-side dummies like the GUI would be running local.Therefor I map between client-side-Implementation and server-side-dummy using ...
All:I have an open source neural network program ( http://www.simbrain.net/) which involves multiple neural networks (simulated brain circuits) talking to multiple environments. In principle the networks and environments should also be able to talk to each other.However, as the program has grown ...
let me know if dao pattern is the best followed in all almost all the projects though finding alternatives to it. please clarify this for me and also i do want to know the best practices of the industry in using design patterns.
Hi,I am a junior programmer and I am trying to understand somewhat more about best practices and design patterns.I am looking for more information regarding the DAO pattern, not the easy examples you find everywhere on the internet, but actual implementations of real world examples.Questions:1) ...
hello all, I am looking for a non linear regression algorithm to find constants (a,b,c,d) for my function Y=Exp^(a*x+b)+Exp^(c*x+d)Where Y and X i have the dataUsing non linear regression i need to find the constants which would be the best guessesCould some body provide some informations. ...
2461 byte By
jaredpa at 2007-11-27 4:19:34
I need display multiple fields from a DTO throughout the presentation layer. What is the best way to format display data without duplicating the logic throughout presentation layer?ExampleI have a Person DTO that has first name, last name, and suffix 'getters' and am constantly showing the ...
718 byte By
Meirya at 2007-11-27 4:23:15
hi all i need to develop application that started as smell one but now become bigger the options and conditions it has to handle also are variedso im looking for more generic way to build it .here is the high level requirements :this process will act as a server that will listen for requests ...
Hello folks,I'm trying to figure out how to wire the models and views I have.I have three models that represent three separate applications, that are combined into one shell application. Each model has its own view(s). Easy enough.One view has yet another micro-application nested within ...
887 byte By
CBya at 2007-11-27 5:06:10
A Builder knows how to construct the various parts of an aggregate, while a Director knows the order in which they should be constructed. Wikipedia illustrates this pattern with a PizzaBuilder example: http://en.wikipedia.org/wiki/Builder_patternI find it difficult to understand why one would ...
Hy there !What part of MVC approach the Struts Action and the Struts Form bean are: Model, View or Controller ?ThanksMarco
Hi,I've been reading about the Strategy Pattern and I would liek to implement into one of my own small projects.I have an application called WatchDog, this application checks some directories (provided as parameter) and puts every item in a directory in an appropriate mysql table.I have this ...
4613 byte By
javiousa at 2007-11-27 5:16:51
Ok, I have written a gallery that allows gallery owners to create/maintain albums, provide images along with their initial comments for the image and allow other users that has been authorized by the owner to add images/comments. In addition to this, other permitted gallery users may browse ...
747 byte By
amartela at 2007-11-27 5:22:00
Hi everybody,We are designing a system where we want to access a Workflow System (Bonita) installed in a remote server. To do that we want to provide a service following the Facade pattern to give access to the API of the Workflow System through either a RMI or Web services (it seems us WS are ...
I would like some advice on the project i'm currently working on.First you should know that i know how to program in Java and i have created some small sites already using JSP and Beans and a May database in the background. But so far all i have done is A to B to C programming considering each ...
682 byte By
CbbLea at 2007-11-27 5:26:33
Hi!In 50% of the websites I've found they count MVC as a design pattern, in the other 50% they count it as a framework...What is your opinion about it?Since design patterns describe "solutions" on recurring problems without making it code specific, meaning different implementations could make ...
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 , ...
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 ...
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[] ...
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 ...
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 ...
how can we implement aggregation and composition in java?
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?
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 ...