Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Ner min

Ranch Hand
+ Follow
since Sep 14, 2005
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ner min


thanks for replay, yes you are right, and I m also developer and we all know that design patterns are widely used in almost every software, the questions about DP are asked on each programmer job interview etc
But I need results of some kind of empiric studies, and of course it imposible to make a full worldwide study but can/would be a representative study on any oop language in any area … but I simply cant find any

Does anybody know any academic study/research paper which examines the spread out of design patterns in software/java development? Something like 88% of developers are using Design Patterns or?
I know it is a silly question but I need it for my masterwork and I just can’t google it – can it be, that nobody did that kind of survey by now?

tnx in advance
thanks Rajan,

but do you know are this j2ee1.4 compilant servers(or ejb2.1) backwarts compatible with the ejb2.0?
i just realised that running j2sdkee-1_3_1-win.exe with jdk5 wonnt work.
so i asked my self is it really nesecery to go with the jdk1.3 and this j2sdkee-1_3_1-win.exe in order to compleate the HF-book?

ok i will try other way - is ejb2.1 backwarts compatible with 2.0?
if so, couldunt i use some of this sun app-servers 8.x or so, couse they are j2ee1.4 compatible and j2ee runs ejb 2.1? so i dont have to uninstall jdk5?

is anybody tryed this HF-book ejb2.0 examples on any j2ee1.4 app-server and if do they work?
hi, i just moved to nb5 and matisse gui and im trying my first steps with it.

i created the JFrame, draged the JList on it and i wrote a separat class which gets some data from DB. All i want ist to show that Data in JList. In a property pane,when Jlist is selected, there is "model" option but it only offers to add the items manualy ?

in my separete class i have something like :
while ( {

and i have the geterMethod like:
public Vector getSomeVector(){
return someVector;
so how to say the gui that i want to call that method so that i have something like:
JList jlist = new JList( someVector);

I cant get this simplest Proxi-pattern and RMI example from HFDP pages 441 to 446 working. This is what I have done:

1. created remote Interface

2. created remote Implementation

3. created client

4. compiled all three classes and created stubs and started rmiregistry
C:\eclipse21\workspace\rmiTest>rmic de.mediaholic.rmi.MyRemoteImpl

5. opened onother cmd and started remote service
C:\eclipse21\workspace\rmiTest>java de.mediaholic.rmi.MyRemoteImpl

Now when I run my RmiTestMain it doesn�t output anything? No errors, no string hallo, simply nothing???
What is wrong? Is there any tool whit i can debug this rmi? For example to see what services r registred?

Cann anyone help?
i m running on w2k sp3, j2sdk1.
[ November 02, 2005: Message edited by: Ner min ]
hi Ilja, tnx

hmm.. i'm more servlet/jsp developer so my gui, swing etc. knowledge is pretty basic but even so i thing i got the idea. But again i thing that�s r very special cases, i mistake was that i was understood/hoped that with a composite-pattern I got the general-weapon for handling tree-like-(whole-part)structures. Ok,ok, it was just a dream
# tnx Ilja , that helped

i was actually trying to rewrite my navigation structur with composit pattern(just to be cool )
but that doesnt sound like the way to go. And if in composit pattern

Clients always only talk to the root node.

i m wondering what a practical exampels of composit? Can u tell me a couple of problems that composit solves?
I maen talking ONLY to u rootnood is probably very rarey a whole solution?
I have been gone through SimpleFactory and FactoryMethod examples in a HFDP and I think I have(I still cant belive ) understood both principles, BUT what I didn�t understood is the DIFFERENCE between them in a LOGICAL way.

Technically I really understand, well , actually it is pretty simple
By SimpleFactory we Let the Details be handled by (external)Factory object, we just call a orderPizza Method and we get() our Pizza.

And the client call looks like this:
PizzaStore store = new PizzaStore(new SimplePizzaFactory());
Pizza pizza = store.orderPizza("cheese");

2. FactoryMethod is pretty the same, just makes the PizzaStore abstract and takes the Logic from the (external)Factory object back in the abstract createPizza Method (wich will of course be overridden by NYPizzaStore LAPizzaStore or whatever.)

abstract class PizzaStore {
protected abstract Pizza createPizza(String item);
public Pizza orderPizza(String type) {
Pizza pizza = createPizza(type);
return pizza;

Pretty obvious so far,

But this could be done with the same effect If we created NYFactory and LAFactory
And then in the Client call used: (as the author suggests on the begin of Page 119)

PizzaStore store = new PizzaStore(new NYFactory());
Pizza pizza = store.orderPizza("cheese");

BUT( AND THIS IS WHAT I DON�T UNDERSTAND)in the middle of Page 119
He says that that would be bed idea and that we should use the FactoryMethod approach.
But WHY. What r the benefits? He just lamely explains that we need to tie the store and the Pizza creation(because bed franchises were Atrocious again and�) but in a flexible way. Ok he explains that if we use FactoryMethod we allow the subclasses to decide etc. But that just describes how the FactoryMethod works not what r the benefits of it?

I simply don�t see how the getting back the code in the Method is more flexible then a external Factory object? Imo it is the same thing. In a one way o have to derive the PizzaStore classes and in the other u have to derive FactoryObjects. Same work, same amount of time needed to get it coded, same Effect.

Can someone explain this?

NBAStar requires strategy to compile and strategy requires NBAStar to compile. It's a warning sign but not a fatal flaw. There are ways to break the circle with interfaces. A good "next topic" maybe.

Passing "this" around is really pretty cheap. I might look for a way to get it out of the constructor.

the question reffer to youre both statemens.

But how do i break dependence?

Only think i can imagine is to make NBAStar an interface and then some class wich implements it. Wouldn't that have add to much komplexity?
And by the way, WHAY I SHOULD awoid dependence in this case couse the dunking-behavior is specific to ONLY BasketballStars and ONLy the BasketballStars striveing to Dunk?
ok this is how it works:

yes i made it up couse i dindnt like that stupid "duck-example" and i needed something i can remember(im a basketball player)
Question 1.
what u mean by circular dependency?
Question 2.
whay did u used "___this___ " and not just "this"
Question 3.
is it clever to force every "concrete Dunk" implements dunk(NBAStar n)
ading the overhead of always passing the "this" even if is not needed.

I mean i know i could repeat in the CanNotDunk the System.out.println("i m jumpin and i m shootin"); line but the i would have the same thing on two places.

So what is the better way to go same thing on 2 places or overhead of this
[ October 28, 2005: Message edited by: Ner min ]
if i have following(see my question in CanNotDunk Class ) can i call some Supertype method?

[ October 28, 2005: Message edited by: Ner min ]
but i thought the whole Idea is to force every ConcreteComponent to write the getDescription() implementation.
That's what for r Decorators for: they add extensons by reimplementing.
For what is the description with the value of �Unknown Beverage� for?

Imagine that someone ask u:
1:Hi Mr. would u like a niche fresh Unknown Beverage?
2 h hm...
1:with suger?
[ October 27, 2005: Message edited by: Ner min ]

# Shafique i agree with u

BUT i think this is unnecessary done to complicated.
imo, there is no need for implementation of getDescription() in Beverage
and then make it abstract in CondimentDecorator.
For what is the description with the value of �Unknown Beverage� for?
Insteed why not just make getDescription() abstract inside Beverage
and omit it from CondimentDecorator?
That way u will still enforce the ConcreteDecorators to implement getDescription() BUT it is MUCH MORE SIMPLE.

Any drawbacks to this?
ok there was misunderstending of term "object", strictly in javatermms saying objects r really in the one and only place, the HEAP. I just mixed the "objects" and "objects representations"