Designing a data model in VS2010 and generating ORM code, application - wpf

Simply put: I have a database design in my head and I now want to use Visual Studio 2010 to create a WPF application. Key is to use the VS2010 tools to take much as possible manual work out of my hands.
The database engine is SQLite
ORM probably through DBLINQ
Use of LINQ
The application can create new, empty database instances
Easily maintainable (changes in data model possible)
Questions
How do I start designing the database model (visually) in Visual Studio 2010? Should this be an xsd? Do I do this in a separate project?
Next, how can I make the most use of VS2010 code generation tools to generate a Data Access Layer?
I suppose the Data Access Layer will be added as a Data Source (in another project?) and from there it's a rather generic data binding solution?
I tried finding clear examples of this but it's a jungle out there, the hunt for a solution is NOT converging to one clear method.
Update
So I decided to use ADO.NET entity framework, DBLINQ is out of the picture. I downloaded and installed the System.Data.SQLite ADO.NET provider which integrates with VS2010. From the VS2010 Server Explorer one can create and design a new database but it could be done with a standalone tool for SQLite as well. I then created a new WPF application project, and in the solution explorer added an ADO.NET Entity Data Model, which automatically generates an edmx with C# code (which is the Data Access Layer) from the already created database file. WAF (waf.codeplex.com) seems like a good idea to implement the rest but plain LINQ to SQL will do. This (click here) is also a very helpful question on stackoverflow.

Kay,
Please consider using ADO .NET Framework. It's supported by VS 2010 and LINQ (quick article).
There is one thing you must know before designing your architecture. BLL (Business Logic Layer) is a layer of logic specific for a particular data usage, hence cannot be generated automatically by (whatever you will use) framework. I guess you had Data Access Layer in mind - don't worry about that - if you're going to use ADO .NET and LINQ to Entities, DAL will be generated for you automatically. LINQ to Entities together with ADO .NET Framework are powerful set of tools which should 100% cover your needs. Additional info about LINQ to Entities.
Please feel free to ask if you have any questions.

Related

Is there a way to run my XBAP (or WPF) application as OLE object?

I need to run my WPF application as OLE object. I apologize that if I make it XBAP-application I could, but how?
Generally I need this cause of I need to access my application from CIMPLICITY.
You need to modify your existed .NET application to be COM visible. it's a quite general question and I may suggest to look at .NET - COM Interoperability and Microsoft .NET/COM Migration and Interoperability. I'm sure there is a very popular issue and you can find much more materials about it.

What is a good, lightweight database to use for a small F# winforms project?

I have a project I'm thinking of doing in F#, but I'm still very new to the language. I'll need a simple database, hopefully something easy to use. Would sqlite work well for an F# project? Other suggestions?
SqlLite is a very popular lightweight database engine that supports a .Net binding layer which is accessible from F#. It probably the best option for your scenario.
This CodeProject article details how to use C# to bind to SqlLite and is easily transferable to an F# scenario
http://www.codeproject.com/KB/cs/SQLiteCSharp.aspx
Another option would be SQL Server 2008 Compact Edition. I don't have any experience with it myself, but my understanding is that it is just a dll that can be easily distributed with your project.
The programming API is standard ADO.NET (which can be easily used from F#). It also supports LINQ, so if you wanted, you could also call it with F# LINQ (FLINQ) from CodePlex.
Check out db4o, it's just an object store, so it's pretty simple.
Firebird embedded can be a good choice too
The embedded version is an amazing
variation of the server. It is a fully
featured Firebird server packed in
just a few files. It is very easy to
deploy, since there is no need to
install the server. It is ideal for
CDROM catalogs, demos or standalone
desktop applications.

SQL Reporting Services 2005 vs WPF Fixed Document Control

In my project i have used WPF and am following MVVM pattern. So i have a report module in my project and the reports are just plain reports. So i would like to know should i use SQL Reporting Service 2005 to create reports and then use report viewer as client or should i go for WPf Fixed Document Control- Document viewer.
Can anyone please tell me which of these will be easier to integrate with my project.
Please reply
Thanks
Sharath
WPF Document (Fixed or Flow)
Pros:
Easier to integrate. All is included in regular WPF
Native
More control on the output
Cons:
Must program a lot for a multi-page report
Must program a lot for headers, footes, groups, etc.
SQL Reporting Services
Pros:
Mature tools
Interoperable with other solutions (IE asp.net)
Groups, totals, page headers, graphics built in
Cons:
Not native, must use a embedded windows form control
Must deploy the reporting service runtime separately (not good for click-once apps)
Hard to integrate to your business objects

UI automation tool for a windows based WPF application with Record and Playback feauture

I am in the process of recommending an UI automation tool for a windows based WPF application in a company
Which targets wide range of customers . The Application lives on a layer of WCF services for getting
The data. The company is already having a small VBScript framework written specifically for Test Complete
and is really not robust, Hence I am lookout for a right tool, where we could reuse the scripts or
Improve the already existing tool. Any ideas are welcome.
I have looked at Microsoft UI Automation, Project White, UIA Verify and Ranorex. Each one of them
Is having a feature lack.
I was able to go through the process of Microsoft UI Automation. I am still in the process of understanding how it works
with WPF, since it is totally dependent on Automation IDS.
Our application is huge and is not written with this in mind. All the code either does not implement
Automation ID property or Name property which is very much essential for object identification in the visual tree
in tools like UISpy and VisualUIAVerify.
What I am looking in specific are the following. Please give ratings to each of these
1) Recording : Recording , play back and automatic execution of test scripts and generate a report.
2) Dependencies : Minimal Dependencies(.NET frameworks, API modules , SDK Versions etc..)
3) )Code Generation : Code Generation of test scripts from Templates, Macros and Recording.
4)Object Name Mapping: Avoid explicit usage of Automation IDS and screen corrdinates, if they use, does it support any tools which would take XAML Files and insert Automation IDS into it and also avoid Problems With duplicate Automation IDS.
5) Events: Any Events and call backs that the user(tester) may receive if the GUI has undergone any changes
and how the scripts would change in this Case.
6) Support : Support for different scripting languages and easy Code conversions(C#, VBScript, Python.. etc)
7) Fast and Reliable: Easy and fast accessibility of GUI elements for manipulation( Like support to xml dom, Json.. etc), navigation, code duplication replacement tasks for changes in UI and easy configuration(xml, ini files)
8)Code Converters: the tester writes code in vbscript and developer could simply convert it into c# for embedding them into any stand alone framework if need be).
9)Custom controls: Support for custom controls and object mapping. If you have a custom object that behaves like one of standard controls. are you able to map (tell the test tool that the custom control behaves like the standard) control? Does it support all the standard controls methods? Can you add the custom control to it’s own class of control?
10)Reports: Should be able to execute multiple tests at once and generate a report similar to VisualUIAVerify.
Visual Studio 2010 Coded UI Tests
You can use Visual Studio 2010 Ultimate or Visual Studio 2010 Premium to create automated tests of the user interface known as coded UI tests. These tests provide functional testing of the user interface and validation of user interface controls.
I am using Coded UI Tests to automate tests of a WPF application built on the MVVM pattern. The record/playback features of the tool are impressive, generating really nice models. For large suites, the advice is to tear apart the generated code, structuring and extending it for your own purposes.
I recommend Visual UIA Verify to assist viewing the automation structure of your application while developing and debugging.
Have you tried AutomatedQA testcomplete
http://www.automatedqa.com/products/testcomplete/

How to rearchitect Hibernate DAO layer of ASP.NET app to move it to Silverlight?

Last try to get an answer on this.
I have a simple ASP.NET app which uses Hibernate for data access.
GUI can call methods on Customer object like "CalculateTotalSumOfOrders()".
Lazy loading (even though it's not optimal) will work for me, and when Orders and OrderLines collections are referenced in the domain objects, they will get automatically fetched from the database.
Now let's assume I am rewriting the same very app to Silverlight because it looks better than ASP.NET.
I am NO longer able to do lazy loading or data access, because Silverlight client runs in the browser.
How can I solve this without thinking too much about what kind of service to use to get data into the Silverlight client?
Your best bet for supporting all of those platforms is to use a web service. There are many different flavors that you can choose from, .NET 2.0 Web Services (ASMX), WCF, REST, if you are using Silverlight, you may want to consider using WCF + LINQ to SQL which is demonstrated here. That combination can also be used in ASP.NET (if running on .NET 3.5) and Windows Desktop Apps (again .NET 3.5).
Also an open source project called InterLinq might be interesting to you, basically it allows you to build LINQ to SQL queries on the client side, and then transmit them through WCF to a server that executes the query and returns the result. That can be found here. I have experimented with it in the past and it works quite well.
One option that would support Silverlight and Windows clients would be the new ADO.NET Data Services in .NET 3.5 SP1. These are a set of services that expose your database schema through a WCF interface. You can then retrieve the data from Silverlight or a Windows Client using a WCF client.
As #McWafflestix has said, you won't be able to do lazy loading any more, but in my opinion that's a good thing because retrieving data is now a much more "expensive" operation.
You're trying to take a server-side app that interacts with your database and does lazy loading, and convert it into a client-side app without a lot of work? Sorry, it's just not going to work. What you need is a major rearchitecting of your application.
Sorry...
*
"That's okay because I'm quite early
there. How would you rearchitect it to
support both ASP.NET, silverlight and
windows clients with minimal
overhead?"
*
I know I am answering this question way past the expiry, anyhow here goes. I would suggest you use the MVP design pattern; this would help you build multiple "Views" to work with your Model. In order to ensure that you support Windows clients, you would have to expose your Business Layer using a services layer (read WCF).

Resources