699 byte By
sim085a at 2007-10-3 4:02:01
Hello,I am sorry if this question has been asked more then once. I have just read a book explaining on how to develop a web application using light weight frameworks.In this book I was introduced to Facade Objects and Service Objects. Before I used to have only service objects (which managed ...
26 byte By
ramjia at 2007-10-3 4:02:17
Why we use toArray.
906 byte By
cloraca at 2007-10-3 4:09:38
Hi,I've read lots of examples and it seems to me that, in reality, these are bidirectional associations:Employee and Department (given an employee, you can find out what department(s) s/he belongs to; given a department, you can find out which employees are in it)Parent and Child (given a ...
I want to create object for class name.I am geting the Class Name at run time from xml file. That name will stroe in one string varible.I want to create object for that name. how its posible.
can any bdy plz tell me what is the use of marker interface ?
Hello!I'm interested in the smart reference proxy pattern but I only found some short descriptions of it on the Internet. What I need is some kind of example code.Can somebody provide me with an appropriate link or does somebody have experiences implementing this pattern?Thanks in ...
Hi, i have a problem. in my design, clients are observers for API changes. We made facade class as Observable. but i think its not appropriate design because i have to add some bussiness logics(related to notify observers) in Facade. what should i do?!
Hi allRight up front, Im very green with design patterns. That said :)I think I have a good grasp of the observer pattern. I wanted some quick thoughts on other design (or anti) patterns that you may also use with observer to avoid specific side effects, implement a M:M rel with ...
Hi Gurus I am having Five column in my table. I am fetchinh all the data in An arrayList. For Displaying Purpose I am using The code Below is for Displaying it on the jsp. I want to Use Iterator or some Other Pttern which will Bee suitable for It. Plz Bless with your Suggestionfor(int ...
8943 byte By
sri1025a at 2007-10-3 4:26:04
I have a properties file and I have a few sections like this:section1=truesection1.name1=value1section1.name2=value2section2=truesection2.name1=value1section2.name2=value2section3=falseWe wanted to create a Java object representing this properties file by composing the java.util.Properties.But ...
Hi thereI'm using WebWork with Spring and Hibernate . IDE netbeans.My Hibernate properties are in the applicationContext.xml that is placed just under the WEB-INF.When I try to call the: new ClassPathXmlApplicationContext("applicationContext.xml");or new ...
Hi In my application I need to dynamically create objects of types specified by string which is passed as parameter. I am able to do this if the class is inside the same jar. But I need to load the class from any jar name specified. How do i go about doing this? Is there a way to dynamically ...
I'm having difficulty organizing my MVC models and basically controlling the whole application in general. My application works, but all the controlling logic is being dumped into the main class (Main.java). Here's a simple example of the problem I'm having:Objectives1) Display a list of ...
i have a question i have this program in java that translates one language to another now i want to be able to add another translator later if i required at runtime without recompiling the whole thing.that is i should have the provision of adding new translators feature which i dont know now ...
hi guysi have got a question to ask about the delegate pattern. usually, we use it to decouple between presentation client and businessservice tiers. for instance, the service tier has an session ejb, and delegate wrapps the ejb. and the web client calls delegate to access service. is the ...
2686 byte By
pp8080a at 2007-10-3 4:46:20
Consider the following case:Dependency injection pattern:public interface A{void foo(String para1, String para2, String para3, String para4, String para5 );}public class B implements A {void foo(String para1, String para2, String para3, String para4, String para5 ){ ...}}now i have to write a ...
Hi thereI just wanted to know if my simple Dao Spring Hibernate implementation is good. Hope you can give me your opinions.public class BaseDao extends HibernateDaoSupport{public BaseDao() {}protected void saveOrUpdate(Object obj){getHibernateTemplate().saveOrUpdate(obj);}protected void ...
531 byte By
Mitch_Ja at 2007-10-3 4:56:28
Hi,I have a DataModel which holds quite a few fields - about 30. I want to implement this model such that each field also has a notion of being enabled or disabled. By default, i want all fields to be enabled. Then there's the tricky part - setting a field's value may enable or disable other ...
315 byte By
Omkarama at 2007-10-3 4:56:39
Hi, I want all the Java Patterns at one place; not the J2EE patterns. Eric Gamma book provides examples in C++.It's unfortunate that I can't find Java Patterns at java.sun.com.I am looking at javacamp.org.Can somebody suggest a good web site with all Java patterns in ...
Hey,How can i calculate how many times i have the following pattern {num}*** num - is a positive number .*** the number is between curly braces.Thank you .
I have a program with the following design:one WebServicewhich calls one EJB (Session bean).The EJB is calling one of 9 STATIC(!) methods (depends on parameter that webservice accept) which can call another static methods etc...I know this design is bad, and I want your recommended design for ...
1500 byte By
quadfxa at 2007-10-3 5:27:04
I currently have several "extractor" type classes and I am curious if there is a more efficient way of doing what I am doing now.Let me explain with examples:I have several Extractor classes calledSnowExtractorWindExtractorMetaExtractorDepthExtractoretc.each extractor looks very similar but is ...
So, I've got a "rich domain model" sorted for a fun little app Im playing with at home. All the "business rules" are in the model.So, next step - I guess I want a "Service Layer" which directs the use cases in the app, controls security and transaction demarcation and would be talked to by, ...
1145 byte By
jusia at 2007-10-3 5:37:14
HiThis is a question for anyone who might be familiar with the standard DAO design pattern and the Java Persistence API (JPA - part of EJB3). I'm new to this technology, so apologies for any terminology aberrations.I am developing the overall architecture for an enterprise system. I intend to ...
177 byte By
sri1025a at 2007-10-3 5:45:18
Hi,I was looking at the new features of eclipse 3.2's JDT and in there they have mentioned that re-assigning a parameter is considered a poor practice.Why?
HelloI need to know what is preffered regarding memory usage : 1) using static methods or using non static methods2) using static members or using non static membersbecause from a test a made, it seems that a combination of using static methods and non static members, is the best choise and ...
HelloI decided to rewrite my J2EE application.This application will be installed on Websphere App Server 5.My application should return XML's (as String) from remote requests, probably by webservice/es .There should be 9 kinds of requests.Which design do you recommend me to use ?Please suggest ...
Hi,I consider myself pretty new to oo, so this question might sound stupid.How do I link the UI to the application/busines/ domain layer?I mean can I pass messages from the domain layer to the UI or does the UI send messages?For instance, to update a result in a textfield do I send a message to ...
768 byte By
kilyasa at 2007-10-3 5:54:46
Looking at the Enterprise Service Bus architecture, where the bus is simply a static router and then adding on top of it some decision making capabilities it would be called a Dynamic Message Router as per "Enterprise Integration Patterns" and then further down the road, if you add a Business ...
940 byte By
Zubsza at 2007-10-3 5:59:25
Hello,I came across a performance issue in one of the application developed for our customer. The application is n tier application involving a rich client, EJB application server, DAO layer and data base. The data is transferred within the layers from DAO to client using value objects. DAO ...
330 byte By
akhannia at 2007-10-3 6:00:46
In a multithreaded environment, where multiple threads are reading and writing to a ArrayList, what is the most efficient thread safe way of reading and writing from a ArrayList without incurring the cost of using synchronized keyword.In simple words, have a thread safe arraylist, without using ...
Hi all,I've have to design an Java EE application which consists of a "Web Client Tier" which handles web based users and "App Client Tier" which consists of several application clients.Points to concern:1. The load from app clients will be more than from web clients.2. Typically the web ...
Hi All,I am working on a project which needs documents to be created. Currently we create 5 documents(pdf files). I would like to create a design so that tomorrow if there is need of creating new documents I can create them easily without much code changes. The documents format may be ...
Hi,I am doing POC for a fortune 10 client and they have some business rules before crud actions are going to take place in DB. We have very minimal tables (less than 10) and its small application but web service (btw, this has to be webservice app) consumers are around 200 per sec. The ...
1052 byte By
sri1025a at 2007-10-3 6:40:05
Hi,I have a setter method which throws an IllegalArgumentException which is of type RuntimeException... It means that I need not declare it in my method declaration, but I should explicity describe in Javadoc.Is it a good practice to declare it in throws clause just to make it more readable? or ...
Hi,Can anyone suggest me a good article on Singleton design pattern recently updated..?Thanks in advance.
Hi,I am facing an issue. Please find the following scenario.I have a login page which is under a secure host. When the login is successfull, the control will be directed to a non secure host, where I have to access a session variable which is set in the LoginPage (which is a secure host). Can I ...
404 byte By
SimonCa at 2007-10-3 6:49:31
Hi there. Just wondering if anyone could recommend a good book on design patterns, for someone who's relatively experienced at the nuts and bolts of programming in a few languages, but hasn't really considered design patterns before? Someone recommended Gamma et al's, 'Design patterns: ...
170 byte By
Gema at 2007-10-3 6:54:06
I am having trouble building a clock that goes from military time to regular time. It starts at 0930 and goes to 1730. It then performs a subtraction of the times.
Hi All,Hope so every body doing well, How do we handle this Service Locator Pattern,If the EJB 2.0 contain Local interfaces or EJB 3.0?.Becuase the Handle might not there.Please help me.How do we go with this.Advance thanks any suggestion or information.Thanks- ...
976 byte By
sri1025a at 2007-10-3 7:09:48
Hi,I have an abstract class, let's name the class Super and Super provides a lot of protected methods with default implementation for it's child classes. And Super is in package com.mycompany.superpackageNow, I have a class that extends Super and let's name it Child. Child class uses State ...
Any suggestion?
2446 byte By
valjoka at 2007-10-3 7:24:38
Consider a Gui, which controls some model. It may have listeners or strategies/templates observerving and reacting on the model changes. By running different programs, you invoke different strategies.The conventional way for coding two programs in java would be to instantiate a Gui and pass ...
Hi FriendsI have got one strnge Problem.I have got two Clases1>Door2>TimerOn some specified duration My door has to close suppose it is 15 sec.Also I have got two type of Doors a->Slidingb->RotatingMy Question is how to make them in class and what pattern will be more feasible to ...
Hi all,Does the following implementation represent a perfect thread safe implementation? public class Singleton {private volatile static Singleton test1;// Private constructor suppresses generation of a (public) default//constructorprivate Singleton() {}public static Singleton getInstance() ...
Greetings to all,I didn't know where I had to post that question exactly, so I've choosen to write that here. I hope I've not mistaken.So, I'm developing a plugin for a wiki clone (media wiki) and I've thougth to implement it as a web service because it can be resident on another host than ...
Hi all,I'm implementing the DAO pattern to interface my Session Beans with the DB.import java.rmi.*;import javax.ejb.*;import java.util.List;import java.util.*;public class FlightBean implements SessionBean {SessionContext sessionContext;public void ejbCreate() {}public void ejbRemove() ...
hi,i have a class DepthSearch that runs an depth search algorithm on a graph.The DepthSearch class provides the method search(Graph, node), which returns an boolean whether the node exists or not.now i can realize it in two different ways:1. make the searchMethod staticand invoke it like int ...
hi,let磗 say i have a graph with thousands of edges existing.Now i delete some of them, but i do not remember, which ones are deleted. Deleting should mean in this case i mark them as deleted, by setting a specific flag of the edge object to true.If i, lets say "push a button" then i want all ...
1659 byte By
sri1025a at 2007-10-3 7:58:05
Hi Everyone,I am not sure whether this is the right place to post this question, definetly not a design problem but more of developer productivity and personal preference issue. Okay, let me explain my question.I am definetly not a marketing manager trying to sell monitors to computer firms. I ...