1809 byte By
Greg439a at 2007-10-1 8:57:56
HelloI designed an application and I wonder if I overused the error page to catch user defined class exceptions. I would use it to display instructions to the user, what they missed or need to do, etc. I've noticed that some people when throwing an exception in a jsp catch it in the same jsp ...
Hi, I wrote a class called readLevel1 it has two primary methods 1.readLevel1Data 2. readLevel1logsince these methods were very strechy I made each one as indipendent class, now readLevel1 has to call these 1 & 2 methods( now classes). How can I call these (1 & 2) in readLevel1?.Now I ...
can Java application server be co-resident with IIS ?I want my j2ee architect be able to invoke applications using Microsoft IIS server . Can anybody tell me whether it is feasibile , if it how it can be done .Thanks in advanceamit
2590 byte By
odaegaa at 2007-10-1 9:10:01
Hey everyone,Sorry if this is a stupid question but I've been trying to install Ant for the last day! I downloaded it and unzipped it to C:\apache-ant-1.6.2 and did the following:1) I set JAVA_HOME to C:\j2sdk1.4.2_07\ . This works fine as JBoss is already using it2) I set ANT_HOME to ...
HiI'm trying to redcue the amount of repeating of code i'm having to do. My program is going to have a large number of JComboFields i was wondering if there was anyway i could use a for loop to repeat a method on a large number of JComboBox's by using incrementing a integer and adding it to ...
1472 byte By
ptomsica at 2007-10-1 9:16:00
We have a DAO layer that retrieves it's SQL from a property file, thencreates a prepared stmt and binds variables to the stmt from methods passed to the finder method.For ex.public static User[] findUsersByLastName(String[] lastNames) throws UserException {// create the sql objects...// loop ...
16081 byte By
WirajRa at 2007-10-1 9:22:44
Hi every oneI wrote a class that generates a GUI depending on what type of data being displayed thing I am sure it is some kind of design pattern but I dont know what it is I need it for my documentation can you please tell me what it is and some useful links to read more.package ...
I created a class ,importing org.apache.struts.action.* but nowhere i found such class/jar file in the jakarta-struts dounload ,when i compile the class using the above i get org.apache.struts.action.* class not found error..I don't know how to import this class file .Can anyone ...
Hey Guys,For some time now I have been working on a distributed genetic programming machine (which uses neural nets). I have made previous posts, which I can't find (sorry), JosAH, Duffymo and Yawmark were very helpful though - perhaps you may remember something about this? I have come accross ...
I want to know whether Singleton is thread safe by default ?If I want to make the business methods of the Singletons class' thread safe how do I do it ? What is the permormance implications if I make those methods as synchronized?
In multiple server environment, ( ie. clustered env) if we have some singleton classes how it will work ?
Hello,This might be an oft asked question, but I still haven't found a convincing answer. Why is HttpServlet designated to be an abstract class even though all methods have an implementation?A general tendency would be to assume that this would be to stop the class from being instantiated ...
400 byte By
CDFUNa at 2007-10-1 9:39:14
i got the followingpublic void Player (String name,String key,Server server){gui = new PlayerGUI();server.addServer(this);return(Player)PlayerSet.getPlayers; // obviously this line is incorrect....but I need to return a valid object....within this void method?!?}this is the default ...
First excuse me for my poor english. I've a little problem using hibernate queries with the api criteria.For a class like public class Document{private User owner;private String title;..........}with the classe Userpublic class User {private String name;......}with criteria queries i wondered ...
Hi All,I am new to patterns.I am using MVC design pattern in my project using JSP,Java servlet technologies.But the controller file is growing more and more as there are more request parameters and it is only beginning.By the time project gets finished the file size may grow.Can I distribute ...
285 byte By
gobi7a at 2007-10-1 9:49:05
HelloCan anyone tell me the difference between abstract factory and strategy pattern? I need to create a interface that needs to variate on different mobile phones (color vs non-color phones) ? Can the factory pattern help or is the strategy pattern enough ?Thanks
Are Struts thread-safe.Also please let me know the disadvantages of StrutsThanks
372 byte By
raghavaa at 2007-10-1 9:53:55
Hello,I don't know whether I can post this sort of question in this forum.Iam doing Masters in Computer Science. Can anybody suggest a project. The duration should be about 8 months. It should be on patterns & OO Design centric. It should be a new one. Or can anybody suggest some ...
I perceive MVC like this:View = presentation onlyModel = data (application state)Controller = performs the logic and moves data between model & view and vice versaHowever, take a look at the diagram on this page: http://java.sun.com/blueprints/patterns/MVC-detailed.html...they have the model ...
Hi,I have a class that draws a GUI, i want to know whether the listener for the GUI, should be kept in a seperate class, for oo design. The problem i am having is that i have variables that i am using in the GUI and i would also need in the seperate listener class. My problem is the GUI class ...
98 byte By
dsn29a at 2007-10-1 10:10:30
I want to access DB from Strutus framework without using EJB, Pl. suggest the best approach
1777 byte By
Greg439a at 2007-10-1 10:15:21
Which is preferable in design? I want your opinion so I can design better apps. The jsp below shows the amount of interest in an already instantiated class with the proper data loaded. I just want to show the interest to the user via jsp, but whats the best way to provide the flexibility in ...
Hi, I am currently designing a software application for a restaurant.It is a standalone application using MySql as a localhost databaseand the GUI is based on javax.swing library.My problem is the design.I am trying to follow the MVC pattern but still not sure if my approach is robust or ...
2685 byte By
koela at 2007-10-1 10:18:12
I have designed an architecture for my Application using MVC framework. I need wise advice on my architecture.Please validate.The architeure is**************************************************************************************** JSP ->Struts Action class - >Businessdelegate--> ...
Hya,is there a way to reverse engineer my Java files, using an automated tool into UML class diagrams. ( preferably in Rational Rose format )thanks in advance
Hi ,can i push a content from the server to the client to the same window same as chat application?
I am a little confused about the implementation of DAOs and what is the best way to create them.On a few jobs I have worked, a DAO was a simple class that contained all the necessary interaction with a data source...whether it be a database, config file, xml, etc. SLSB (working as a Session ...
Hi, ]Im trying to draw a class diagram for my overall system but im not too sure how to deal with classes derived from abstract classes. I'll explain my problem using the classic shape inheritance senario...myClass has a member of type Shape, but when the program is running shape gets ...
Hi, I have some questions about M-V-P...i posted in the "Java Programming" forum..and then I found this forum which seems more suitable...so I am posting here... I recently read about Model-View-Presenter on Martin Fowler's website, and elsewhere. I think I understand the idea...The view just ...
An interesting idea just came into my mind. We all play with MVC and its variations where we have Model and Presentation + UserInterface so we end up with code likeclass ViewController {void updateModel() ...
Can I use the service locator pattern in a non j2ee swing application? I have data access objects which all need access to a database connection and various other service like meta data classes and such. Currently I am passing a reference to a class which has all these services within it ...
1573 byte By
an1xa at 2007-10-1 10:56:02
Hi,I am a little bit confused about concurrency management. I am interested in optimistic locking, and using hibernate as ORM layer, POJOs as other things. Presentation is a flash gui at the moment.What I understood from some documents (including the book Hibernate in Action), I get a copy of ...
Hi,I am interested in learning about "rich client" design patterns (MVC, MVP, etc). I learn best by clear, constructive sample code (aka Hello World :) .....I am looking for other ppl interested in these sorts of things who would also learn by seeing simple sample code which demonstrates a ...
Please read the following classes first.// First Versionclass ClassA {private final ClassB b;public Class A (ClassB b) {this.b = b;}}class ClassB {private final ClassA a;private ClassB (ClassA a) {this.a = a;}}Now, both ClassA and ClassB are impossible to be instantiated.(For people who says ...
748 byte By
sjasjaa at 2007-10-1 11:15:21
An odd thought occurred to me:Let's say you were to extend java.util.Date to include nanoseconds. Add a field "int nano;"But that makes a more general class (one that can have nanos) out of a less general one (no nanos.) Is that taking inheritance in the wrong direction? Isn't subclassing ...
372 byte By
Xanoa at 2007-10-1 11:15:50
HelloI would like to know if anyone could explain to me the differences between SE and ST.I have been searching a while on the web to see if I can get any enlightment in the matter.If you know the answer or have a link were this is discussed, please don't hesitate to post it here.I would be ...
387 byte By
schlapsa at 2007-10-1 11:21:25
HI all,I am currently using an interface called RequestSender that extends the interfaces Runnable and ConnectionListener. I use the Run() method from Runnable and connect(socket s) and disconnect(socket s) from ConnectionListener.I was wondering whether it was good OO design to define an ...
Let's suppose the next scenario ...abstract class Role {}public class DefaultUserRole extends Role { createNewMessage(...) }public class ModeratorRole extends Role {}public class AdministratorRole extends Role {}public class User { List roles; }If the User logged in the system wants to create ...
Hi! I'm writing an application that will use pre-made models of electrical components, all laying in the sub-package "parts".I now want to apply MVC to display these components to the user, and letting the user interconnect different components and simulate the resulting circuit.In my current ...
I had a dicussion with my manager regarding a developement issue, the discussion is for parsing the XML and display the data, the manager wants a tag libirary to parse the XML and display the details, the project developed using Struts framework.I am aruguing using the pasrse in the view layes ...
217 byte By
_AM__a at 2007-10-1 11:36:16
Hi,I have one method which takes up a string parameter.I need to create an instance of that string. .could you plz. tell me how to do that.. Thnks in advance.regardsamj
i am having trouble implementing a doubly Linked linked.i have skeleton code below and have labelled the parts i am confused of what to do. I would really appreciate any ideas or if someone could check over what is already there. Thank you.import java.util.*;public class LinkedList implements ...
John Lakos in his book http://www.amazon.com/exec/obidos/tg/detail/-/0201633620/103-9181187-2679064?v=glance( Large Scale C++ Software Design) says.,"Inherent coupling in the interface of related abstractions makes them more resistant to hierarchical decomposition." Can anyone throw some light ...
I'm currently writing out the general class hierarchy for an MVC GUI application. In a number of my views, the user may press any number of keys to manipulate the model. I send the key codes to my controllers. My question involves the mapping of these key codes to application state changes. ...
443 byte By
gseela at 2007-10-1 11:43:49
We have objects that represent entities (Data Objects) and Value Objects that provide representations of data (basically String arrays of values and XML representations). Some Value Objects represent complex entities but others map 1:1 to Data Objects.Is it good practice in 1:1 mapping cases to ...
I am using DAO pattern in my project and it works great. I do have a question for which let me give you some background:I have a class "Location":public class Location implements Serializable {Short locationId;String locationName;public Location() {}public Location( Short locationId, String ...
308 byte By
iamiqrka at 2007-10-1 11:45:58
Say I have an interface I.Class A implements interface I.Class B extends class A.Should class B also implement interface I? Obviously it doesn't have to, but is it considered better design to explicitly state that? Does it ...
One thing that really ticks me off in java is the narrow-mindedness of equals. Given the specifications laid out in Object.equals(), it becomes extremely tricky to ever have equals return true for comparison of Objects of different types."So what?" You say. Well, back to the original title of ...
4778 byte By
kilyasa at 2007-10-1 11:54:00
While formalizing a design review process I have formulated the following checklist, Any input modification from you guys if something needs to be added or modified would be welcome.ARCHITECTURE DESIGNqIs each use case identified is represented by one or more classes in the design?qIs each ...
794 byte By
aedgara at 2007-10-1 11:57:42
Am I correct in believing that an implementation of the Singleton pattern cannot guarantee the existence of at most one instance of a class across an entire JVM if it uses only simple Java constructs? I understand that the ClassLoader framework allows a class to be loaded several times by ...