Visit site Yanniel's notes

November 2011

5
votes
Vote UpVote

Internationalizing your Delphi application: An ABC example

Yanniel's notes – If you want to make your Delphi application general enough to address multiple locales, then you need to internationalize it. There are three common aspects that I want to emphasize (no necessarily in that order): Resourcing Unit conversionsDynamic messagesWe’ll cover the three of them with a very ...
Details Favorite? Off-Topic? Yanniel @ 2011-11-25 19:41
1
vote
Vote UpVote

Multiton Design Pattern in Delphi

Yanniel's notes – The multiton is somewhat an extension of the singleton pattern. It is referred as registry of singletons by the GOF. I don’t know for sure who appointed the name multiton: it’s an analogy derived from the term singleton. So, singleton = single + ton; while multiton = multi + ton.The singleton ...
Details Favorite? Off-Topic? Yanniel @ 2011-11-21 19:42
3
votes
Vote UpVote

Dependency Injection in Delphi: a simple example

Yanniel's notes – I want to give a fairly simple Delphi example that will expose the dependency injection pattern. No framework, no third-party library will be needed here: just plain Delphi code.I won’t dig into the different forms of dependency injection. I will explain the idea of the pattern as simple as ...
Details Favorite? Off-Topic? Yanniel @ 2011-11-03 12:23

September 2011

6
votes
Vote UpVote

Decorator Design Pattern in Delphi. Multiple Decorations

Yanniel's notes – In my previous post I introduced the decorator design pattern to you. I used a fairly simple example (a silly example if you wish) in order to give you a flavour of the pattern. I wrote Delphi code for that matter and I focused in having ONE, and only ONE, decorator class.This was the situation in ...
Details Favorite? Off-Topic? Yanniel @ 2011-09-22 15:43

August 2011

4
votes
Vote UpVote

Decorator Design Pattern in Delphi. Single decoration

Yanniel's notes – Decorator (also referred as Wrapper) is classified by GoF as a structural pattern. Its purpose is to:“Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.”   Both inheritance and the decorator ...
Details Favorite? Off-Topic? Yanniel @ 2011-08-26 15:57
0
votes
Vote UpVote

Anonymous Methods in Delphi

Yanniel's notes – Under the scope of Delphi, an anonymous method is either a procedure or function that’s unattached to an identifier. In other words, anonymous methods don’t have names, which is why they are called “anonymous”.Basically, you can assign a block of code (in the form of a procedure or function) ...
Details Favorite? Off-Topic? Yanniel @ 2011-08-19 16:38
0
votes
Vote UpVote

My contributions to the Delphi community at RosettaCode

Yanniel's notes – RosettaCode is a wiki site that gathers a collection of programming tasks being resolved in as many programming languages as possible.You can post solutions to a particular task using a particular language (Delphi, Java, C++, C#, Ruby, the list goes and goes).  All solutions to the same task ...
Details Favorite? Off-Topic? Yanniel @ 2011-08-16 01:39
0
votes
Vote UpVote

Hide the utter "Create" constructor of TObject in Delphi

Yanniel's notes – In Delphi, constructors can be inherited; this doesn’t happen in Java, C# and C++ for example. Furthermore, constructors in Delphi can have multiple and different names; usually they are called Create, but this is just a convention, since you can define a constructor with whatever name you choose.In ...
Details Favorite? Off-Topic? Yanniel @ 2011-08-16 00:45
0
votes
Vote UpVote

Implementing the Singleton Design Pattern in Delphi without Global Variables

Yanniel's notes – The purpose of this post is NOT to cover the insights and applicability of the Singleton pattern, instead  I just pretend to give you a Delphi code snipped that implements it. This implementation is focused in avoiding variables that are global to the unit (or Unit Global Variables).Fist of ...
Details Favorite? Off-Topic? Yanniel @ 2011-08-15 16:54

July 2011

0
votes
Vote UpVote

Using Macros in Delphi

Yanniel's notes – Computer programmers often need to transform a piece of code in a repetitive way. For example, consider transforming the following fields declaration into a fields initialization [1], as shown below: You can do that by hand of course, but you can also use macros to streamline your work, specially if ...
Details Favorite? Off-Topic? Yanniel @ 2011-07-20 14:03
0
votes
Vote UpVote

Null character in Delphi (Caret notation: ^@)

Yanniel's notes – I was assigned with a new programming task and I found the following constant declaration in the base code (Delphi 2007):const  s1 : PChar = ^@;I was not sure about the meaning of such statement: the first ideas in my mind pointed me to think about some kind of pointer related syntax. I was ...
Details Favorite? Off-Topic? Yanniel @ 2011-07-20 14:02
0
votes
Vote UpVote

Delphi Developers in Toronto

Yanniel's notes – There are very little opportunities for Delphi developers in Toronto (Canada). The job market for software developers in this area is monopolized by .NET (C#, VB) and Java technologies in at least an 80 percent. C, C++, PHP, Ruby and even Objective C are more popular than Delphi these days.I love ...
Details Favorite? Off-Topic? Yanniel @ 2011-07-20 14:01
0
votes
Vote UpVote

String compression/decompression routines using Delphi

Yanniel's notes – I wrote the following two functions (in bold) with the purpose of compressing/decompressing string values within a Delphi application: .........................implementationuses  ZLib;function ZCompressString(aText: string; aCompressionLevel: TZCompressionLevel): string;var  ...
Details Favorite? Off-Topic? Yanniel @ 2011-07-20 14:00
0
votes
Vote UpVote

Fetching a web page with Delphi

Yanniel's notes – This function fetches the HTML content of a given web page. It takes the page's URL as parameter and returns the corresponding HTML text. The name CURL comes from the PHP Client URL Library that can be used (among other things) for the same purpose..................implementationuses  ...
Details Favorite? Off-Topic? Yanniel @ 2011-07-20 14:00
0
votes
Vote UpVote

Calculating the factorial of a number in Delphi: Recursive and iterative methods

Yanniel's notes – The factorial function can be defined in both recursive and iterative ways. Take a look at the following definitions borrowed from Wikipedia.Recursive definition: Iterative definition:For both the above definitions we have that: The purpose here is not the mathematical stuff, but two provide the ...
Details Favorite? Off-Topic? Yanniel @ 2011-07-20 13:59
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)