Coding week

For this week , I did my first two-phase commit (2PC) in my next task . When adding a new item into database, multiple databases are used . That is where 2PC is implemented , because there is more than one database involved. The terms committing and rollback is often used in 2PC, committing is when updating a record to a database. A rollback is the operation of restoring a database to a previous state by canceling a specific transaction or transaction set .

During this process , I also learned the difference between repository and service in the project. Repository is to create methods for CRUD and services is used to write methods for the business logic. This was very useful to me because back then in my academy, I mixed my business logic and CRUD in the same folder, caused a lot of confusion to my trainer and myself. I believe now that I know about services the project structure in the future will be much cleaner.

That is about it for last week , I also did some HotFixes on the UI of my first task (Convert WinForm to WPF MVVM project) to increase the font-size and layout, and recreated the container in my docker to setup for my second task.

For next week, I will move on to create the integration test for my second task ( auto increment for sequence count for short code).

More into UI!

I was still working on the user interface for the past week as well.

I have as well updated the tests created previously by adding a new GoodsReceive. Such that the first scenarios of my major task is that when a user searches for a supplier from a purchase order, at the same time while creating a purchase invoice a goods received is created as well is almost 70% complete.

I also got to know that when retrieving properties or entities in EF core, we cannot mix Tracking and NoTracking, such that AsNoTracking() functions are used with method headers that contain the word “Read” as the method is only reading values from the database without getting tracked whether these values have been changed or not.

Likewise, method headers with Get are used when we want to track values in the database.

Wrappers are always involved with work that has to deal with the user interface. Meanwhile, services are involved with database work.

The Linq function Select() return a collection of items or elements, while, First() returns the first element that satisfies the condition.

See you all next week 🙂