Hello,Have started developing with J2EE recently, moving up from J2SE. With regards to persistance of data to a database I have been looking at the DAO pattern. I am a little confused about this pattern, so I hope someone may be able to clear a few things up.As I understand it the Transfer ...
1102 byte By
sim085a at 2007-10-2 8:49:33
I guess this is the best place where to ask this.I am trying to design (for now) an application that is made up from many different plugins (similar to eclipse). I gave a look to how eclipse manages this, I also did some sample code. In practice it looks easy.What I did so far is having a jar ...
357 byte By
am_newa at 2007-10-2 8:52:49
Hi We are into the design of a new web application. Looking into different ways of doing it ,struts was one of the model that is in interest. I have read in threads in this forum that the struts core development has stopped and the developers have moved over.So , is struts still a good choice ...
683 byte By
Viveka at 2007-10-2 8:53:42
Hi,I am looking for ideas that I could implement for my senior design project. The topic of the project could be anything. It must involve a GUI (for which I will be using Swing) and it could encompass databases, web interfaces etc. depending on the goal of the project. The project should be ...
336 byte By
MithunKa at 2007-10-2 8:55:35
Hi all,In my application I am storing all the data into XML file. And I have designed the resource layer entty. Now I want to know which mechanism of object to XML binding is better (like Castor, JAXB etc). So it will be great if some one can suggest me which mapper is better and why.Thanks in ...
1762 byte By
MonLanda at 2007-10-2 8:57:20
Hi,I am new to these forums, please let me know if this is already part of a FAQ or not the appropriate place to ask this question.When designing an interface, would you recommend specialized or Generic Interfaces?As I am not sure if makes any sense, here are the two thinkings I have to define ...
2110 byte By
mc3712a at 2007-10-2 9:01:15
Hi, I'm just learning MVC and I have few questions.As the class count increases with MVC, how do you usually organize the models, views and controllers in Java packages? I think I'm trying to "tie them together" too much. Also, should I think like that the Models arent actually a part of the ...
I got to know that:In aggregation we use the object by reference.In composition we use the object by value.can some one provide me what does this mean to the Java developer. It will be great if you can explain it with simple sample codes for each scenario.
35 byte By
jimmy6a at 2007-10-2 9:12:05
Why String need to be final?
961 byte By
Dipua at 2007-10-2 9:15:06
Hi,I have got to write a standalone Java Program and the specifications are as follows:The program takes inputs from Various files and Writes into different data sources . The intial inputs and the data sources are The Inputs are a)XMLb)Comma Separated Text FileThe Data Sources are 1. Oracle ...
794 byte By
jdupreza at 2007-10-2 9:19:23
Hello,for a pet project (but I've seen this need in business projects too), I'd like to design a Java application unaware yet whether the final UI will be Web-based or Swing-based, and maybe both will be offered.I have no practical experience of Struts, WebWork, SpringMVC, JSF, but from a ...
Hi ,I have a database that holds data for shoes and trainers and i have set up 2 seperate applications with simple gui's one for shoes one for trainers. The applications communicate seperatley through rmi to a server which returns the results of any queries from the database it makes. ie. the ...
My problem is pretty basic - i just want to know the best way to design that:Imagine, you have an interface Example. There are two abstract classes implementing this - ExampleOne and ExampleTwo.Now there may be dozens of classes that subclass one of these two. They provide certain things that ...
I am parsing thousands of XMLs and loading data in my application. Can anyone suggest tested strategy to reuse objects. I have to generate java source files from XSD using Castor and then load data from castor generated classes to my other classes. I wont be able to replace my classes with ...
1351 byte By
Saisha at 2007-10-2 9:29:03
All,This is probably an elementary question; however, as I never had a formal CS education, I was wondering what the actual, correct answer is. Would overridding a concrete (implemented) method in a superclass within a subclass constitute (or provide) polymorphism? In Java code:class ...
2137 byte By
fif2006a at 2007-10-2 9:29:14
Hi, I am implementing a singleton class which should accept a parameter when first creating its instance.I am currently using a static public field which is populated by defaut by a static final field but can be overidden by a calling class before getting a first instance.Is this design OK or ...
1157 byte By
kablaira at 2007-10-2 9:29:21
I've been reviewing some of the GUI code I've developed over the past month. I didn't try to conform to any specific pattern, I just went with what looked best. Looking at the couplings and dependencies I've noticed several things:1. The model has no knowledge of the view.2. The view has no ...
I am building a server in J2EE environment which needs to do following tasks continously.1. Detect files uploaded to a directory2. Move files to a temperory working directory(FIFO order)3. Read files and Validate records(FIFO order)4. Read & Process files that have successfully gone through ...
Hi everyone I have some java source code and have been asked to look for design patterns in the code(about 50 classes). A friend suggested importing the java classes in to JUDE UML modeling tool ( http://www.esm.jp/jude-web/index.html) to make it easier and i have downloaded the evaluation ...
I've been reading the "Patterns of Enterprise Application Architecture" book and it has opened my mind to a lot of different designs.I'm trying to design a large accounting system in OO. I'm unclear on how I should design the mapping inbetween the domain logic and database.Should the ...
What is the exact difference between abstract classes and interface in real scenario?Plz could you give a practical example?Thanks
961 byte By
dubwaia at 2007-10-2 9:37:56
I was perusing the Wikipedia entry for OOP and looking at a few of the criticism links. To me the arguments aer based on things that OOP supposedly says but that I don't really consider OOP. http://en.wikipedia.org/wiki/Object_oriented_programming#CriticismPerhaps they misunderstand OOP. ...
1523 byte By
katriyaa at 2007-10-2 9:45:05
I have a class which processes XML data . The class hierarchy is given belowpublic abstract class Processor{public abstract void buildDataFromXml();public void publishResponse(){StringBuffer response = new StringBuffer();response.append("Some Common Info -- ");response.append(buildResponse()); ...
Consider the scenario:There exists a abstract implementation (say 'AbstractImpl' ) of a interface (say 'InterfaceA'). Concrete implementaion (say 'ConcreteImpl') extends 'AbstractImpl'. (This is sometimes called Template Design Pattern).What is the difference between:1.AbstractImpl ...
1507 byte By
wraggiea at 2007-10-2 9:49:28
Modify the Mortgage calculator design so that the user is able to input the mortgage principal, mortgage term, and annual interest rate. Include all the mortgage information and calculations in a separate class that is contained in a separate file. Ensure the following input values are ...
I have an application that makes a severals different request call to the server inorder to initialize the application. Fortunately, these requests are not dependent upon one another; therefore, i decided it's best to do multithreading (a thread for each request). What i'm running into is a ...
Hii JavaitesI m developing a reporting application , in which --1) I need to query daatabse 2) ,and display results in jsp 3) also i need to do paging of the records displayed using NExT & PREVIOUS ButtonRight now i m using resultsets , but i think it won't b nice 2 query database again ...
409 byte By
Nehaa at 2007-10-2 9:54:21
Hi..I am getting the following exception while running a servlet on Apache tomcat[Fatal Error] :15:184: The element type "HR" must be terminated by the matching end-tag "</HR>".From XMLParserorg.xml.sax.SAXParseException: The element type "HR" must be terminated by the matching end-tag ...
hej,Using the Command Pattern to run DAOs with a bit of business logic so that I can have a different types of Invoker (Command handler) classes depending if transactions are managed a SLSB or a local test client using JTA. Beyond organizing commands there isn't much hassel with using the ...
617 byte By
Liggya at 2007-10-2 9:55:07
All,I was just in a meeting where two different approaches to returning data to the view were discussed.In a nutshell, here are the two options presented:1) The service layer should return the Business Entities entirely (which happen to be Hibernate objects).2) The service layer should return ...
3304 byte By
pgeuensa at 2007-10-2 9:57:50
I have this classimport java.util.ArrayList;import java.util.List;public class SynchIssues{ private List values = new ArrayList(); private static final SynchIssues singleton = new SynchIssues(); public static SynchIssues getInstance() {return singleton; } public void addValue(String value) ...
I don't know if this is the correct forum for my question.My application has to assign an appointment with a doctor. But there are many users (patients) compeating for this resource. I thought of blocking this resource until I collect all the patient information, but I'm not quite sure that ...
929 byte By
toniG.a at 2007-10-2 9:59:09
Hello,i have a Problem with the Singleton Pattern.Following situation:I have a class (Commander) which starts all the dialogs of my Swing Application. For this it starts first the BPs and they start the dialogs.The BPs need my mainprocess class in the construtor to set the its parent. So, my ...
2756 byte By
Liggya at 2007-10-2 10:05:39
All,Is loose coupling/method reuse in the DAO a good thing?In the method example below, methods in the DAO would all invoke this generic method to dynamically build the stored proc to call, and execute it.Is this good design? or overkill? or problematic?private void executeStoredProcedure(Long ...
1779 byte By
sbelslya at 2007-10-2 10:06:46
I am looking for comments/suggestions on appropriate layers and dependencies in a Strus application.We currently have FormBeans, an Action layer, a Service layer, a Business logic layer, some Utilities, the Model objects, a Persistence layer and a Helper layer.The Action layer is supposed to be ...
hi! I'd like to kill many threads I throw. I use Thread class. do have I to kill them using "join" or "interrupt"? thank you!
is prototype just use clone substitute the "new" operation? but client must know about manager and concrete products and initial manager with products he or she wants,so what's use of this manager and clone-- if client want to get product, he or she must "new" it and then clone it .in my view ...
helloIve read about the Model-View-Control Architecture and understood it ,theoretically atleast!! Ive found huge coding fr explaining the concept. Thus I am unable to visualise this pattern in terms of coding. Can someone please explain it to me with a simple example and some method ...
I have no idea where to start with this! I might even be posting in the wrong forum. Anyway - here's my problem.I have algorithms which I have written. They all all perform a task, but have different approaches to it. They all implement an interface I have written.Now. I want to design a GUI ...
How is this supposted to be connected with good programming practise on a class-diagram level?Say I have a board game, say tic tac toe. All my logic are in the classes Board, Player and Move. I also need a GameController class that controls the game. Now I want to have an UI for this game. Say ...
Hi, I'm reading a book on EJB patterns, and the motivation for many patterns seem to be minimizing network calls. If my application server and web server which serves as the EJB client are on the same machine, then to what extent should I consider the minimization of network calls as a factor ...
1171 byte By
bachewa at 2007-10-2 10:19:17
I'm new to this design pattern (and this forum too). I would like to know about your experience and advice on command pattern.Is it OK to implement it this way?TypicalCommand cmd = new TypicalCommand();TypicalInput in = new ...
In java ,Is method overloading is a compile time polymorphism ?I mean all those method calls will be decided at the time of compilation .. am i right ?
Hi everyone,I'm developing a bacth application.This application has to read a file in which each line represents a Business Object.To parse this file i've done a static method which, from a line of this file give me an Object.that's ok !.But, i've also done a Reader (suchn as ...
Hi,I know sounds silly, but what is the difference between Property, Attribute and Parameter? In what cases every of this words is used?Anton
258 byte By
Saisha at 2007-10-2 10:23:52
Well, Daffy up and got that thread deleted for us. Too bad the admins could not save a few of Loko's excellent explanations that were contained therein. Starting a new thread in case anyone wanted to post a recap. Nice job Daffy.- Saish
What happened with the latest daFei's thread? It was not so useful thread, but at least there were a lot of interesting and important replies there, posted by the others.Did someone here ask to delete that thread? Or did Sun decide to do that, without our request?
HI all, i am designing a messenging application which has following modules : UI Module DB Module Messenging Module UI to DB connector UI to Messenging connectorMy problem lies in Messenging module. The purpose this modules is, it should provide a destination for the messages and an interface ...
1783 byte By
fragorla at 2007-10-2 10:31:03
This is very non-specific question, I'm sorry. Still, it's something that comes up from time to time when I write java.Basically, suppose an object takes a list of something in it's constructor. The object expects that that list of something contains no nulls - ie it calls a method on each ...
4347 byte By
jvaudrya at 2007-10-2 10:31:50
Hi, I've been thinking about how to write a reusable composite object. Basically this would be a simple implementation of the composite pattern, but would be general enough that you could reuse it in many places. Here is an example?after the examples I talk about my problem./** * Composite ...