• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

NX: A discussion about class existance

 
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I had seen the old version SCJD exam FBN, they provide some of the classes in the assignment. In the new version assignment, there is only an instruction, the candidate decides how many and what classes should exist.
Considering the database, other than Data, DataInfo, FieldInfo class, I think there should be Data, Schema class. As to DataInfo class, I think it is unnecessary. It can be stored in an array, all its field information can be extracted from Schema class. And FieldInfo can be replaced by Schema class.
I think the existance of a class should be as few, simple as possible.
Need your comment. Thank you!
Regards,
Damu
[ September 08, 2003: Message edited by: damu liu ]
 
Bigwood Liu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, can anybody help me?
 
Ranch Hand
Posts: 493
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Damu,
You wrote:


As to DataInfo class, I think it is unnecessary. It can be stored in an array, all its field information can be extracted from Schema class


I agree with you that the DataInfo class is unnecessary. I called my Schema classs DataSchema. You can certainly call it Schema. But you have the right idea.
As a rule, I don't create classes unless I see a need to. Also, I try to design them such that a class does one thing well and not many other things at all.
Regards.
Bharat
 
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi damu and Bharat,
I totally agree with you that DataInfo class is unnecessary. And I have also a Schema class I called MetaData. But I think a FieldInfo class is handy (I called it Field). Is your Schema class stores information on a database file as whole, it's also a collection of field objects. Why not to store that repeated field information in a separate Field (or FieldInfo) class ? It's seems more natural to me.
Regards,
Phil.
 
Bigwood Liu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi buddy, I am very glad to see your reply.
Hi, Phil. , since you agree that Schema should exist, what do you suppose the Schema class will do? The Schema should deal with the fields info, in my opinion, thus the Schema class and the Field class will have something in common. Or can I consider it is a little duplicated to have two classes?
Regards,
Damu
 
Philippe Maquet
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi damu,
Schema stores all information unique to the database file (signature (magic cookie) + a collection of Field (or FieldInfo) objects. While Field stores all information unique to a given field. In other words, there is a one-to-many relationship between Schema and FieldInfo, that's why I think that is better design to have two separate classes. But it's not mandatory of course. BTW, it's even possible to have no Schema class, letting Data manage the whole stuff...
Regards,
Phil.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic