Entity Framework Core Week

Getting familiar with EF Core is not easy at all.

Last week was hectic, I really had a lot of trouble trying to understand how EF Core works and understanding its concept, to the extent that I told my parents, I guess my supervisor regrets taking me as an intern, hahhahah.

So entity framework can simply be defined as an object which maps database to .NET. Mainly, Entity Framework (EF) and Entity Framework Core exist, such that the latter is an advanced version of EF and it supports features that EF cannot support .

EF Core is what we use at Tong Hin. It works by creating model classes and context objects which represent sessions with the database. Migrations are then used to create the database and update it as the model evolves and changes. EF Core supports relationships in database, ranging from One-to-One relationships, One-to-Many relationships, and Many-to-Many relationships.

EF Core can be used for querying and retrieving data from the database, save, edit and delete data. Taking note that all these functions are done in the model class of the entities.

The concept of EF Core is a lot, I will mention more about it in the next upcoming blogs.

Next, I was introduced to fluent assertion, which makes the assertion statement readable to anyone who has a look at the codes instead of using the statement Assert(2, 4), the following statement is more readable and understandable Answer.Should( ).Equal(2).

Clean code is a concept which involves ensuring that the codes written are easier to understand and are easier to change. Clean code can be written by adhering to the following basic guidelines which are, writing meaningful names, writing correct comments, following the standardized format of code writing, removing and refactoring unnecessary classes, and many other guidelines that can ensure that the codes written are considered as a clean code.

See you all next week again 🙂

Wrappers, DAL and Pub/Sub

Basically, I get to learn new concepts and terms everyday at Tong Hin.

Last week, I got to know what DAL, Pub/Sub and decoupling mean.

I also got exposed to the reason why Wrappers are used instead of ViewModels. The reason is that Wrappers are used to hide the complexity of ViewModels and WrapperServices are used to hide the complexity of Wrappers. Such that programmers get access to the codings they need without having the need to go through the complexity that lies underneath the functions they are using.

Data Access Layer (DAL) is an interface which simplifies and gives access to data stored in persistent storage, it returns a reference to an object instead of returning a row of fields from the database. DAL is used to call methods such as insert, update and delete from methods in the class which would return objects that contain the needed values.

Pub/Sub which is also known as Publish-Subscribe is a software messaging pattern that allows messages to be sent from publishers to users (subscribers) without them getting involved in sending the message to the subscribers. The messages are sent to channels in which these channels are responsible of retrieving the messages from the publishers and sending them to subscribers.

On the other hand, coupling is defined as the level of interdependence among two software modules, thus, decoupling is the opposite, in which it means how unconnected two modules in a software program are found to be. Two software programs or modules are said to be decoupled when a change is done in one module, the other module does not need to be changed or in other words, the other module is not affected by the change that has occurred in the other module.

Lastly, I was taught how to create tests in a better and more efficient way. Instead of using Assert, Fluent Assertion is a better alternative to be used.

That’s basically a summary of what I have been through last week.

Wait for me next week again 🙂