Win a copy of Functional Design and Architecture this week in the Functional programming forum!

Bruce Ichiban

Greenhorn
+ Follow
since Nov 15, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Bruce Ichiban

yeah, i have a lockmanager on the server side, but should i have a method on the client side that makes all the separate calls to lock, delete, unlock for example instead of having a method that gets executed in the server side, where the individual calls are made.
overall design wise, i think the 2nd way is preferable, but im second guessing myself since the methods are accessible to the client...
anyone else have some thoughts? thanks!
i think i know the answer to this one, but then again, im not sure, so i wanted to check with everyone just in case...
where should the processing/controller logic for say booking a seat take place?
option A:
put all the "logic" in the code on the client side, where the client locks records, modifies records, unlocks records, etc
or
option B:
make a method bookSeat() that gets processed on the server side. all the client knows is whether the booking was successful or not.
ideally i think option B is better in terms of separation of work. the client shouldnt know about the database and how it works. it should just know it wants to do and requests that the work gets done.
however, on the other side of the card, why would the requirements require that the client implement the same public methods as the Data class? why force the providing of methods like lock() and add(), etc to the client if its not necessary?
am i just second guessing myself? (i tend to do that! heheh)
thanks for your help
[ January 29, 2002: Message edited by: Bruce Ichiban ]
hmmm - i scoured some of the other boards and found a somewhat related idea that i implemented and it works!
can someone validate it or is working enough proof? ;-) (if it is correct, perhaps this might be a good reference for others?)
<code>
------
In the FactoryInterface and Factory classes:
public WidgetIFace getWidget() throws RemoteException
{
return new Widget();
}
------
In the Widget class:
public class Widget extends UnicastRemoteObject implements WidgetIFace
{
public Widget()
{
super();
}
public String aMethod() throws RemoteException
{
return new String("widget info");
}
}
------
</code>
Hi all,
I've been reading up on this board about Factories and how they can alleviate the need to have client pass their IDs etc. I think I have the general idea down, but I couldn't find a post about how to actually implement it.
Here is what i think the deal is. Please correct me if I'm wrong.
So I want the client to receive a Factory object initially. The client then uses a Factory.method() to ask for a DataWrapper, lets say. Each client when they connect will get a reference to a unique instance of a DataWrapper. These DataWrappers will share the same instance of some form of Data class.
So my question is, how do you pass back a reference to a unique DataWrapper? You dont want the actual object because then it will have no real link to the Data class and hence, the DB. It seems to me like you want to bind DataWrapper to the rmiregistry, but how do you ensure that a new DataWrapper gets created each time, vs sharing the same one?
Can someone point me in the right direction and/or to an example of a similar idea?
Thanks in advance!
hmmm i think i may have figured out a solution -
to extend JButton. i think this may be the easiest way...
but other solutions are welcome!
Cheers!
19 years ago
Howdy,
I searched through the forum archives and I couldnt find the answer to my question so I figured i'd post this in hopes that someone can help me.
I want to eventually create an canvas where i can click and draw rectangles and interact with them(e.g. move them around- have borders on them etc). I figured that having a JComponent that drew itself as a rectangle would be a good idea, instead of creating a hack graphic using AWT(two rectangles overlapping - one for the border, one for the regular rectangle).
my two questions are:
1. Is extending JComponent the best approach to this?
2. Can anyone tell me or point me in the direction of a good tutorial on how to extend JComponent and get it to draw itself?
thanks in advance!!
19 years ago
Hi,
I was wondering if Java 2D is the best way to go about drawing lines and simple shapes and text for an applet, if I'm using Swing for the rest of the applet? I saw that Java 2D "extends" AWT...
thanks for your input!
t
19 years ago
Howdy,
I'm just starting out on my dev assignment and there are a couple of questions I have. I looked through the posts and I didnt see an answer, so i was wondering if someone could share their thoughts. If the answer to any of these is: just do whatever you want, and just document it, thats fine too!
1) Unlock: it says "If an attempt is made to unlock a record that has not been locked by this connection, then no action is to be taken." Does this mean, i need to prevent a client from unlocking a record that a different client locked? if so, does anyone have any ideas about how to track users? IP address isnt enough...no way to get thread ID's or ID's based on RMI or socket connections?
2) the local vs network modes: can someone elaborate on what this means exactly? i understand local means single user access only, but how do you do it "without networking"? does the client applet connect directly to the DB file? does this just mean that the client and the server run on the same computer, just diff VMs(this doesnt seem that different - b/c for networking, it doesnt matter where the client is...)
any elaboration and thoughts will be most appreciated!