A couple of ideas for HttpClient

  • Reading time:11 mins read

When invoking any REST web services, a lot of AL code mostly looks like this:

procedure CallRESTFoo()
var
    Client: HttpClient;
    Response: HttpResponseMessage;
    Body: Text;
    Json: JsonObject;
begin
    Client.Get('https://foo.bar/', Response);
    Response.Content.ReadAs(Body);
    Json.ReadFrom(Body);
    // Process JSON body of the response...
end;

Of course, there are more things there, like headers or perhaps calling HTTP POST (or another method) instead of GET, but when you strip it down to the bones, the chunk above is what remains.

Today’s post is a follow up for my HttpClient Patterns live session on http://vjeko.live/ and as I promised, I am providing the text-only version for those who prefer reading to watching.

Continue ReadingA couple of ideas for HttpClient

Schedule for the period ahead

  • Reading time:4 mins read

Happy New Year everyone, with a little delay. I was busy in the first two weeks of this year preparing and delivering the “Leveraging Git” webinar. It turned out to be quite a success, but it also prevented me from doing my live session last Friday.

But this short break doesn’t mean I am not going to get busy with my blog and live blog again. This is what’s coming up.

Continue ReadingSchedule for the period ahead

Fun with Interfaces: Testing

  • Reading time:3 mins read

Oh how much fun we had today on my live stream, it’s just amazing. First, all the viewers had fun of waiting for me to go live for nearly an hour, and then at some point I managed to unplug my reflector. Perks of live streaming 😁

First of all, I would like to – once again – apologize to everyone who waited for me to go live. I’ll explain in the end of this blog what really happened. For now, let’s go on-topic.

Continue ReadingFun with Interfaces: Testing

Webinar: Leveraging Git

  • Reading time:2 mins read

It’s been a few days that I announced the “Leveraging Git” webinar on my Twitter and LinkedIn and I hope nobody will mind if I announce it on my blog.

So, here we go.

Every year I deliver between five to ten trainings. This year, I delivered a grand total of zero, due to the coronavirus outbreak. Times are changing, and I need to adapt. So, following the example set by my two friends, Waldo and AJ, who have already delivered webinars, I have decided to try the same.

The webinar focuses on Git as an essential development tool, rather than just a way to replace those ugly //BugFix.425> code annotations we were all used to in C/AL. Apart from creating a branch (when absolutely necessary), committing (often rarely), and perhaps merging (once in a while, being scared of it), most developers don’t do much more. Many don’t even know what power lurks beneath.

This webinar sheds light on Git, explains its internals, and arms you with new tools and knowledge to take Git to the next level, a level where not only you are using Git, but where you are leveraging it, day in, day out.

To learn more about the webinar, and to sign up, click this button:

Continue ReadingWebinar: Leveraging Git

Live Streaming Lessons Learned

  • Reading time:19 mins read

One thing we learned from lessons learned is that we don’t learn from lessons learned.

Somebody, alegedly

I don’t know where this quote comes from, a one-minute googling didn’t reveal it to me (but it isn’t mine, I’ve read it somewhere for sure).

Anyway, a month ago I started live streaming. This year with grand total of zero live conference sessions delivered must have been a contributing factor. I believe I miss speaking. So I decided to give it a try.

Now, almost exactly a month later, with five total streams delivered, four of which with actual relevant content (the first was merely an introduction), I know so much more about live streaming than when I started. Tell me I am wrong if you want, but I think sharing my lessons learned is a good idea. Maybe it motivates you to start streaming. Maybe it helps you start. Maybe… you never know!

So, this blog is a story of my journey, or adventure, with live streaming so far.

Continue ReadingLive Streaming Lessons Learned

Fun with Interfaces: Patterns

  • Reading time:3 mins read

Today I had my fifth live stream. The topic was interfaces, and this time I took a different angle at it: patterns. When I polled about live stream topics you’d like to hear about, most of you said “patterns”. So today’s stream covers several patterns and puts them in perspective of interfaces, or the opposite way around, however you like it.

The stream is available on my new http://vjeko.live/ page, and here it is if you hate clicking.

Continue ReadingFun with Interfaces: Patterns

Live Schedule for December

  • Reading time:4 mins read

After a lot of fun with interfaces on Friday, I’ve received a lot of very encouraging feedback. It seems that the decision to start live video blogging was right, and I am sticking with it.

I’ve realized that on Friday I didn’t announce any schedule for the period ahead, so here’s what we are going to do in coming Fridays.

Continue ReadingLive Schedule for December

Fun with Interfaces

  • Reading time:1 min read

Today I’ve streamed the Fun with Interfaces video blog at https://www.youtube.com/watch?v=QSMHL32c5mg and the recording is now published online.

This was the first session I ever delivered about interfaces, and I actually planned delivering this a lot earlier (I made a suggestion to run this at Directions ASIA before corona crisis hit), but never had a chance. I now polished the demos a bit and delivered it as-is (no slides, really, so – no theory, just practice).

I will have more to say on interfaces, definitely. Stuff like dependency injection, inversion of control, testability, etc. is all very interesting to discuss and very useful in our daily life with AL.

My today’s session not only shows what you can do with interfaces, but also what you cannot, and why. Maybe, who knows, at some point we get some improvements to address some of pain points from my video.

Thanks to everyone who joined me today, and I am looking forward to see all you next week in “Making InvokeExtensibilityMethod work” session.

Continue ReadingFun with Interfaces

Understanding renaming/moving files with git

  • Reading time:11 mins read

Source code files are living things. We add new ones and change their content on daily basis. Occasionally we delete them, too. Git is amazingly efficient when it comes to tracking these kinds of changes.

However, sometimes we need to change the file name, or file path, or both. And if you are an AL developer who has ever transformed a C/AL project into AL, you have probably done this at least once, for all .al files in the project.

And this is where git may surprise you. After you rename a file, sometimes you’ll notice that git detects it as a rename. But on other occasions it will not be the case.

Let’s dive in.

Continue ReadingUnderstanding renaming/moving files with git