I was wondering lately what is the real challenge in my current project, and what is the easy part. Do I manage the challenges the right way? Can I find some optimizations?
My answer to the challenge question is yes, there is a challenge. Understanding really well customer requirements is. What is the business process behind? What are the entities and properties?
What tables to I have as an input? Fields set as a flag? Certain situations require different treatment?
How much freedom has the user, to manipulate or corrupt data?
Yes, processing the real data that goes in the application is the real challenge, mapping it to entities that can survive the changes of the life of the application.
And what to do when the input data has some flaws? Data duplication, bad codification, violation of uniqueness... how to bridge this in my database?
Writing code is the easy part.
1. there is some routinely written code: SQL queries - 80% are repetitive, following the same pattern (not exactly same commands). Writing the entity classes and the ORM functions that map DB procedures to entities, almost totally a routine.
2. Some semi- routinely written code - linking the WPF layout with bindings to entities, setup the ViewModel and View, draw basic XAML (copy-paste, than change)... Oh how I hate this XAML.
3. The interesting part is to write some algorithmic functionality: saving files and creating emails, generating views with filtered data, writing some more complex LINQ queries, generating invoices, creating Outlook Emails, Reports with Reportviewer...
What is then the hard part?
I think understanding the requirements really well and mentally mapping out a process how to tackle the solution step by step. Visually, View by View, Tabs, Tables, Reports, and a general succession.
Then comes the execution, test, populate with data, correction, again test, again addition of data, etc.
And finally the customer feedback, and again, corrections, optimization, refactoring, test, submission to the customer.
And after several attempts, there is the prototype that can be used at least on the short term, before the next iteration.
That's my approach. What do you think, what's your process?
Showing posts with label WPF. Show all posts
Showing posts with label WPF. Show all posts
Tuesday, November 5, 2019
Sunday, November 3, 2019
My first big project (.NET) - and technologies used.
In the summer of 2017, together with my former finance manager, I began to design an internal recharge system for the company.
The choice was WPF for Windows (https://docs.microsoft.com/en-us/dotnet/framework/wpf/getting-started/walkthrough-my-first-wpf-desktop-application) using the old .NET, and an MS SQL Database.
We began to learn, exercise and think about the tools to use:
Our inspiration was: https://www.iamtimcorey.com/
1. IDE: Visual Studio Community 2017
2. WPF - for the visual part, front-end
3. ORM - Dapper - I think this is the best discovery ever! Tim speaks about this in his Videos.
https://www.iamtimcorey.com/blog/137806/entity-framework
Please, check out his videos, about SQL, C# and lots of serious tutorials and courses.
(https://stackexchange.github.io/Dapper/)
See also: https://dapper-tutorial.net/
4. MS SQL - I needed to review my SQL knowledge. Did a lot of exercises, and build many stored procedures for the application - dapper maps the entities to the data returned by those stored procedures, and I also used SP to insert and update entity data. Even if this was very time consuming in the beginning, proves to be very efficient and goal oriented.
5. lots of company data about expenses and the algorithm to create allocation keys - business logic designed together with Finance Manager.
The journey was hard. It took me probably 1 year to really get some speed, and show something to my Finance Manager colleague.
Luckily, I had my finance background, to understand the process we tried to automate, as there was a working excel macro/formula model as well used before the application.
But, I needed to fix my knowledge of C# (also using MVVM the first time for WPF) and SQL/Dapper. This meant weekly 2-3 hours of coding for 1 year to get some traction.
Main source for C# was google and Tim Corey, and my big discoveries were:
- lists/collections of items
- LINQ and the foreach
- breaking down the tasks to smaller chunks and functions
- writing a services class to export lists to excel using OpenXML
- first steps in async/await
A special challenge was how to integrate the good old WinForm control ReportViewer into WPF and MVVM. I will detail these maybe in another blog post.
Subscribe to:
Posts (Atom)




