• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data server problem

 
brutus
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After reading a few posts about data server or connection factory, I became unconfident. In my implementation, the method of data server just creates and returns an instance of RemoteData. There is only one line code as below:

I wonder whether it is necessary to worry about the increase of database table.
Will the examiner deduct my points because of this?
please comment. Thanks.
 
BJ Grau
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by brutus zhou:
I wonder whether it is necessary to worry about the increase of database table.

Can you please explain your question some more? I'm not sure what you are asking.
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Can you please explain your question some more? I'm not sure what you are asking.

I think Brutus Zhou meant to ask "Should my design support multiple databases?" My answer to that is "yes". The requirements state that the design should be flexible and reusable. Since it is almost certain that other database tables would be added to FBN, the best server design would be the one that doesn't requre any changes to server code when it happens. You can achieve this with just a dozen lines of additional code, and I think it is well worth the effort. However, there are people in this forum who dissent on this issue, most notably both moderators of this forum.
One of the most difficult aspects of this assignment is to determine what is important for flexibility and reusability of your design, and what is not. I happen to believe that ability to support multiple databases is one of these important elements of your design. A developer might look at the spec and think: "The clients are asking about one database, so I will do exactly what they ask me for". A good developer will look at the same spec and think "I've never seen a database with just one table. If I code to support just db.db, we will experience a lot of pain and suffering when the clients ask us to add customer.db table. I will save a lot of resources and money with a small effort of making my server reusable."
Remember, this is a Java Developer Certification, not Java Programmer Certification. What's at stake in this assignment is not just your Java coding skills, but how sound your judgement is when it comes to object design, and how well you defend your decisions. In this particular problem of the server design, it is your ability to to map from the business domain to the object domain, as Peter den Haan would say.
Eugene.
[ March 15, 2003: Message edited by: Eugene Kononov ]
 
BJ Grau
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Excellent translation Eugene!
 
BJ Grau
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Eugene Kononov:

I happen to believe that ability to support multiple databases is one of these important elements of your design.

Yeah, but how realistic is expanding this cheesey database? I would expect them to move to a commercial product before building more tables for this dog. I would reason that the archtiecture needs ot be designed so that they could move to a commercial product with minimal impact on the rest of the code. Of course, either viewpoint is correct since both have some justification to back them up, I just like the one that requires less work.
 
Max Habibi
town drunk
( and author)
Sheriff
Posts: 4118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with BJ. One of the most important aspects of a great developer is the ability to follow directions. I'll take a competent developer who follows directions over a superstar who doesn't, every time.
When asked to provide a simple implementation, you, as a developer, should do just that. We have no specific idea how the project will grow, so we shouldn't assume.
When you're an architect, then you can start making decisions about what the client wants to see. As a developer, you're job is to handle the semi-complex tasks your architect sets before you, in the parameters the architect defines. And if the architect is wrong, then they will be fired, and you have their job
Ok, of my soapbox now.
M, author
The Sun Certified Java Developer Exam with J2SE 1.4
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nicely put. One of the guidelines of the XP crowd is Do The Simplest Thing That Can Possibly Work. Guessing about future requirements can lead to wasted effort to build things that are never used, or have to be changed again when the real requirement becomes known.
It's a very hard rule to follow! It takes a lot of balance to write code that can be extended and resist the urge to write all the variations that come to mind.
 
Max Habibi
town drunk
( and author)
Sheriff
Posts: 4118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Completely agree. One of the challenges here, of course, is that it's fun to write code to cover all of those maybe conditions, and it's easy to talk yourself into doing so.
It' always easier to work in an area that you know well, versus going on to a next area that requires the tedious task of digging into requirements before we can get to the pleasant task of writing melodious code. However, IMO, the discipline to do just that is one of the distinguishing features between a programmer and a developer.
M, author
The Sun Certified Java Developer Exam with J2SE 1.4
[ March 15, 2003: Message edited by: Max Habibi ]
 
brutus
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your replies. I got it. I'll keep my current design and explain some more on this point in my design choices.
 
Robert Easton
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not see any reason to have to specify any database names at time of server start up. My connection factory automaticly creates the connection upon request if the database name passed into the connection factory via the client does not already have an instance of this running. Can anyone see a reason why I would have to specify the database name at server startup ? Or am I going about this completly wrong ?
 
Max Habibi
town drunk
( and author)
Sheriff
Posts: 4118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Robert Easton:
I do not see any reason to have to specify any database names at time of server start up. My connection factory automaticly creates the connection upon request if the database name passed into the connection factory via the client does not already have an instance of this running. Can anyone see a reason why I would have to specify the database name at server startup ? Or am I going about this completly wrong ?

Hi Robert,
If your directions say to do so, then that's the end of the discussion. However, if they don't say so, then you might want to be able to specify different database names in order to use different databases. This is Eugene's line of reasoning. However, as you can see, I disagree with it.
Does that help?
M, author
The Sun Certified Java Developer Exam with J2SE 1.4
 
Robert Easton
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I may be getting a little bit to much into this. Perhaps I should go for the approach:
Create a connection factory that only supports one database, user can specify what database this is on startup. The client will not pass any database names across on a remote connection. The only time a database name can be specified would be for a local connection. In my design document, explain that the connection factory can be easily adapted for more that one database if so desired. The presence of the connection factory would allow for flexibility in itself. I think I am making this assignment harder than what it really is. Do you agree with this ?
 
Max Habibi
town drunk
( and author)
Sheriff
Posts: 4118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds imminently reasonable and defensible to me
M, author
The Sun Certified Java Developer Exam with J2SE 1.4
 
Robert Easton
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the advise
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic