Is it possible to in some way force the use of a protected constructor?Like the use of certain methods are forced by implementing an interface?
375 byte By
shahshya at 2007-10-1 19:43:48
Hi,I am writing a stand alone java program that does following things.1. Connects to db, reads some values from tables.2. Performs some business logic.5. Email it using SMTP. This would have a main program and few helper classes. Does it make sense to use any specific pattern for this? Any ...
341 byte By
Statixa at 2007-10-1 19:48:32
Hi.I want a communication between two MVC's, offcourse in one project.What I have:MainWindowView (MVC) | +--> MenuView (MVC)In my Menu MVC there is a button Logout. When this one is pressed the model had to tell the MainWIndowView that he can close.How can I do ...
Hi,We have a Java Web Start application, which caches around 500MB of heavy weight objects in memory. These corresponds to different reports and it kind of grows over the time. I am looking for some kind of architecture framework or some work around to maintain this cache at the client side. It ...
2510 byte By
Dash161a at 2007-10-1 19:52:52
I have stumbled across some design issues, with a carhire system i am making.kept in[CAR]->[GARAGE] ||| Retives car from garage | | | [TIMESLOT]As it stands the GARAGE class automatically has CAR objects added as attributes.import java.util.*;public class Garage {//class attributesprivate ...
Hello,I currently have an application that loads an XML file that comes in 2 parts. It follows this format:<Report name="report name"> <Description>description of report</Description> <Data>... </Data> <Display type="type_of_display">... ...
2754 byte By
voland4a at 2007-10-1 19:56:09
What better to use:1.class MyConfiguration { private static String text; public static String getText() { } public static void setText(String text) {this.text. = text; } static void load() {} static void save() {}}and use like ...
Hi,I磎 trying to develop a framework to persist objects as soon as they change. I would like to observe a set of objects, and when something changes the state of that objects, the framework should persist the new state.I could use the observer pattern, but then the subjects, the objects the ...
<font size="3"><pre>In our enterprise projects we deal with some screens where we add or update some data and againwe retrieve that data and display to user in various ways like displaying on screen asa report or viewing in excel etc.. Most of the times, though we identify the ...
1252 byte By
musica at 2007-10-1 20:07:31
I write an application that implement DAO pattern.In DAO pattern : a DAO object map a table.Ex : ProductDAO <-> Product table, OrderDetailDAO <-> OrderDetail table, OrderDAO <-> Order table.+I wanna get data from 3 table about with fields : "ProductName" from Product table, ...
I have a singleton class, which has some static member variables like:-private static byte[] someArray;private static CallbackIF objectOfCallbackIF;static final String SYSTEM_DATE_METHOD_DECODE_TIME="decodeTime";etc.My query is If I have a Singleton class, it will have only One Object..Then why ...
122 byte By
musica at 2007-10-1 20:14:11
My website can serve 600.000 users at the time and I use Connection Pool. What's the best pool size I can config ?
I want to use a JMenuBar to produce some "redundant" functionality into my program. Say, for instance, the user wants to print something. I can have a print button on screen an a print option in the file menu. I can have both objects call a static printRecords() menu in one of my other classes. ...
1514 byte By
Atul4ua at 2007-10-1 20:15:24
I want to connect my oracle databse in my Struts applicationPlz give me steps for connectionI have written following code in struts-config.xml<data-sources><data-source type="org.apache.commons.dbcp.BasicDataSource"><set-property property="autoCommit" ...
hi,can anyone suggest me a brief description on a project on aspect oriented programming.i hope i'm knocking at the right door
1145 byte By
ZveNa at 2007-10-1 20:22:08
I have architectural question about exceptions handling in EJB application.Should I define custom checked exception for each fail (UserAlreadyRegisteredException, DublicateItemNameException) or I should use single ApplicationException? In the first case I can provide more info to client about ...
i need to develop a new application which want to prevent multiple user login. How can i do that? if i put all userid in a stack/arraylist and set it global, then set a filter to check the stack each time, is it ok, or have another better solution to do that. Thanks.
Hi friends,I have a design in which i am creating an Business Layer using EJB (Stateless). In my case i have only read only to DataBase and at one case where i will be updating the database. But my application will be accessed by many concurrent users.My problem is if i create a DAO with ...
I have code to get Connection which supports both DataSource and DriverManager. This same code is used in web applications with or without J2EE container. To use this code I have a ConnectionUtil class with 2 methods :public Connection obtainConnection( Properties properties ) throws ...
160 byte By
zx-abera at 2007-10-1 20:30:32
Hello, I am a beginner of java,I want to know something about the runtime and the compile-time.Please explain them to me.Thanks very much!
I've been reading "Design Patterns" (GO4) and the description of the Visitor pattern appears to denigrate the use of method overloading, although it says this is an alternative technique.Assuming that one is happy with method overloading, why does one need Visitor pattern at all? The extra ...
885 byte By
2pinga at 2007-10-1 20:38:04
i successfully created a framework using command pattern for a generic system & it is currently running in alpha stage, need critics or some people who created same solution and encountered problems,architectural overview specifics:J2EE 1.4 enterprise spec. ...
326 byte By
dgk_goaa at 2007-10-1 20:41:32
Hi . I am given a work of workflow for use case..At this point I does not understand how to go about it ...Is it that I need to draw flow chart or use case diagrams or something else ?I would appreciate any help because I need to complete the work by this week ...
my question is my xml can't be hibernate read;my class :package net.sf.hibernate.example.quickstart;public class Cat {private String id;private String name;private char sex;private float weight;only 4 fields;<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE hibernate-mapping PUBLIC ...
Hi, I have a scenario where a client pgm passes a command string to a Command Interpreter. There are several possible commands. The Command Interpreter accepts these command strings and makes API invocations on some other object.Some Commands would need to return a value, whereas some others do ...
Suppose I have a DAO method:public Department getDepartmentById( int departmentId) throws DepartmentNotFoundExceptionNow inside this method, if no Department is found having id equal to departmentId then I throw DepartmentNotFoundException.But there are couple of things which can go wrong in ...
1171 byte By
mc3712a at 2007-10-1 20:51:46
Ok, I've got some simple interfaces in my game like Thrustable, Fireable etc. And now I'm trying creating a player class, which should be able to fire & thrust or fire / thrust. I planned to extend the Player from Entity-class and pass an entity to it in it's constructor. The player ...
Hi folks,I'm trying to put together a gui for a little tool I am working on. In fact I have made one, but I get the feeling it is not exactly well-designed, and I was wondering what the best approach was in this situation:It should look like those installshield things we've all seen where ...
Hello,As a hobby I started a stand-alone java music application that allows to edit a music lead sheet (list of chords like "Cm F7"), select a rhythm and some instruments, and generate a MIDI accompaniment for that leadsheet (for those who know, it's a bit like the "Band In A Box" program). ...
Hi all,I am writing a module that will read an XML file. I guess the background is not too important here, so I will gloss over it. Basically, as different start tags are encountered during the reading process, I want the response to character data to vary. Eg:Start tag encountered: ...
1322 byte By
enaveena at 2007-10-1 21:01:46
I am new to webservice...one design questioni am writing a webservice to check whether a user is valid user or not. The users are categorized as Member, Admin and Professional. For each user type I have to hit different data source to verify.I can get this user type as parameter. What is the ...
Hello AllI am currently designing a stand-alone application that talks to a database. I am not using any design scheme (i.e. MVC) but i wanted to design the application were it could be readable and make sense. I have a series of forms, each handles its own events. I want to have a global ...
Hi all,I'd like to find an application which is recognized to have a stable and well-designed UI architecture (I mean the software architecture, not the visual appearance). My goal is to analyze it and use it as a "model" to check my own application.My main concern being the software ...
Hi,What is the best way to model an relationship between two classes in object model ?Assume there are a couple of classes.named A and B.Assume there is a many-many relationship named "relation" between A and B.From A, we can traverse this relationship to get a list of Bs. From B, we can ...
I am now reading on a surogate pattern, I am not sure as to what is the difference between a Proxy pattern and a state pattern.I currently reading the Thinking in Patterns by Bruce Eckel I really have probelm in understanding the Surrogate pattern design. I need concrete examples, is there any ...
Hi,I want to create a program that can perform tests/actions on another program.Example: Program A is the Testprogram, program B has to be tested.B consists of JTextFields and a JButton.Now, A has to start (invoke the main method of) program B and it has to get the strings in the JTextFields, ...
Hello everyone:I woud like make 2 quetions:1.- Where on MVC model must I put the connection to database? I'm using only servlet and JSP (not EJB)2.- Which is the best design in order to get a Java code free of sentences SQL? I want to avoid changes on Java code each time there are changes on ...
Hi,I have a question regarding use of Domain Model pattern. In our project we are creating customer profiles. We have modeled profile like thisclass Profile { Name name; List<Address> addressList; List <Phone> phoneList; ....}We have CRUD operations for Profile, Addresses, and ...
Hi,i am creating an application for a mobile device. A lot of menus exist and the RecordStore is used for persistence. Also a network connection is established respectively a network interaction with a server exists.I want to use the MVC pattern and would structure the classes as follows:All ...
435 byte By
sebvena at 2007-10-1 21:48:24
Hi,i try to implement a second version of my software, I tried to used patterns such as MVC, singleton,factory,,But i have the feeling that i can improve the application a lot more.Do you have any advises or guidelines about how to improve performance and design of a java application which ...
Hi all: I am working in big Project using java that project is prepaid billing system subscriber for mobile company. And in that system must be real time programming and calculations so we suggest to load all db in memory (around 0.5 million ?1 million). So is that good idea? And doesn抰 meter ...
344 byte By
AndyXa at 2007-10-1 21:57:52
Hi,Situation:if suppose a thread is sleeping and it has class method called sendMessage() it in.some other class instance requires to use this sleeping thread's sendMessage() method call, will this class instance have access to the method right away or is it blocked until the sleeping thread ...
Right now I am using AspectJ, but I want to know which one is better?1: AspectJ from http://eclipse.org/aspectj/2: JBossAOP from http://www.jboss.org/products/aop3: JAC from http://jac.objectweb.org
Hello thereI have a quick question about abstract classes. I have recently made an abstract class in which I declare a few variables common to the underlying concrete classes that extend the abstraction. However, I must tag them to be public in order for the concrete classes to access them. ...
Hi,I am writing a portion of a J2EE application and would like to perform asynchronous processing. Im new to JMS. Following are some questions i have:- How does JMS process message, queue and MDB? I mean when a message is send to a queue, how does it know which MDB should be receiving the ...
359 byte By
nigha at 2007-10-1 22:09:25
Hello.I have a problem with right understanding the part about blank lines in the java convention. Should I put two blank lines between inner or nested class definitions? What is the best place to put these definitions? Before variable fields? I tried to find it out in the internet but I ...
128 byte By
musica at 2007-10-1 22:10:13
Hi , AllI develop a website using DB2 and I intend to use jboss portal 2.0. I dont know Jboss Portal support DB2 ?
1607 byte By
_dnoyeBa at 2007-10-1 22:10:21
I have been working at this one for over a year. I got a few questions here but let me describe my clases first.I have a heirachy where 1 class contains a collection of another.Project class contains Architectures. Architecture class contains Systems. System class contains components.The ...
What interface would you propose to supply set with random access by index? Adding or replacing of elements shouldn't be supported, only reading and removing. Random access is required relativaly rarely and isn't encouraged for widely usage. In principle there is also option of rearranging ...
822 byte By
jhhdka at 2007-10-1 22:16:19
I am not entirely sure this is the pattern I want, but i need something similar.Problem:I have objects that require user to be authenticated to be called.I have objects that need a database connection to be called.I have objects that need to be called inside a transaction.All transaction ...