tags:

views:

143

answers:

7

Okay, I'm biting the bullet and deciding to get into the whole Microsoft/C#/.NET culture and I'm going to do this by putting together a simple (hah!) application.

It will basically be an application in which I want to store images and associate with them other optional things.

It must be able to import images from the filesystem (and hopefully camera/scanner) then allow the user to add text, audio and other information.

I plan to store the images and auxillary information into a database. What the application will do with said data isn't important (yet).

Keep in mind I know absolutely nothing about C# or .NET although, as an old codger, I know a great deal about many other things and will regale/bore you with stories and anecdotes until you quietly slip away :-)

What are the first steps to take in developing such an application? I've already set out UI layouts and likely process flows although it may be that the development environment dictates changes.

Development environment is currently XP SP3 + VS2008 (though I can upgrade if absolutely necessary).

What should I be looking at as the first step? Are there any gotchas I should be looking out for?

+1  A: 

If you're looking win forms you're going to have drag-and-drop UI pretty easily.

If you want to use a database than you're probably going to find MS-SQL the easiest to cooperate with. Look up LINQ-2-SQL, it lets you access your database through an object layer by simply dragging your tables onto a pane.

Fun things to use: extension methods, partial classes, LINQ (query any collection with inline lambdas) and even class/method attributes.

Graphain
Personally, seeing as he's just starting with C#/.NET I would skip WinForms and dive straight into WPF. But I'm sure you may disagree!
Groky
Wouldn't disagree at all - just haven't used WPF and assumed it was one of those enterprisey convoluted things from the peripheral noise I read about it. Sounds like I could be pleasantly surprised.
Graphain
Lambdas, they're very wooly district attorneys, right? :-) Actually, I haven't made a decision between WinForms and WPF, I'm at the stage where I don't even understand the distinction yet. One more thing for me to investigate.
paxdiablo
@paxdiablo: I've done only very very simple lambda and LINQ stuff but I found it great for the query like structure. So instead of doing a for with checks on an array, you say select the items that have this and you're done. Again, I'm doing only simple stuff for now, but it's a great trick.
Rox
WPF looks a lot nicer from what I see. I'm not sure if you can get nice event bound drag-and-drop like win forms though?
Graphain
Well actually Graphain, I've written a library for WPF drag/drop: http://code.google.com/p/gong-wpf-dragdrop/ which I feel makes it *easier* than WinForms drag/dop, especially if you're using the MVVM pattern.
Groky
Nice Groky - I'll have to look at this in the future
Graphain
+2  A: 

Just a couple of pointers, it would be easy to overwhelm you as you are just starting with this tech stack. First step, use SQLServer 2008 Express, it has better ability to deal with image data (images can be saved directly to the filesystem, but they are still in a table).

Apart from that, you can design your screen with the GUI, and then hook the bits up one by one to your retreived data. Create a new Windows Forms app, or a WPF one, and start from there (i'm assuming that you know about the toolbox window and just dragging components on to the designer and setting their properties in the Properties window).

slugster
Possibly bad assumption. I haven't even loaded VS yet :-) But I suspect I'll be able to pick it up reasonably quickly - I'm not a stranger to forms-based designers, assuming it's at least a _little_ like VB6.
paxdiablo
One question, are there royalties for distributing SQLServer with an app? In terms of drivers, I mean, not the product itself.
paxdiablo
The drivers are part of the .NET framework but having an embedded instance of SQL server is something you'd have to look into and might lead you to another database solution. Fortunately C# code samples are pretty easy to come by.
Graphain
@pax, there are a lot of parallels between windows forms and old school VB. WPF is a different kettle of fish though, but once you get your head around it you will like it, and it is way more pretty than VB!
slugster
+2  A: 

Have you decided for win forms or WPF? I've been doing win forms for the past 4 years and WPF was a great discovery for me, with the flexibility it affords. It might be fitted for your application and the different types of content you'll want to add and give you a flexibility that win forms can't give.

As for actually developing, I think loading images from the disk would be the first step, showing them in the UI and getting user input for them - you would get to work with the different objects and see how the framework handles things.

A tutorial about the field validation I mentioned in my comment is here - haven't done it, but something similar. You can also see the xaml code paired with the C# code there.

After looking for the differences between win forms and WPF I found that there are a few win forms controls that are missing from WPF. More on that on MSDN (compariosn chart) and a post from March with a more detailed chart.

It's also worth mentioning that you can include win forms controls in WPF applications and vice versa, but there are some limitations.

Rox
If you're saying WPF is a lot easier, that's probably the path I'll take. It's not an application that'll need a lot of under-the-cover power so anything that speeds time-to-market will be good. Your second point is also apt - I have the first three or four agile releases mapped out in that sort of way already.
paxdiablo
It's very xml like in the editing, and if you're starting from scratch in the .NET framework, it's well worth the effort. After reading about it and doing fun stuff with it, I wish I could use for work development, too. A great example is the user input validation and the way it can be automatically and elegantly handled as opposed to win forms where visual hints for the user aren't included.
Rox
+1  A: 

My $0,02:

a) Get to know the platform a bit, types, collections, events/delegates(/lambdas), etc etc

b) Dive into WPF

c) Learn about database connectivity (LINQ2SQL or NHibernate (or ....)

d) Learn about the MVVM pattern to get to deliver solid wpf applications, doing so forces you to dive deeper into the workings of WPF (routed commands, tunneling/bubbleing etc)

e) Learn more about patterns to get a more solid grasp of OO (this: http://www.amazon.com/Design-Patterns-Explained-Perspective-Object-Oriented/dp/0321247140/ref=sr_1_1?ie=UTF8&s=books&qid=1276066663&sr=8-1 is an absolute pearl for that)

f) etc

Oxymoron
Thanks. Types and collections I don't think will cause much hassle, coming from a Java b/grnd. Similarly WPF if it's relatively intuituve. Lambdas and LINQ will require some further education on my part.
paxdiablo
+1  A: 

If you aren't too desperate to get your hands dirty straight away I'd suggest this book: CLR via C#.

It is written for those with programming experience on platforms other than .Net and provides a clear and comprehensive explanation of C# and how it runs on the .NET CLR.

By reading this initially you might avoid writing some of the poorly constructed applications that many of us wrote before properly understanding the technology.

David Neale
+1  A: 
  1. Buy a book on C# & .NET FW fundamentals!
  2. Read! :-)
System.ArgumentException