Paul Medford

Ranch Hand
+ Follow
since Aug 28, 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 Paul Medford

Hi All,
I'm kinda of puzzled here.
Say you have a class MainClass that creates a new object SubsImpl. If in MainClass we have:
SubsImpl subsImpl = new SubsImpl();
Then, in my class diagram I have an aggregation between MainClass and SubsImpl, similar to:
[MainClass]<>-----[SubsImpl]
Now, if SubsImpl implements the interface Subs, and in MainClass we have:
Subs subs = new SubsImpl();
How do we draw the new class diagram?
a) [MainClass]<>-----[SubsImpl]----->[Subs]
b) [MainClass]<>-----[Subs]<-----[SubsImpl]
Or something different? I really can't figure this out.
Thanks,
Francois
Thanks, it's what I thought. I just had a doubt, somehow...
19 years ago
I have a doubt now...
Say you have a util abstract class with static methods. Whenever a method is called, is it thread safe? or is there a chance that the same method be called more than once at the same time and corrupting the data?
Simple question, but I'm kind of puzzled...
Thanks,
Francois
19 years ago
Hello all,
I need some clarification regarding Entity Beans and the find() methods.
1) Users who retrieve a same record from a database using an Entity Bean, do they all have their own copy (instance) of the Entity Bean or do they all share one single instance of the bean?
2) Let's suppose a user finds a record in the database through an Entity Bean using a servlet. Once the page is displayed in the browser and the connection is closed, does the Entity Bean return immediately to the pool and therefore looses its state, or does it keep its state for the next call (in a sense caching the data for faster retrieval)?
3) Let's assume a search engine uses EJBs. If a user searches for a word that is found in say 1 million pages using a find() method, does it mean that 1 million Entity Beans were created?
4) I queried Google for the word 'eye' and it found over 9.7 million pages in just .11 seconds. Whereas it is taking for ever to find only 100,000 records on my machine. Is it just a matter of computing power or something else?
Any thought?
Francois
Or... You can download the Orion app server from www.orionserver.com. It's free and said to be very fast. It works great on Win98. It deploys your apps automatically. But support is non-existent from the vendor. You can get support at http://www.elephantwalker.com/.
Francois
I got the answer.
It seems that it is the ormi protocol that's slow. But once the connection is open then it's pretty fast.
Moreover I learnt that in order to deploy a standalone client with Orion one must include the ejb.jar, jndi.jar, the orion.jar (2Mb) and the client jar (of course).
Orion.jar is the server. So, in other words you've got to include the server jar with your client app... That doesn't make sense...
Francois
The PetStore is excellent.
But for very simple bean/client examples I'd suggest that you get Enterprise JavaBean (3rd edition, O'Reilly). You can build simple bean to understand how they work.
I find that coding EJBs is not complicated. But because deployment is vendor specific I think that deploying an EJBs can be a real brainer.
Hi all:
I am currently using Orion 1.5.2 to learn more about EJBs.
It takes about 5 seconds to get the initial context using:
Context context = new InitialContext();
In my jndi.properties file I have the following as per the Orion doc.
java.naming.factory.initial=com.evermind.server.ApplicationClientInitialContextFactory
java.naming.security.principal=admin
java.naming.security.credentials=123
java.naming.provider.url=ormi://localhost/titan
Any idea why it is so slow? Is JNDI usually slow?
THanks,
Francois
First I'd start by asking a few questions about the various technologies to make sure that the candidate knows at least something.
- Life cycle of the servlet
- Difference between entity, session, message-driven beans
Then focus on conceptual questions and for a specific situation how to use the technologies together. Ask design pattern questions.
Focusing on questions such as what does the doGet() method do won't tell you if they know how to apply that knowledge.
Francois
I am also confused.
I installed Orion 1.5.2 and I created a stand alone app. Now, it's working, but it does not mean that I understand what's going on...
The EJB books and the J2EE Tutorial say that at deployment time stubs and skeletons are created and are needed by a stand alone app to connect to the EJB server.
Well Orion does not seem to create any stubs/skeletons.
I created the three EJB classes Bean/HomeRemote/Remote, META-INF/ejb-jar.xml, which I put into myapp-ejb.jar.
Then I put this jar inside the myapp.ear with META-INF/application.xml.
Then I deployed it in Orion.
For the client, I have a jndi.properties file, 1 Client class, the original HomeRemote/Remote interfaces, and META-INF/application-client.xml.
Note: I had to put the ejb.jar (8Kb) and orion.jar (2Mb) in my client Classpath.
That's it, and everything works well.
1) So where are the stubs and skeletons???
2) While I can include the ejb.jar (8Kb) in my client lib directory, I can't deploy my app with the original Orion jar (2Mb).
Any thought?
Thanks,
Francois
DAO is in fact Data Access Object. But it is not the MS Access DAO, it is a design pattern.
http://java.sun.com/j2ee/blueprints/design_patterns/data_access_object/index.html
Reading through the specs I think that DAO is what is used to decouple the Business Logic from the Data Access Logic that I was talking about.
Well, thanks,
Francois
Hi all:
Well, JDBC is great to connect to any database that has a JDBC driver. Changing databases is made easy by changing the driver - we know that.
But, considering that not all databases support auto-increment for primary keys, or they don't all support all possible joints, or whatever... How do you implement your code to make it portable across several databases?
1) First, do you save your SQL statements somewhere in a config file (or XML)?
2) Do you implement your business logic that returns a recordset in a separate class for each database you plan to support, so that switching to a different database is just a matter of implementing a new class without changing the code in your app?
3) Is it where the DAO design pattern comes in?
I was facing that problem when I was developing an app that connected at first to MS Access, then I switched to MySQL (or was it another one? don't remember) that did not support auto-increment. I had to recode my app.
Any thought?
Thanks,
Francois
Does anyone know the difference between creating an object using the new keyword and Beans.instantiate() as shown below?
modelManager = (ModelManager) Beans.instantiate(this.getClass().getClassLoader(), "com.sun.j2ee.blueprints.petstore.control.web.ModelManager");
(Code taken from the PetStore MainServlet.java).
Thanks,
Francois
20 years ago
I am evaluating Orion as a J2EE server and I'm trying to run the PetStore. It seems to be working fine but I now I'd like to setup and populate the Hypersonic database provided with Orion.
Does any know:
1) How to create a new Hypersonic database and how to populate it with the scripts provided with the PetStore. Note there are only scripts for Cloudscape, Oracle and Sybase.
2) Where to place that newly created database.
3) Does Hypersonic use only a generic file that contains all the databases or does it create one file (database) per application deployed?
Any thought?
Thanks,
Francois
1) If multiple .ear archives use common files, is it best to have a copy of each shared file in every .ear, or is it a better practice to use only one copy for all .ears and save these files on a common directory.
2) If the latter is the best choice, is there a common directory defined by the specs or is this directory vendor specific?
3) If we use a shared directory for common files, how can we make a note in a particular .ear so that those files are not forgotten during deployment.
Any thought?
Thanks,
Francois