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 ...
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 ...
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 ...
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, ...
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.
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
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.
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.
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 ...
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 ...
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) ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
Can someone tell me the differences between Session Facade and Business Delegate design patterns
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 ...
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 ...
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 ...
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 ...
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: ...
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 ...
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 ...
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
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 ...
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. ...
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 ...
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 ...
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)
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
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 ...
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
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 ...
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 ...
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+ ...
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 ...
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 ...
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 ...
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 ...
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 ...
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, ...
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 ...
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..
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 ...