Making offline database application on WP7 - find the right way - database

I need to build an offline database application on WP7.
App is simple - it's about making orders from our clients, then translate it to main server (MS SQL).
Spend a days read about existing techologies - but I'am still confused. Which is right for that project?
Sync Framework.
Looking good, but as I understand - it provides single tables - no reference beetwen them. All the references I have to build on client side. Sad.
Entity FrameWork on server side.
And I have no clue - what can I use on client side. Is there a way to serialize entity object to Isolate Store, then restore it, and continue work with it? May be I can use Sync FrameWork, but scheme will become strange then - kinda one way.)))
Working with WCF & XML - most simple for me. A lot of code and conversion, but in this case I understand the data flow. In other view - I already have app with pure SQL-queries. I wanna be advanced. ))))
Using ext. databases (siaqodb for example).
Which one? siaqodb suppots "Sync provider", but it doesn't support references beetwen objects - so I have to build them by myself? Any gain? I don't know.
Is there another way to build such apps? Point it please.

If this has to be done offline, then I would generally use something like:
storing the minimal amount of the required data within isolated using a WP7 specific database like Sterling
using either a new REST or a new RIA/WCF service with objects/functions you define in order to provide the required data synchronisation
I think this is your option 3?
I've never really liked automatic data synchronisation. I just find it easier to code the sync and deal with the error cases myself - this is especially the case if your wp7 client app uses quite a small footprint of data in relation to the larger main server db.

Related

Advice on layered architecture (Win Forms + WinService; WCF; LINQ to SQL)

I'll try to explain as briefly as possible:
C#.Windows application for categories and descriptions of files.
Windows Forms - for the user
A library I want to be saved for future usage - I got nice algorithms for tasks with XML,Files,strings. In this case they are to serve the WF, but i don't want to keep them in the Form classes. I want to have them as a separate library with namespaces and classes in it. But I don't know what type of project or addition to the whole VS "Solution" that has to be.
Windows Service - get notifications on file changes and updates the same db the WF is using.
LINQ to SQL - for the data access
WCF - I am just throwing that here, because it seems that I need to use it(answer from a previous related topic) : https://stackoverflow.com/a/15998122/1356685
SO...yeah...architecture, architecture. Any guideline for a good architecture in my case is welcomed. Now I know in these conversations people start throwing terms like: "business logic","persistence layer","model layer" and what not. However I don't quite understand them, so please be specific.
Thanks in advance for the help !
Microsoft has a pretty extensive application architecture guide and their patterns and practices website has a lot of information and code samples showing you how to structure applications.
As for your 'library to be saved for future usage'... you can create a C# Class Library project and add it as a Reference in whatever applications you'd like to use it in.

Symfony 2: Build own DB access layer

I'm new here and on a research trip. We would like to use Symfony2 for a new project.
Now we have the problem that we need to use a company wide self-developed DB access layer.
We don't want to lose the whole Symfony/Doctrine layer for handling data.
Our idea is now to create or overwrite database access layer below Doctrine.
Something like creating a bridge (like PDO) between Doctrine and our DB access layer.
Has anyone an idea how we can do this or maybe someone has done similar things already and can provide us with an how-to?
Please no questions why. We just have to use the company access layer!
Thank you
http://forum.symfony-project.org/viewtopic.php?f=23&t=37637
I found the solution in Doctrine2 doc. It's pretty easy.
I needed for development and testing (frontend and console) about half a day
I've done it in 4 steps:
copy Doctrine\DBAL\Driver\OCI8 to a new folder.
rename files.
change functions to use own database access layer.
add in config file
doctrine:
dbal:
driver_class: /Path/To/Driver/Class
Doctrine has not much but a bit of information about Abstraction Layer:
Supporting Other Databases
If you believe this ยง of the doctrine documentation, you can see that you may use the Common package because it does not require the DBAL. Sadly, the same thing cannot be said of the ORM package. The best thing to do is probably to fork this package so that it supports your own DBAL.
Condolences for being obliged to use this DBAL.

Using a Reference Table Service in a WPF Application

For past projects(the last few have been web using asp.net mvc) we created a service that caches our reference tables(as required) to be used primarily for dropdown lists.
Now I'm working on a desktop application.An upgrade from vb6/sybase to vb.net/sql server
I'm trying out WPF.
I started down the same path building up my DAL. one entity for each reference table.
I'm at the stage now where I want to setup the business layer (some reference tables can be edited)
And I'm not sure if I should follow the same process which is to use ReferenceTableService to "manage" the reference tables.(interacts with the DAL, Controller)
This will be an application that sits on a share that multiple users run.
What's the best way to deal with the reference tables? Caching them doesn't seem to be an option. Should I simply load them as each user opens up a new form in the application? Perhaps using a "ReferenceTableService"?
In this case, the Reference Table Service is thin layer in the application. Not a process running elsewhere.
I haven't done much WPF (be interesting to see what the WPF Gurus think) but I think your existing approach is sound and I don;t see why you should deviate from it.
Loading up on app start sounds reasonable; you just have to think about the expected lifetime of a user session vs the expected frequency of changes to the reference data.
Caching: if the data comes from a central service you could always introduce caching there.

How do I create a database on the computer in flash?

I want to create a a application in actionscipt 3.0 that allows the user to listen to music and read descriptions of the music. For this to happen i suppose there should be a database where the textbits and music is located and then flash fetch the info when the correct buttons are pushed. The database will contain up to 100 tracks and textbits.
The application will function on a stand that won't have a connection to the internet.
What is the easiest way to do this in actionscript 3.0?
If any of you are familiar with UML and thinks this might help in understanding the problem, then here is use-case and flow-chart:
alt text http://img135.imageshack.us/img135/1498/flowchart2.jpg
alt text http://img27.imageshack.us/img27/1000/usercase.jpg
Thanks in advance.
The easiest way to do what you're asking is probably to store the files in a directory on the machine the application is going to be running on, and then design an XML structure for storing your data. The XML is easily loaded in to Flash at runtime and is easily edittable.
Your other option would be running a database server on the machine, creating web services that run locally and push/pull the data from the database, and then call those services from your Flash application.
The first option is most definitely the easiest and should be able to provide exactly what you need. The second would be more geared towards a distributed Flash application where you needed a central data repository for the clients.
If you're building an AIR application, you can use the integrated SQLITE database. But, i agree with Justin, the easiest way is to use a XML file.
You can probably consider using "Local Shared Objects" which is a kind of cookie, with bigger capacity (100Kb by default, but you can change it). Compared to other solutions already proposed, it has then advantage of not requiring any web server.

Writing data into a database using a fully REST web service

How would one create a REST web service to write a row into a databse table. Use the follwoing scenario:
The table is called Customer - the
data to be inserted into the row would
be the name, addresss, telephone
number, email.
I think its impossible to describe the whole thing end to end in Java or C#, and I would never expect that, but here are the questions I have popping into my head as I prepare for coding:
How the URI would look (eg. if you use this URL - http://www.example.com/)?
What info would go into the HTTP envelope?
Would I use POST when writing to the database in this way?
Do I use a resource to store the posted data from the client? Is this even necessary if the data is being written to a database anyway?
When the data to be writeen into the db is recieved by the server - how do I physically insert it into the database - do I call some method on the server to actually write the data (in Java)? - this doesn't seem to fit with truely REST architecture - shunning RPC calls.
Should I even be bothering writing to a DB - should I be storing my data as a resource?
As you can see I need a few issues clearing in my head. Any help much appreciated.
First of all, I'm not either java nor c# expert and I don't exactly know what means do these languages have to support REST design, but in general:
http://www.example.com/customers - customers is a collection of resources and you want to add a new resource to this collection
It depends on various things - you should probably set the content-type header (according to the data format in which you are sending the representation) and set some authentication headers if you need it.
Yes, you always use POST to create a new entry in a collection of resources.
I don't fully understand this question, to be honest. What do you mean by "inmediately writing data into the database"?
REST is primarily just a style of communication between server and a client. It doesn't say anything about how you should handle the data received by using it. The usual way how modern web approaches (MVC style frameworks) solve it, is by routing every REST action to a method of some class (usually a controller instance) where you handle the received parameters (eg. save them to the database) and generate a response to be sent back.
For a very brief and very clear introduction to REST have a look at this short video.
RESTful Web Services, published by O'Reilly and Associates, seems to fit the bill you're looking for.
As far as doing it in Java, Sun has a page on it.

Resources