Button Behaviour, Concurrency Situation and Sourcetree

To begin with the week, I continued from last part I left off previous week. I did some research and some trials to allow the application to store data into two attributes from one input. It is troublesome for me at first, but I managed it after half day of experimenting and with the guidance of supervisor.

After I figured out storing data, I then started to plan on how I should proceed my task as below:
1. Read and compare two value from columns of database.
2. Statement for decision making algorithm.
3. Call existing functions to control behaviour of delete button.
4. Delete selected row when button is Enabled.
5. Pop ups dialog box for confirmation as delete button clicked.
6. Pop ups Error message whenever selected row is unable to be deleted.

Next, I begin with some testing based on existing code, hence, start my implementation. First of all, I learnt that AsNoTracking( ) in Entity Framework is useful when reading data from database. It is said so, AsNoTracking queries are quicker to execute compared to tracking queries. I understood that, I should use it whenever I don’t need to update retrieved data. However, I retrieved the data using tracking query, and perform test using logger to make sure I implementing it correctly. I proceed with comparing and if-else logic to decide behaviour of button.

After that, I implement a dialog box confirmation upon user’s delete command. Also, when logic allows deletion of selected data, it will completely remove it from database table. When logic forbid deletion of data, error message is invoked to inform user stating “Unable to delete data as it has been used”.

Apart from given task, I also learnt about idea of concurrency when things happen at the same time in a system. There is situation whenever two or more user adding new data with the same ID at the same time. Hence, there are some few example codes, for me to go through in order to handle such situation.

Lastly, I get in touch on using Sourcetree, A GUI software that is simplified to interact with git repositories. I learnt to use Sourcetree to stash and apply my version of codes of my project file. Besides, I also learnt how to solve conflicts when a group project is combined in Sourcetree. I could not agree less that Sourcetree provides idea of git and good features that support team implementation.

Getting Started with Small Portion of Project Source Code

As I went through some learning material that will be use in upcoming project, I am given an introduction towards an on-going project beginning with understanding the business logic behind the project.

After I was given the source code, I learnt about Docker, a set of platform that uses OS-Level virtualization to deliver software in packages called as containers. It allows me to run an image of database and connect to it without having the database install locally. In order to connect to the database of the project, I need to invoke an command in Docker to start the image before I can run the project smoothly, then, connect to database using Docker’s IP address and port.

As I done with connecting to database, I begin to play around and perform some unit testing. Then, I was taught how to drop certain column, perform migration process between project and database after add in a new column to store new set of data.

Lastly, I was given a task to disable a button click over certain condition. I felt hard and still unable to complete my given task. I believe it is still due to me lack of experience and knowledge, but I still working on it until I manage to complete the task given.

Get to Know About Prism Library for WPF

I acknowledged that Prism is great framework that support MVVM (Model View View Model) design pattern. First of all, I am introduced to few terms based on the course I followed on some courses and tutorials (Title : Introduction to Prism for WPF).

Next, I learnt how to perform view injection to allow certain text to be displayed when i run the the program. It is performed simply just by linking instance of region to specific region called as ” NAME” in XAML file. Other than that, I also followed some step to implement View Model Locator and construct property to allow connection between View(XAML file) and View Model(CS file) in prism.

Beside that, I came across to know about delegate command, where it is used to implement ICommand without require an event handler. Delegate command can invoke method defined in ViewModel and let u control the properties on view from ViewModel. Hence, I played around with ICommand provided by prism that bind UI gesture to particular action/event. Along side of that, I also try out composite command, where it is able to invoke multiple view on one touch and IEventAggregator, which is a good implementation when you have lots of objects that are potential event sources.

Lastly, I understood the purpose of Dialog in prism library as it is used to notify user of current system progress or asking for user’s confirmation upon an action. In dialog, it is divided into two type, where one is block interaction with the rest of the application (modal) and one is to allow user to still interact with the other part of application (non-modal).

Conclusion, I do have to admit spend quite some time understanding how prism library works as I am still weak in programming knowledge, but thanks to guidance from my supervisor and going through it several times, I managed to get a grab on my understanding.

Implementation of Test Driven Development (TDD) and Benefits in C#

First and foremost, I learnt about C# fundamental as previously I have no experience in compiling codes using C# language. Before I start, I learnt that I requires Microsoft Visual Studio/Visual Studio Code as IDE to compile C# language and .NET Core framework as it can fully support C#. I learnt about C# syntax, generics, access modifier, arrays, looping, nullable, performing unit testing, deriving base class, defining interface and etc.

Next, I able to understand the concept of Test Driven Development (TDD), as I learnt that TDD is a great approach in software development, where it requires one repeatedly testing and refactoring particular function of code before including them into source code of project. Next, I also able to experiment and figure out how to apply TDD on C# compiler (Visual Studio) using xUnit. I noticed TDD has a lot of benefits including shorter debug cycle which saves time, produce cleaner code hence increase code quality, reduce unnecessary code, allows easy and safe refactoring.

Additional :
I am able to learn about git repository. After going through lab tutorials and several experimenting on git, I learnt that git repository is a version control system that allows us to tracks changes in source code during software development. Other than that, git repository assist in coordinating works among programmers. Furthermore, I also learn to remotely link local repository with online repository using bitbucket, to ease the storing source code of certain project online in future.