views:

25

answers:

1

I have a question regarding this topic.Like for Client Server Applications

1) is it necessary to load database directly into the Application.

Suppose if I have a DB in the back end and My application has to connect to that DB and display the results on the View for this do I need to Add DB into the Application directly.

2) can we access any DB or a File on the Remote server and show the required results.( with out adding that particular DB or A File into the application directly). How can we do this.

I saw a similar question in stackoverflow one answer was to use a PList, I am new to this.I am browsing the net but not able to get clear results. I lost many of my interviews because of this question.

Thanks,

+1  A: 

1) is it necessary to load database directly into the Application.

Suppose if I have a DB in the back end and My application has to connect to that DB and display the results on the View for this do I need to Add DB into the Application directly.

I'm not sure I understand this question. No, you don't need to load a database directly into a client in a client-server architecture. Normally, when I think of a design where a server has a database, I imagine there's some kind of way for the client to query the server for information. Perhaps it's making HTTP requests, which the server parses into a query, runs the query, and then returns the results (perhaps in XML form?).

2) can we access any DB or a File on the Remote server and show the required results.( with out adding that particular DB or A File into the application directly). How can we do this.

Are you asking if it's possible, in general, to access a server database from a client? Yes, of course. (See above, re: HTTP Requests).

Any arbitrary file? That depends on how the server is set up. Again, HTTP is one protocol works that way; if you send an HTTP query like "GET someimage.png HTTP/1.0", the server could just be grabbing the whole file someimage.png and sending it back in the response. (Technically, it's not necessarily snarfing a whole file -- it could be creating that PNG dynamically since there's nothing in the HTTP protocol that says it must be sending an existing file -- but that's outside the scope of your question.)

I lost many of my interviews because of this question.

Not to sound too snarky, but interviews are often won and lost not because you don't know the answer, but when you can't communicate effectively. You haven't phrased your question(s) here particularly well.

Shaggy Frog
Thank you for the reply , Definitely I understand that It is not pharsed well I actually the same question in two different ways. To make it clear, As you already mentioned there is no need to load db directly into client side, Client can post and request and he an get a Response from the server. I want to know how this can be done if it is a Webservice like Json,XML or a PHP file. Where is our Data stored if it is not directly loaded into client side?
adusum
I assume the data is originally stored on the server side, since you said your server "back end" had the database. When a client stores data it fetches from a server, it's called caching. This is a common design pattern in many client-server architectures.
Shaggy Frog
Thank you so much I have a final doubt this like when we lauch app in the app store will the back end DB is also stored in Apple server or will it be in our Own local machine.
adusum
Apple doesn't store databases for you or any other iPhone developer
Shaggy Frog