When to use error pages

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 ...

class hierarchy

751 byte By itcareera at 2007-10-1 9:02:19
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 ...

J2EE and IIS

259 byte By aroraamit22a at 2007-10-1 9:04:03
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

Apache Ant Installation Problem!

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 ...

Using a string for a variable name

539 byte By benibozaa at 2007-10-1 9:12:08
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 ...

recommendation for string creation in DAO?

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 ...

What is this pattern

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 ...

Where to download org.apache.struts.action.* lib help!

354 byte By javasun_fana at 2007-10-1 9:23:40
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 ...

Evolutionary Neural Networks - Passing user's choice of factories

8175 byte By adamgreen19a at 2007-10-1 9:26:17
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 ...

Is Singleton thread safe

252 byte By planswermea at 2007-10-1 9:33:54
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?

How in Clustered environment Singleton work

112 byte By planswermea at 2007-10-1 9:33:55
In multiple server environment, ( ie. clustered env) if we have some singleton classes how it will work ?

why is httpservlet abstract

692 byte By devavrata at 2007-10-1 9:38:07
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 ...

how can I return a object within a void constructor?!

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 ...

hibernate queries with criteria

1741 byte By ShadowShada at 2007-10-1 9:48:04
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 ...

MVC or any other pattern

426 byte By javauser2005a at 2007-10-1 9:48:58
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 ...

Abstract Factory or Strategy pattern?

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

Struts and Threads

101 byte By varun_strutsa at 2007-10-1 9:53:10
Are Struts thread-safe.Also please let me know the disadvantages of StrutsThanks

Projects & Research topics

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 ...

MVC Pattern

830 byte By wbrackena at 2007-10-1 10:02:36
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 ...

OO Design Issue help

757 byte By enforcera at 2007-10-1 10:03:24
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 ...

Calling DB from Struts

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

best design practices

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 ...

MVC Pattern, what is the best approach?

6642 byte By DesignAndSwinga at 2007-10-1 10:17:35
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 ...

Can any one validate this architecture?

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--> ...

Converting Java files to UML ( Rational Rose )

179 byte By jxta_goda at 2007-10-1 10:32:22
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

Server Initiated Push

113 byte By getmurugana at 2007-10-1 10:36:35
Hi ,can i push a content from the server to the client to the same window same as chat application?

DAOs implemented as SLSB

907 byte By jaybyteza at 2007-10-1 10:48:16
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 ...

Abstract Class and polymorphism - class diagram

741 byte By steekybeata at 2007-10-1 10:48:20
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 ...

Model-View-Presenter - help

9213 byte By codecraiga at 2007-10-1 10:49:55
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 ...

Post-MVC

1055 byte By dkrukovskya at 2007-10-1 10:53:40
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() ...

Service Locator pattern in non j2ee

2489 byte By epicwintera at 2007-10-1 10:55:43
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 ...

optimistic locking with ORM-hibernate

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 ...

Rich Client Patterns - collaboration

470 byte By codecraiga at 2007-10-1 10:57:02
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 ...

Model-View-Controller (MVC) + Cyclic Reference (Only 10 Lines of Code)

3572 byte By kennethza at 2007-10-1 10:59:47
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 ...

Extending by adding fields

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 ...

Software engineering versus Software testing

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 ...

Can an Interface have no methods

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 ...

The Role pattern

1421 byte By jfreebsda at 2007-10-1 11:30:14
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 ...

Package names with MVC

1345 byte By ArneWeisea at 2007-10-1 11:30:46
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 ...

Design Issue

495 byte By baiju@suna at 2007-10-1 11:34:34
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 ...

Create Instance passing String

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

Doubly LinkedList

3011 byte By TheWelshmana at 2007-10-1 11:38:48
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 ...

hierarchical decomposition

387 byte By infinite_javaa at 2007-10-1 11:42:58
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 ...

MVC controller - switch statement?

600 byte By syzygetica at 2007-10-1 11:43:45
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. ...

Combining Data Objects and Value Objects

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 ...

Setting a variable in DAOs

2859 byte By tv1970usa at 2007-10-1 11:45:49
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 ...

Should sub-subclasses implement the original interface?

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 ...

When "ab".equals("ab") returns false

1229 byte By tjacobs01a at 2007-10-1 11:46:16
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 ...

Design review

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 ...

true singleton implementation

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 ...