Posts

Showing posts from September, 2017

How to declare Static/Class variables, properties, functions and procedures in Delphi?

In Delphi, we do have static variables, properties, functions and procedures, but instead of the word "static" we refer the word "class". In this tutorial, I have shown the syntax of declaring the static variables, properties, functions and procedures in Delphi. We don't have to use "static" keyword while declaring the static variables and properties, just use "class" keyword. While declaring static functions and procedures, we have to use both "class" and "static" keyword. Declare a static/class variable in Delphi type   TStaticDemoClass = class(TObject)   public     class var StaticVar: integer;   end; Declare a static/class property in Delphi type   TStaticDemoClass = class(TObject)   private     class var FStaticVar: integer;   public     class property StaticVar: integer read FStaticVar write FStaticVar;   end; Now we can use above StaticVar variable/property anywhere in the unit like this: procedure TForm1.Button1C

VCL Hierarchy in Delphi: Types of Controls in Delphi: TWinControls and TGraphicControls

Image
In VCL (Visual Component Library) hierarchy, you will find TObject at the top, then TPersistent, then TComponent and then TControl. TObject >> TPersistent >> TComponent >>TControl VCL Hierarchy in Delphi TObject is the base class from which all classes descend. TPersistent class descends directly from TObject. The special characteristic of TPersistent is that it is an abstract class that defines the methods that allow it to be streamed. TComponent is the base class from which all components descend. Non-visual components are descendants of TComponent. For example: TTimer TControl is the base class from which all the visual components descend. For example: TEdit, TListBox, TComboBox etc. Again, there are two types of controls (TControl): Window Controls (TWinControl) and Graphic Controls (TGraphicControl) Following is the difference between TWinControl and TGraphicControl in Delphi: TWinControls TWinControls can receive input focus and they can be parents to other cont

What is the difference between Singleton Class and Static Class? Which one to use and when?

Almost both singleton class and static class serve the same purpose which creates confusion among developers and architects about which one to use. When to use singleton class and when to use static class. In this article I have tried to differentiate between the two. Following is the list of differences between a singleton class and a static class: 1. Singleton classes are more inclined to the object-oriented concepts as compared to the static classes. With Singleton classes, you can use inheritance and polymorphism to extend a base class, implement an interface and capable of providing different implementations. While a static class cannot inherit their instance members. So, Singleton classes are more flexible than static classes. 2. Singleton classes can be passed as an object to other methods while a static class allows only static methods and you cannot pass static class as parameter. 3. If your requirement is to maintain the state, then singleton class is the better choice than s

Security and Privacy issues with IoT (Internet of Things) - Top barriers to IoT success

IoT is one of the biggest breakthroughs in the history of the tech industry. It will soon be an inherent part of every aspect of our lives. Security and Privacy are the most significant challenge for the IoT. Security and Privacy issues are acting as top barriers to IoT success. So, addressing underlying security and privacy concerns is very crucial.  As more and mored devices are being added to the IoT everyday, privacy and security concerns are becoming vital.  Security issue with IoT devices Security is one of the main concerns of the IoT ("Internet of Things"). With billions of devices connected to the internet, it is needless to say that to protect your connected devices from malware penetrations is a real challenge. Security risks of IoT devices cannot be ignored whether it is from hackers or corporations. Increasing the number of connected devices increases the opportunity to exploit security vulnerabilities. When IoT devices are connected to the cloud or data centers

Real World Examples of IoT (Internet of Things) - How will IoT change our lives?

IoT (Internet of Things) is going to change our lives to a large extent. In the coming years, we will realize the real potential of IoT. Below are some real world examples of IoT. Lets consider  IoT enabled Alarm Clock or say Smart Alarm. Imagine you wake up at 7am every day to go to work. Your alarm clock does the job of waking you just fine. That is, until something goes wrong. Your train is cancelled and you have to drive to work instead. The only problem is that it takes longer to drive, and you would have needed to get up at 6.45am to avoid being late. Oh, and it’s pouring with rain, so you’ll need to drive slower than usual.  A connected or IoT-enabled alarm clock would reset itself based on all these factors, to ensure you got to work on time. It could recognize that your usual train is cancelled, calculate the driving distance and travel time for your alternative route to work, check the weather and factor in slower travelling speed because of heavy rain, and calculate when it

Internet of Things (IoT) - Next Stage of Information Revolution

The term "Internet of Things" was first coined by Kevin Ashton, cofounder and executive director of the Auto-ID Center at MIT in 1999. The "Internet of Things (IoT)" is the next stage of the Information Revolution.  What is IoT (Internet of Things)? IoT refers to the connection of devices (other than computers, smartphones and tablets) to the Internet via embedded sensors. It allows devices to talk to us and talk to each other. So, IoT can also be defined as a network of internet-connected devices able to collect and exchange data using embedded sensors.  A thing, in the "Internet of Things", can be a person with a heart monitor implant, a farm animal with a bio-chip transponder, an automobile that has built-in sensors to alert the driver when tire pressure is low or any other natural or man-made object (almost anything else you can think of) that can be assigned an IP address and provided with the ability to transfer data over a network with the help of e