Brian McCallister

Greenhorn
+ Follow
since Dec 03, 2002
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 Brian McCallister

Not exactly on database model book, but Eric Evans's Domain Driven Design is a great reference for domain modelling -> O/R Mapping. Scott Ambler's essays (google for his name) are probably the best general references on O/R mapping around. Fowler's most recent book (Patterns of Enterprise stuff) gives a nice toy-level look at O/R mapping and design strategies, but should be treated as an introductory primer in that regard rather than a good way to do it.
Can you post the relevent bits of the repository mapping (repository_user.xml typically) and verify the Class/field information?
-Brian
ps: you are far more likely to get answers to questions like this on the OJB user's list =)
I am pretty sure you can configure hibernate t not use lazy loading, and if you cannot - i know for a fact it is configurable in OJB.
Let us not forget OJB as well ;-)
-Brian
You need to use java.awt.Image (or the equivalent, look up in the javadocs). Notably, if you are running under *nix wihout an X session open you will need to specify headless execution on the commandline or it will get crnaky.
-Brian
17 years ago
javaw is a version of the java launcher for windows that does not open a console window for the application.
For instance, if you shortcut to start the app and use java MyApp it will open a console window that will receive standard out, if you use javaw MyApp it won't open a console window.
I don't know about changing Eclipse's default launcher - am a gvim/IDEA user =)
-Brian
17 years ago
Umh, compare them, generate your report. Aside from that we'd really need some more information.
Comparing complex object graphs could be a very fun task, but is a bit vague. Also, are we dealig with graphs, or just nested objects (container style?).
-Brian
17 years ago
From the sound of it you will probably be best off creating your own model behind this data - especially if you are loading it dyanmically, then make a TreeModel interface to your model that can make sense of it for the JTree.
-Brian
17 years ago
If you are familiar with working with CORBA the easiest way is probably to create an RMI/IIOP stub for it and call it that way. IIOP is Java's interface to CORBA. Google for "Java RMI/IIOP Tutorial" and you should come up with some good step throughs.
The easiest way by far though is to use Apache Axis ( http://xml.apache.org/axis ) and make it a SOAP service. RMI/IIOP is easy in Java, but so are SOAP services with Axis. The feasibility of this depends a lot on what exactly you are doing, and how easy making a SOAP client from your non-Java app is.
17 years ago
This question is a bit too vague. It is fairly easy to lose symbol references - especially if you change the base class of somehting from a JFrame to an Applet and start calling Swing related methods on it.
-Brian
17 years ago
You only should get one match based on that code. The code is basically asking "does this String match this pattern" and the answer is yes, regardless of how many times.
Iterating through the matches would be done along the lines of
while(matcher.find())
{
System.out.println("Found a match");
}
-Brian
17 years ago
cacheing is always good, but fankly, with 1000-3000 hits per day I very much doubt you will *need* to cache much - particularly as you will be able to run the database locally sinc eyou have a pretty powerful machine (still have to go through sockets, but effectively no latency and much better bandwidth). I suggest making it work first, then make it work fast. Leave yourself open to caching options, iow - don't embed JDBC in your view code - get data through object calls, not database access, but the object calls may very well do database calls every time to get things rolling, but you can change that much easier later.
Good luck!
-Brian
17 years ago
followup - the reason I say it is worth writing your own O-R mapping layer is because it is worth it for you to learn what is going on, and undertsand what the various O-R mapping tools out there. They mostly rock, and will save you a ton of effort - but unless you understand what they are doing for you, and have messed around with making a similar system, beware using them blindly.
-Brian
17 years ago
If you are running a 1ghz machine with a gig of ram... unless you write some really really REALLY ugly code I cannot imagine you having a performance hit with 10 simultaneous users.
Some thoughts on architecture. If this is your first real Java web appand you are doing it to learn, do NOT use the various frameworks like STruts, Velocity, or Tapestry. Implement a minimal framework yourself. I highly suggest an action->controller->redirect based setup like Struts uses. Basically you send any page request that has to do any thinking to a servlet that looks at the request and forwards it to controller object based on the action specified in the URL, the controller gets the Request and Response objects and is responsible for handling it. Typically it will do processing, fill in relevent values on a Helper object which is then added to the request and forwarded to a JSP to make a pretty web page showing data pulled form the Helper. Sun's blue prints specify this as an example, and Struts uses it (ignore all the forms stuff in Struts until you get this concept down, but reading about it will help you there). Keep any application logic in the Controller or in objects it references (ideally in a domain model behind the controller if the app gets big, but for a small app these can be pushed together).
This will get you going for your ten simultaneous users. When you want to scale up, and if you dtermein you NEED a relational database... go use one. It is highly worth your time to write your own Object-Relational mapping system using a Persistence Gateway pattern (have a class for each object you need to persist that knows how to create, load, update, and delete that class) and use that class as a factory to get instances of your persistable classes. After you have done this look into O-R mappers like Hibernate, OJB (my favorite), Castor, or whatnot. When you make your O-R persistence layer you will probably want to investigate caching. Make sure to look at the Jakarta Commons COllections LRUMap class when you do this - it will save you much time and effort.
One thing you will run into while doing this is a cranky database because of lots of connections are being held. If you use POstgres it'll get cranky at about 33 conenctions unless you tweak its default settings (it defaults to a very low number of simultaneous connections) and you may want to investgate connection pooling. Writing a basically functional one isn't difficult, but grabbing the implementations from either JBoss or Jakarta Commons is easy too.
Don't worry about distributed objects (ie, EJB's or RMI) until you profile your system and see that it is efficient and is still dieing under the load. That is a different story, but remember Martin Fowler's first two rules of distributed objetcs: 1) Don't distribute your objects. 2) See rule number 1. It is usually cheaper and easier to buy a 4 cpu RISC server from HP than to pay a developer enough to make a distributed application - and if the 4 cpu machine doesn't handle the load, and the load is from you app, not the relational database then you are writing some cool stuff.
-Brian
17 years ago
Historically C uses an int named argc to hold the count of comman dline arguments, and an array of char pointers to hold the values.
Args is just clearer if you only use one =)
17 years ago