Hallo Phil,
You use you this method. I am trying to understand how it should work exactly.
Example:
Client->Database->Data
Database is the a class, which extends Data and implement new interface (not DB/DBAcces), to provide getMetaData methoid and additional find methods.
Client calls readRecord(6);
Database calls readRecord on Data and gets dataResponse String[].
It creates then a new databaseResponse String[] and fills it by doinng following:
databaseResponse[0] = dataResponse[metaData.getIndexByName("hotel")];
databaseResponse[1] = dataResponse[metaData.getIndexByName("location")];
...
That is what you should theoretically be doing, because you said you do it only in your business layer (middleware).
or you do it on the client:
client calls readRecord.
Database just calls readRecord on Data and delivers response, without parsing it, on the client.
And the client makes this (what Database does in first example).
Hiw do you make it (first or second), if I understand you not correct could you PLEASE send me an example!
Tx,
Vlad
Client->Database->Data
Database is the a class, which extends Data and implement new interface (not DB/DBAcces), to provide getMetaData methoid and additional find methods.
I think that tou are refering to this thread (No need for a locking manager?) because it's the only one in which I talked about a Database class.
As in any database system, you have two types of information that you can get about a given table : contents (multiple - the records) and structure (unique - how the records are structured). So I think it's good design to have a separate MetaData class which stores all structural information about the table, and to which Data may delegate any operation on that unique information (read the file header, write a file header, expose information on fields, etc.).
That is what I am trying to do: I have the class MetaData and everything I have told about, but what I don't understand is who exactly use MetaDada getMataData().getColumnIndexByName(String columnName) method to get approriate index of specific field:
you Database class? Data class which implements DBAccess or your client?
what I don't understand is who exactly use MetaDada (...)
But practically, it will be you business tier which must :
know the length of a given field to tell a client GUI how many characters may be entered by the user
know which index to use to update a String[] fieldValues in a book() method
Sorry for annoying you with the questions,
but it looks like I need learn to form my questions a bit more clear, because it costs every time 2-4 mails before somebody understands what I ask ...
I have problems understanding it (since I call business tier a middleware - the server logic). It seems that you means something different, otherwise I don't really understand why U mention Client GUI.
1) your GUI client invoke separately method on
data object/ network connection object:
GUIWindow class:
MetaData metaData = Data.getMetaData();
Field fieldHotel = metaData.getField("hotel");
Field fieldLocation = metaData.getField("location");
// validator
tfHotel.setDocument(new MyValidator(fieldHotel.getLength()));
....
Your user interface should be designed with the expectation of future functionality enhancements, and it should establish a framework that will support this with minimal disruption to the users when this occurs.
let's go on in french
find(...)
book(...)
tell_me_which_fields_I_may_search_on_along_with_their_distinct_values(...)
tell_me_how_I_should_check_a_valid_room_owner()
1) it means you lock/unlock on your business-tier: database server, but not on client. Correct?
2) how you then let your business tier know what type of search you want to execute (you have only one find method)?
tell_me_which_fields_I_may_search_on_along_with_their_distinct_values(...)
I'm doing laundry! Look how clean this tiny ad is:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|