Me and my colleague are working on a new application that should replace as soon as possible an old VB6
/Access 97
application made years ago.This application has a lot of problems, adjusting them in the same environment is simply impossibile.
What we are trying to do is rewrite all the code in C#
and MySql
.
We’re basically starting from scratch, the only things we can keep from the old project are some data that we already migrated from Access
to MySQL
My question is, since we’ve a restricted time and we’re learning while coding (no past experience in C#) what are the things that we should consider to implement and what should we just avoid for now ?
The scope of the application here is not really important, just some reading and writing on the database.
This is what we’re already doing in our small team of 2:
- Source Control –
Git
, we had no SC before - Bug tracking –
FogBugz
in our case, we moved on from Excel - Solution – We now have 1 solution with 3 Projects inside, in VB6 there was 5 different project. 5 different .exe for no real reason.
This is what we’re not really sure is worth the time implements:
- Entity Framework – Seems good but there’s a learning curve, as of right now we’re going with
ADO.NET
,pretty straight forward. Planning on usingDapper
when possibile since it seems really fast and easy. -
Unit test – We’ve never done any unit test before, we started with
NUnit
but since our application is only writing and reading data from the database we’re not really sure how implement it. Triedmoq
also with the same results. In this case we think our way to go is just have a dump of the database and just test that. -
WPF –
WPF
seems awesome but there is a learning curve here too. We started our project inWinForms
, our main gol now is to have a functional app as soon as possibile not a pretty one. This is also pretty big for the future of this application because for what I’ve understand going fromWinForms
toWPF
is a big step and need a lot of rewriting. -
Reports We have 100+ reports to recreate. They’re all made in
CRXI
using a table likeReport1_Print
in the database with all the data repeated on all the rows. Awful. We’ve not tried anything yet but we’re planning on usingVisual Studio Report designer
. -
Deploying 30-35 users are going to use it, as of right now we share the updated
.exe
of the vb6 app on our server and users download it with a.bat
. We’re looking for something a little more fancy here…
With time in mind, what should be our main focus ? We’re not really looking for the best way to do things, we’re looking for the best way to get the job (a good job) done as soon as possibile. The focus here is on the users that as of right now can’t work efficiently.
6
WPF is indeed a steep learning curve if you are taking that jump from older UI frameworks; not least because to be proficient with WPF you need to learn the finer points of XAML and the MVVM pattern; but you will probably end up finding yourself with problems which are solved by various MVVM frameworks (e.g. Prism, Caliburn, MVVM Light) and IOC containers (e.g. Unity, Castle Windsor, StructureMap) – so those are added to your list too.
Unit Testing As Lawrence mentioned, this is undoubtedly the best place to start – because unit testing and Test-Driven Development cannot realistically be done retrospectively (i.e. once the code is written, adding unit tests is usually too hard and too time-consuming to be worthwhile).
It will undoubtedly take time to be acquainted with the overall unit testing mindset and methodology; but time you spend right now learning to apply TDD the right way will make all other aspects of your development process easier in future.
On a note about unit testing with MOQ and Entity Framework/Dapper – you can save yourself some pain of mocking ORM entities if you use an auto-mocking tool such as AutoFixture
. https://stackoverflow.com/questions/5786628/what-are-the-differences-between-moq-and-autofixture
Entity Framework is generally quick to get something basic running if you’ve never used it before; There’s a 10-minute “Quick-start” video on MSDN for letting EF create a new database from scratch using Code First. https://msdn.microsoft.com/en-us/data/jj193542
Of course, EF goes a lot deeper than that; although if its performance is a problem then Dapper is of course a better alternative. (Though I’d suggest waiting to find out whether its performance is a problem before abandoning EF).
Deployment – You could take a look at ClickOnce
– you can this get up and running very quickly. https://www.youtube.com/watch?v=t4BTLdIMYEY
Lastly, I see you didn’t mention Continuous Integration anywhere – do you have anything set up? If not, I’d strongly urge you to get an automated build server ASAP which can react to each new commit and runs your unit tests every time. (e.g. TeamCity or Jenkins – both are relatively quick and easy to get started with)
0
With the context you’ve described, there are many suggestions that can be made. However, you ask for just one:
With time in mind, what should be our main focus?
With the 5 things you’re not sure is worth the time and needing to choose just one to start with, I’d recommend starting with unit test. Coupled with proper source control, doing this properly should give you confidence to try out the other things. Think of it as a safety-net of sorts. It’s doubly important if you’re unfamiliar with the target language – too easy to break something accidentally.
Have a look at Test-Driven Development if you aren’t already familiar with it.