aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes NX:URLyBird Whether must I give the client a privilege Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "NX:URLyBird Whether must I give the client a privilege" Watch "NX:URLyBird Whether must I give the client a privilege" New topic
Author

NX:URLyBird Whether must I give the client a privilege

Leo Tien
Ranch Hand

Joined: Sep 10, 2002
Posts: 156
In my DBMain interface have several methods: read(), update(), delete(), find() and so on . Should every client have these all privileges, if not, I must give the user a flag describes his identity. So a problem will raise, who have update privilege, who have delete privilege?
My english is very poor, I hope someone can understand me.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11278
    
  59

Hi Leo,
Simple solution: every client has update() and read() privilege. No client has create() or delete() privilege.
There is no requirement that your client has to do creations or deletions, so save yourself all that bother, and dont add them.
But your clients do need to be able to search for records and update them, so they should all have access to the read() and update() methods (or to your business methods which call the Data methods).
Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Leo Tien
Ranch Hand

Joined: Sep 10, 2002
Posts: 156
Thanks Andrew.
But I have a little misunderstanding on this. In my db.db file , every record have a "deleted" flag , if i don't need to think about delete() , [B]where I will use it?[B]And if not create() method, how can i add a new record to the db.db? Whether i use the record gived by SUN only?
Perhaps these qustions are unworthy, i'm sorry waste your time, but please help me! thanks a lot!
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11278
    
  59

Hi Leo,
You still have to check the deleted flag in case some other program deletes a record.
how can i add a new record to the db.db?

You can still add records using the create() method of Data, but your client applications don't have to do this.
Whether i use the record gived by SUN only?

That is all I would (and did) use. I think you even have a requirement that when you submit your assignment, you have to submit the original unmodified datafile.
Perhaps these qustions are unworthy

Not at all. Any question can be asked here.
Regards, Andrew
Leo Tien
Ranch Hand

Joined: Sep 10, 2002
Posts: 156
Hi Andrew, I'm leo.
I'v got the data in the db.db file. All the records' Del Flag is zero, in other word, all available. And I notice that record's date field is from 2003/02/05 to 2005/11/19, but the owner field is all empty.
Now I understand a little, these data gived by SUN, is only referrence, my project's operation on it only is owner field, to describe who booked the room. Others fields cann't be modified at all. This is only my system's duty -- to display the discount rooms' information for the customers.
But I think the data in the db.db file isn't enough at all. e.g. the date field, so little date provide.When do my work, whether need more records to test my system, how you do?
Thanks Andrew !
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11278
    
  59

Hi Leo
Now I understand a little, these data gived by SUN, is only referrence, my project's operation on it only is owner field, to describe who booked the room. Others fields cann't be modified at all.

Just a little clarification here. There are 3 parts to your assignment: the database; the client GUI; and the network interface.
Your client GUI does not need to (and in my opinion shouldnt) modify any fields other than the owner field.
But the Data class does need to be able to modify the other fields as well. Depending on precisely what your instructions tell you, you may even need to be able to modify the other fields all the way up to the network layer.
Likewise with the adding and deleting of records: you client GUI does not need to do either. But your database does need to be able to add and delete records, and depending on your instructons, you might need to provide that functionality at the network interface.
But I think the data in the db.db file isn't enough at all. e.g. the date field, so little date provide.When do my work, whether need more records to test my system, how you do?

I don't know what other tests you have in mind, so I don't know if the provided data is adequate or not.
I think the only restriction your assignment has on use of any records is that it has to be available within a certain number of hours. With the data you described, you will be able to test records available in the past, as well as records that are too far in the future.
The only things you wont be able to test with the data you have been provided with, is whether your application correctly handles deleted records. So you may want to delete a record (using a test program that directly calls the delete method of the Data class) so that you can test that the remainder of your application does handle deleted records. Apart from that, I suspect that the data you have been provided will be suitable for testing your end to end application.
Regards, Andrew
Leo Tien
Ranch Hand

Joined: Sep 10, 2002
Posts: 156
Hi Andrew:
You are right, now I understand some statement in my instructions exactly, especially "Your data access class...must implement the following interface...". Since implements the interface, should implements all the methods in it(even it to do nothing).
In fact, this system of URLyBird, the server side(contains database access and network layer) is provided by the company, the client side is used by customers, so it has only operation of read or update. Because my english is so poor that I understand my assignment very slowly, and take a lot of misunderstand on it. I don't know whether the statement above is correct.
I don't know what other tests you have in mind, so I don't know if the provided data is adequate or not.

My meaning is if I test my system on 2003/12/09, but the database hasn't this record contains this data in date field, how I do?
Apart from that, I suspect that the data you have been provided will be suitable for testing your end to end application.

I don't understand what meaning of "your end to end application" statement is.
Thanks !
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11278
    
  59

Hi Leo,
In fact, this system of URLyBird, the server side(contains database access and network layer) is provided by the company, the client side is used by customers, so it has only operation of read or update. Because my english is so poor that I understand my assignment very slowly, and take a lot of misunderstand on it. I don't know whether the statement above is correct.

I think that is a reasonable interpretation.
My meaning is if I test my system on 2003/12/09, but the database hasn't this record contains this data in date field, how I do?

OK - in that scenario, you might want to either add a record, or modify an existing record to fit in the proper date range.
Or change your computer's date
I don't understand what meaning of "your end to end application" statement is.

Front end system: system the client is using
Back end system: system that provides a service (e.g. database)
End to end system: everything from and including the front end system to and including the back end system. The complete solution we are designing.
Regards, Andrew
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NX:URLyBird Whether must I give the client a privilege
 
Similar Threads
who owns you [political]
Issue for the time to lock
Is my locking mechanism going to work?
NX: Assignment - some design questions
Is my lock mechanism correct ?