Ridicuouls early optimizations

1155 byte By fedetxfa at 2007-10-3 0:32:34
How many objects in memory are too many so as to justify changing the desing?Some people think thousands is too much and they start implementing logic in stored procedures and using temporary tables to store results so they minimize the amount of objects they keep in memory.I had to rewrite ...

Remove inheritance but keep polymorphism?

2265 byte By stcinifeica at 2007-10-3 0:35:32
Hi guys,over the years our code has gotten very complex and there are some very long inheritance chains. I would like to break this up using composition. e.g.class V1{public void doSomethingElse(){}public V1(){doSomethingElse();}}class V2 extends V1{public V2(){super();}//Overridden method used ...

Implementing Simulator Using Reflection

1168 byte By HypnotiCa at 2007-10-3 0:38:46
hey my friends,I'm working on implementing a Simulator for PIC Microcontroller which executes Assembly instructions and makes appropriate changes in Register File and Memory.The way I execute instructions is as follows:I have an abstract parent class called Instruction, then I made each ...

Scheduling application

1314 byte By serezhaa at 2007-10-3 0:40:59
I need help on design in class scheduling application for my university. The data is taken from xml file which is a database transformation to xml. My classes reflect xml file:Instructor, Course, Department, Room, Semester, Schedule.Schedule is an entity that has instructor, course, room, ...

UI: A class of its own or built by objects?

193 byte By ThomasOwensa at 2007-10-3 0:41:05
Should the UI be an object in and of itself or should the top-level container be built and maintained by a UI object while the components to this are designed and added by other objects.

Designing login screen

294 byte By el_killer_rifaa at 2007-10-3 0:52:08
Hi gus!:I have a question: Which approach is better? - From the login dialog instantiate the main Window of the application or - Begin the application, then show de login dialog and if the username is valid, dispose the dialog and return to the main appThanks

null checks

267 byte By kollareddya at 2007-10-3 1:03:33
Hi all,While designing an application, what are the basic guidelines for the following:1. when to make a NOT NULL check on objects. 2. when to throw an exception in case of an object being null, in a use case flow.Thanks in advance.

response time

197 byte By kollareddya at 2007-10-3 1:03:36
Hi all,I would like to know design strategies for applications where the response time is critical.Any pointers to any related articles is appreciated.thanks in advance.

Hibernate, DAO pattern, and other related issues

2156 byte By jds@ku.edua at 2007-10-3 1:06:33
I joined a team of developers that are putting together an app to help museum managers track the contents of the museums. The app uses Hibernate to deal with persistence. I've got lots of Java experience under my belt, but most of it was for apps with no persistence requirements, so this is ...

Using DAO and DTO, or changing Patterns

2861 byte By zyphosa at 2007-10-3 1:08:15
I have been working on a web project that revolves around scheduling events and enrolling people is said events. The schema is fairly straight forward, but does not lend itself well to OO, or at least what I have been used to. Before I get to the questions, I'll layout the basic idea of the ...

Is any one to comment on my OO Design? Anyone and everyone is invited..

5496 byte By Jameel.Khana at 2007-10-3 1:08:32
Hi to all design gurus I am designing an application for lawn tennis match using java to track the score of tennis match .The input to the application will just be which of the 2 players won a point. Based on this, the program needs to compute and display the current score.e.g., Input( who won) ...

can any one help JFrame

4242 byte By benzspidaa at 2007-10-3 1:09:37
Just stated learning Java. trying to create a java EmailFrame which will display a blank Submission Complete message.but i keep getting error message when ever I try to compile the code.error (Can not find symbol symbol method submit)this is what my script looks like import java.awt.*;import ...

Struts -> Hibernate

1231 byte By Petersona at 2007-10-3 1:12:11
Hi,I am currently working on a small (for me quite large) project with Struts. Some basic InformationI am quite new to J2ee applications but decided to work with Struts, because there are more references of tutorials and I have little experience in it.For O/R mapping I use Hibernate.Now my ...

Easy to understand and follow OO design.

649 byte By iain_8a at 2007-10-3 1:12:41
Has anyone ever found that when they have to fix a simple bug in a large OO application, that so many complex patterns, abstactions, polymorphism, and an excessive numbers of interfaces make the code very difficult to navigate, and that you have to study for hours to get your head around the ...

Agregession Vs Comosition.

892 byte By rajpuniaa at 2007-10-3 1:18:10
Hi Folks......There Are two ways of Creating of class NPSHistory 1>By calling the Constructor of Another class2> By Calling the MethodHere We are Importing the Class NPSHistoryWhich is the Correct Way for Agregestion and Composition/////Case 1 For Composition////////public ...

Basic understanding of DAO pattern

1794 byte By jds@ku.edua at 2007-10-3 1:21:22
I'm starting to think (based on my confusion trying to implement the DAO pattern and some responses to another forum topic I posted) that I don't fully understand the DAO pattern. (This doesn't really surprise me).If I have a data model class, for example Shape, would I...A. write a DAO ...

DAOs for classes that implement a common interface?

1591 byte By jds@ku.edua at 2007-10-3 1:31:15
If I have two classes X & Y and a common interface Nameable as followspublic interface Nameable{ public String getName(); public void setName(String name);}public class X implements Nameable{ private String name; private String someString;}public class Y implements Nameable{ private String ...

Singleton question

949 byte By amjavadeva at 2007-10-3 1:35:11
I have an existing object DataManager that gets passed to many other classes' constructors because those classes need a reference to this object. Now, understand that I never need to instantiate more than 1 object of type DataManager during a run of the system. So, I'm thinking that ...

Is this an instance of the Observer pattern ?

3318 byte By sumabhata at 2007-10-3 1:38:50
Hi,I am very new the Design Patterns way of thinking about architectures.This is for a school project, for my Designing with Design Patterns classand we use the Gang Of Four book as the text.The posting is a bit lengthy, please bear with me.I am given the design (a Rational rose mdl) for an ...

Is this MVC?

1073 byte By sandsatera at 2007-10-3 1:48:48
I just finished reading Head First Design Patterns, which learned me a lot of stuff. But after reading the chapter about MVC I got a bit confused. I thought I was making my programs MVC (at least tried to) but now I am wondering. I take a small example.I have a simple UI with a button and a ...

Sun Transfer Object Pattern renamed?

506 byte By _dnoyeBa at 2007-10-3 1:49:12
If you see the pattern here which Sun is calling TransferObject pattern http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.htmlIt seems as if that is a name change and the original name was ValueObject. All the pictures contain the name ValueObject. Furthermore the DAO ...

Difference between Session Facade and Business Delegate design patterns

103 byte By raja2006a at 2007-10-3 1:59:00
Can someone tell me the differences between Session Facade and Business Delegate design patterns

Trying to move away from many if-else statements

4091 byte By SmellyCata at 2007-10-3 2:07:25
I have been trying to refactor some code so I could extend certain featureswithout having to modify my existing code.I used to have some code like this:public class Dog extends Animal {}public class Cat extends Animal {}public class MyParser() { public void parse() {...MyBuilder builder = new ...

designing high performance j2ee distributed application

716 byte By kollareddya at 2007-10-3 2:09:48
Hi all,I am currently working on designing a SOA based distributed J2EE application where high performance is the main criteria(data retrival must be very fast). The database and application servers can be many in number and in different geographical locations.I would like to know the various ...

Weird situation that does not allow to implement DAO

1035 byte By jfreebsda at 2007-10-3 2:12:57
I've been looking designs to access persistence services with hibernate.Some elegant solution is to create concrete classes ( DAOs ) that implements some DBPersistenceService for example and interact with those DAOs using DTOs or not ( depends ).My design is not like that, otherwise the query ...

Java EE Compatible Polling Solution?

1030 byte By Saisha at 2007-10-3 2:14:27
All,We recently discovered that there are a mish-mosh of solutions in our code to address polling. Basically, when a truly latent request is issued, we would prefer callback. However, not all third-party vendors support (or, more importantly, guarantee) callback. In these situations, we resort ...

Instanciate an object depending on a variable value

1533 byte By Elessaera at 2007-10-3 2:18:39
Hi there,I am developing a Web application based on a JSP+persistency MVC framework. In a number of classes, I have to be able to instanciate a "model" object (OO mapping from an RDBMS table) whose type depends on the value of a String variable. Currently, this is done this way: ...

When to determine if you have too many layers or too much abstraction

1110 byte By jaybyteza at 2007-10-3 2:18:48
I have a simple Struts application that has the following layers:Action -> SessionFacade -> BO -> DAOSessionFacade, BO, and DAO all have a interfaces for each object in that layer and a factory to abstract the creation between the layers. While the implementations for this simple app ...

MVC without EJB

652 byte By javaksa at 2007-10-3 2:32:10
So I just started learning JSP/Servlets a couple days ago and have made some great progress. As I try to do things correct the first time I wanted to run my thoughts here and see if they are correct or completely off the mark...I want to use MVC type architecture, I do not have an application ...

Java Time conversion

252 byte By mk47a at 2007-10-3 2:34:02
Hi I know this must a simple thing to do in Java but I can't seem to find it. I need to convert UTC time in millisec into GMT regular time. i.e.1155000000000 should be converted to Tue Aug 8 01:20:00:000 GMT 2006Thnx

any idea similar to this view?

1223 byte By sakurabiru_86a at 2007-10-3 2:39:21
i'm still new in learning Java..by using JCreator LE, i've try to make a simple task..can anybody help me by giving any idea similar to my task attach below?import java.awt.event.*;import java.awt.*;class Aplikasi {public static void main(String[] args) {ApplicationFrame tingkap;Bekas ...

DAO Class size

519 byte By adamreida at 2007-10-3 2:47:14
Hi,I am using the DAO pattern in the data tier of an app. I am writing.The DAO Im using to represent customers is CustomerDAO.The trouble is, I have quite a few operations in the CustomerDAO and the class is getting too large to manage. ie. findCustomer, updateCustomer, insertCustomer etc. ...

Implement command pattern in any way or anything similar or anything at all

991 byte By sandsatera at 2007-10-3 2:48:35
I have a controller class that listens to button presses from my button panel, and it also listens to mouse actions from another drawing panel.When I press a button, it indicates some kind of drawing is going to happen in the drawing area. Only one action could be "active" at the same time. (To ...

name of the design pattern

1022 byte By ilango171a at 2007-10-3 2:52:25
HiI have been studying a piece of code somebody else wrote. I am wondering if this is the Factory Method design pattern that this represents. I am new to patterns and I would be very thankful for any suggestions. public class Creator {public Person create(String gender) {if ...

where do you put your Servlets / JavaBeans?

233 byte By javaksa at 2007-10-3 2:53:53
So do you put your Servlets and JavaBeans in the same package or do you always keep them seperate? And in your names do you put in the word servlet/bean to further help identify the object? (ie controllerServlet, customerBean)

Usage of default access modifier

206 byte By sri1025a at 2007-10-3 2:55:27
Some programmers don't use the default access modifier (package level). Is there a specific reason? If so, what is it? Or is it a good to use default access modifier?Thank you,Srikanth

MVC questoin

2629 byte By TimRyanNZa at 2007-10-3 2:59:40
Hi there, this is a long blah - hope it makes some sort of sense! :-)I have some data (lines of text) that represent keyboard and mouse commands among other things - each file might have say 500-2000 rows in it. It is possible to represent the data at the raw level (i.e. press mouse, release ...

Hibernate-Pattern

126 byte By aimsa at 2007-10-3 3:00:53
Hi,Can any one please to inform that what are the design patterns applied in HibernateRegardsThiru

Correct patterns. Factories

1627 byte By usuario123a at 2007-10-3 3:01:12
How can i implement this? or perhaps it is correct.My case is the following one:-I磛e got an object called "series" that represents a sequence of objects. For instance: BrushYellowSerie(set of yllow brushes), BrushRedSerie. - I磛e got an object called "reports" that represents reports about the ...

Hibernate in place of EJBs

485 byte By pmohanana at 2007-10-3 3:04:04
Hi..All,I am trying to understand Hibernate & how it plays a role in the J2EE architecture.Earlier we had developed a J2EE application which the following architecture in place :MVC- > EJB -> DAO-> DBWhat I heard from my colleagues (who are also trying to learn hibernate) is that ...

Some Architectural/MVC Questions

4901 byte By finalfrontiera at 2007-10-3 3:04:09
Hi, I have some random questions/confirming suspicions about MVC and Services-layer.To give little context for my questions; I'm creating a Swing desktop app. and I have DAO/Service/Domain layers (first time I'm using these layers). My application consists of a single JFrame, menubar, 3+ ...

Design Objects with some common attribute/behavior. Is inheritance correct?

1306 byte By abhi73a at 2007-10-3 3:13:27
Hi, In an application I am working on the domain/business layer has lots of domain objects. many of these domin objects aggregate to form other domain objects. Also in the application we have a class "User" that has the user information and privileges of the logged in "User." When updates to ...

Hibernate, DAO pattern and tree hierarchy

958 byte By tauma at 2007-10-3 3:20:58
Hi all,I use Hibernate for a short period of time and now I'm facing a complex problem . I try figure it out what is the best practice for the following scenario:I have the following classes: Department, Team, Position, all of them inherited from a Entity class even there is almost no ...

Avoiding multiple else ifs

778 byte By sri1025a at 2007-10-3 3:21:40
Hi,I am accepting an argument from a method and I want to enforce the user to send only a particular list of arguments (say: "Dog", "Cat", "Monkey"). So, I have created an interface and stored these values as constants.Ideally the user of this method will call this method ...

Client/Server/Servlets Design Problem

573 byte By xfana at 2007-10-3 3:32:18
Hello,since 1 month i work on a server, which check all 5 seconds for change on some sensors. the server could register multiple modules (in form of objects) for multiple sensors, so if one state of a sensor change, the registered's moduls for this specific sensor will be invoke and compute ...

How about throwing 5 different types of exception?

440 byte By sri1025a at 2007-10-3 3:33:46
I have a method which can potentially throw 5 types of exceptions. But is it good to throw them as 5 types or is it better to reduce it to 2 or 3 at the max?Cause I don't know whether an API user will like to have 5 catch blocks. Ofcourse, they always have the choice of doing a catch all ...

Context Object

2532 byte By abhi73a at 2007-10-3 3:44:42
Hi, We use ContextObjects in our application as described in the book "Core j2ee patterns". We use the Request Context Map strategy. The RequestContext has validation support. We have implemented it by having an AbstractContextObject that has a Map. HttpContextObject, XmlContextObject, ...

To DAO or not to DAO

1381 byte By ClothEarsa at 2007-10-3 3:47:28
Hi all,A small part of my long-lived application loads a bunch of data into a business object from a database. The data is placed in the source database by a different application - we'll ignore that for now.When I wrote this business object I was unaware of DAOs and dependency injection and a ...

I want to Know about Vo and Serilization

252 byte By rajpuniaa at 2007-10-3 3:58:31
Hi FriendsI am having one doubtWhen we carete a Value objet then we provide a deafault constructor.Also we use to serilize it.What is the use of deafult construtor even if we are not intilizing any parameters..

factory pattern

9931 byte By kcraft4826a at 2007-10-3 3:59:45
Hello everyone,I am trying to architect part of an application that accepts a user's choice from a drop-down menu and creates an object based on that choice. I decided that the best way to do this was to represent each object with an enum that could be used to populate the drop-down list on a ...