Friday, 20 September 2013

Must Prepare Delegates and Event Handling Questions for C# Interview

Must Prepare Delegates and Event Handling Questions for C# Interview 

If you are going for interview in C# / ASP.NET, I would suggest you to must prepare the topic of Delegates and Event Handlers in C#. This is the most basic as well as tricky C# interview question which you will be surely asked. I have listed down some of the C# interview questions on Delegates and Events.

1. What are Delegates? What are the types of Delegates? What is the difference between Delegate and Multicast Delegate?
2. What are Events and Event Handlers in C#? 
3. What is the basic difference between Delegates and Events?
4. Isn't an Event Handler a type of delegate in C#?
5. When to use Events and when to use Delegates?
6. All Delegates in ASP.NET are Multicast Delegates?
7. Write down the syntax of Delegate / Multicast Delegate.
8. How to subscribe and unsubscribe event handlers and delegates in C#?

There is a lot of material available on delegates and event handling concepts on Google and StackOverflow. You can get all these by just simple googling. You should also prepare some working example on the above questions so that you can better explain the above concepts on delegates and events. Also give a good look on the syntax of delegates and events. If you would be able to answer the above questions on delegates and events in the C# interview, half of the work will be done. It will give you the positive impact and upper hand in the interview because I have noticed that even many of the experienced C# developers are also not able to explain the delegates and event handling concepts.

I remember that when I was just a fresher in the IT world in 2009, I had given a project interview in my company for ASP.NET project. One of the senior team member took my technical interview and asked very basic C# and ASP.NET questions at the very beginning of interview.  I felt confident by answering those simple C# / ASP.NET questions on CLR, conditional statements, looping structures, session, cookies, data binding concepts etc. Then he jumped to delegates and event handling questions and after telling him 2-3 basic things on delegates, I was blank and mum. I did not know the depth of delegate concepts and how delegates and events are used in the real world projects. Because I was fresher at that time, so that person spared me on those questions, smiled and took me into his project. But today as a 4 years experience, if I am not able to explain these delegates and event handling concepts in the interview, I will make big blunder and this time nobody is going to spare me on these questions.

Wednesday, 18 September 2013

A Software Developer should be a good Debugger and Analyst

A Software Developer should be a good Debugger and Analyst

As a developer, you are not going to develop a project from scratch every time  You cannot expect sheer coding work at all the time. In IT industry, major effort of project life cycle goes into maintenance and support. 

I have 4 years of software development experience and currently I am working in my second company. In my this short experience, I have worked in 5 projects out of which 3 were maintenance projects and 2 were development projects which had to be developed from scratch. My first project was in Shipping domain which was maintenance project. Next two were development projects in Retail and Manufacturing domain which had to be developed in Delphi XE2 and WPF respectively, fourth one was health and insurance domain and my current project in security domain in which I have to migrate a Delphi 7 application to Delphi XE4.

In all the projects I did till now, I had done a lot of maintenance tasks like fixing existing bugs, doing some enhancements, adding / modifying new features in the existing big application, handling tickets and resolve the issues etc. But this is also quite interesting job in the life of a software developer. In fact these things are the real test of a software developer. To handle these kind of tasks you must have good debugging capabilities. You have to identify and use your skills and experience to know in which file, in which part of code, the issue is arising. You should use StackTrace, TraceInto features to know the real cause of the issue and fix it.

Impact Analysis

Only issue tracking and fixing is not only the solution. You should be aware of the impact which your change can cause to the application. So I suggest you to comment at every place where you make changes in the code with name, date and reason why the code was changed. Proper testing of application is required after making any change to ensure that all the existing functionality are not impacted by your change.

Documentation 

After adding/modifying the features/issues in the application, documentation related to the application like SSRS, Test Cases should be updated.

In short, maintenance and support projects are not boring. You can learn a lot from these projects. These kind of projects sharpen your debugging skills and make you good analyzer. These qualities are necessary to make you a complete and skilled software developer.

Learning and sharing: 

While analyzing the issues and debugging the code, you come to explore many secrets of the complex application. I usually use to note down all the new things, findings and solutions which I learn during this process and document it. I use to share them on the internal knowledge portal of my company so that other people if encounter same kind of error, may get benefited from my work. It also helps me because if I face same problem, I can refer my document.

Interbase (IB) vs Firebird (FB): Differences and Similarities between Interbase and Firebird

Interbase (IB) vs Firebird (FB): Differences and Similarities between Interbase and Firebird

There are a lot of differences and similarities between Interbase and Firebird. I have tried to compare both Interbase and Firebird in my way (Interbase vs Firebird).

Interbase and Firebird are two different database servers. Firebird has originated from Interbase. After the release of Interbase 6.0 in 2000, developers moved away from Interbase and made first freeware and open-source version of Interbase and named it Firebird 1.0, made it available on SourceForge. Up to this point, all the features of Interbase and Firebird were same but after this different team started working on their products (Interbase and Firebird).

Following are the differences between Interbase and Firebird:

1. Firebird is freeware and open source while Interbase is commercial and  is currently developed and marketed by Embarcadero Technologies. So Firebird as being freeware and open source, the community members can change/modify anything in the source code and all other users of Firebird will be benefitted of that. 

2. Delphi supports officially only Interbase, however drivers probably work with basic functions and there are free and paid drivers and libraries available for Firebird. With Enterprise and Architect Editions of Delphi XE4, Firebird drivers are also supported. Delphi works well with Interbase using two different sets of access components. Interbase Express provides specific support for Interbase only. It does not support Firebird. Database Express, a more generic set of components for various databases, is also part of Delphi and supports both Interbase and Firebird. IBX is usually preferred over DBX for Delphi access to Interbase.

3. In Firebird, there is an embedded version so you don't need a real server - single user "server" is embedded into Delphi (Win) or Lazarus/FreePascal (Win/Lin) executable.

4. Interbase and Firebird DLLs: Usually we use gds32.dll to connect with interbase database server and fbclient.dll to connect with firebird server.

5. Latest Releases of Interbase and Firebird: 

InterBase XE is the latest version of Interbase which was released in 2010. Interbase XE new features include a 64 bit client and server, improved security, improved scalability, support for dynamic SQL in stored procedures, and optimized performance of large objects with stream methods.

Firebird 2.5.2 is the current stable version. New features included in this Firebird release are improved multithreading, regular expression syntax and the ability to query remote databases. The planned 3.0 release is expected to support stored procedures in languages such as Java and C++, and SQL window functions that restrict query results. An alpha version was released in August 2013.

Tuesday, 17 September 2013

What is the difference between dbExpress, dbGo and BDE in Delphi? Why to use dbExpress?

What is the difference between dbExpress, dbGo and BDE in Delphi? Why to use dbExpress?

There are a lot of database connectivity options in Delphi. Embarcadero supplies drivers for many databases, including Oracle, Firebird, InterBase, DB2, Informix, SQL Server, MySQL and ODBC. Additional drivers are available from third parties. Delphi supports many databases using several data access providers like dbExpress, dbGo, BDE, Interbase, FIBPlus, DevartIntebase (third party) etc. We will only talk about difference between BDE, dbGo and dbExpress and why should we use dbExpress instead of dbGo and BDE?

BDE is Borland Database Engine which was used in earlier versions of Delphi. Although its not deprecated still in Delphi XE4 but its advisable to migrate from BDE to dbExpress. 

dbGo for ADO mainly uses ADO connections to connect to MSSQL Server. No further enhancements have been made to dbGo since Delphi 6 when dbExpress was introduced. 

Both BDE and dbGo are bidirectional and uses connected access to database which degrades the performance in case of complex applications.  

dbExpress was introduced in Delphi 6 to replace BDE. dbExpress is a light-weight, extensible, cross-platform, high-performance mechanism for accessing data from SQL servers. dbExpress provides connectivity to databases for the Windows, .NET and Linux (using Kylix) platforms. dbExpress allows you to access different database servers like MySQL, Interbase, Oracle, MS SQL, Firebird, Informix etc. 

Disconnected Access and Unidirectional Approach in dbExpress

BDE and dbGo for ADO use connected data access techniques, that operate directly on the table or database but dbExpress architecture is the disconnected data access implementation available in Delphi. Instead of directly making any modification in database table, the dbExpress architecture requires the use of a TDataSetProvider to feed a TClientDataSet before we can connect to a TDataSource and data-aware controls.

One of the most significant features of dbExpress lies in the fact that it accesses databases using unidirectional datasets. Unidirectional datasets do not buffer data in memory - such a dataset cannot be displayed in a DBGrid. To build a user interface using dbExpress you will need to use two more components: TDataSetProvider and TClientDataSet as described above. 

Due to disconned access and unidirectional approach, dbExpress is provides good performance, so it is suitable for complex applications.

Friday, 13 September 2013

Can Developers / Programmers live without StackOverflow?

Can Developers / Programmers live without StackOverflow?

A Software developer or programmer faces new challenges everyday during project development. In each line of code, there is something new to explore. While developing any application, any product, we know many things technically how to do? But, there are many things for which we have to google. There may be many unforeseen exceptions which may come in the coding path. While coding, a software developer encounters many errors and exception, some of them he or she already knows how to resolve and for many of them he / she has to google. 

When I am saying "google", I mean searching on the internet. But I have noticed that while searching any code related queries on the google, out of first 10 results, at least 5 are from stackoverflow. When I land on stackoverflow pages by searching my problem / errors / exceptions, I feel somewhat confident to know that I am not the single person in the universe who is getting this kind of error. There are lot of my friends across the globe to help me out. I am so much impressed with the people on stackoverflow who are expert in their technologies and have thousands of reputation points on stack overflow. Sometimes I think, would I be able to compete them in future? 95% of my problems are resolved by stackoverflow expert discussions.

Even if you don't find any useful link while googling, and also there is no link on stackoverflow, you can ask your question there on stackoverflow. A lot of experts with very high reputation points are sitting on stackoverflow who will help you out within minutes. When your question gets resolved, it will also help other developers who would encounter the error you asked on stackoverflow because stackoverflow has very good google rank and its pages get indexed on google search within minutes and start appearing on first page of google when you search similar problem again.

If you encounter any problem and solve it by yourself after some struggle, I will suggest you to share your finding on stackoverflow. Ask a question and answer it yourself because it will surely help other programmers around the world who encounter this problem in the future.

I feel a lot of dependency on Stackoverflow. So, as a software developer, I think StackOverflow is boon to me which is solving my problems for almost 4 years and will continue to favor me in future.

Saturday, 7 September 2013

How to create and consume webservices in Delphi using HTTP and SOAP protocols?

How to create and consume webservices in Delphi using HTTP and SOAP protocols?

I had to create and consume a webservice in my delphi XE4 application. I searched on the internet and after a lot of search I was able to pick some useful links (texts and video tutuorials) which may be useful to you while creating and consuming a webservice in delphi. I am just sharing those links to you in a sequence I understood them.


If you are new in webservices with delphi, you must start from this tutorial. This tutorial on webservices in delphi is written by Pawel Glowacki on Embarcadero Blogs.


This is the video tutorial on Embarcadero Development Network (EDN). This video tutorial on webservices in delphi is presented by Wecsley Fey - Aquasoft IT. He teaches consuming of webservices in delphi step by step with a simple examples. 



Read this article on consuming web service in delphi after clearing your concepts by reading above links. This link is for delphi 7, but it will give you clear idea on how to implement webservice in any version of delphi.


This link is also very simple for consuming web services in delphi. This site also provides some interesting web services which you can consume for free for testing purposes. You can create a demo delphi application and consume the webservice given on this site to play around.



You will have to sign in to Embarcadero to watch this video tutorial on building and consuming web services in Delphi and Delph Prism.

Bug Tracking with EurekaLog in Delphi and C++ Builder

Bug Tracking with EurekaLog in Delphi and C++ Builder

EurekaLog is the new Delphi and C++Builder exception tracer tool that gives your application (GUI, Console, Web, etc.) the power to catch all exceptions, memory leaks and detect infinite-loops and deadlocks. It generates a detailed log with the call stack at the point that raised the exception, showing unit, class, method and line number, (see this example), and displays it on screen and optionally sends it back to you via email or to a Web Server (using the HTTP-S/FTP protocols or sending directly to your preferred "Web Bug Tracker" software), thus helping speed up the process of bug-location and resolution by a factor of 10!

EurekaLog Performance

EurekaLog is easy to use because it's fully integrated into the IDE - just enable EurekaLog for your application and rebuild your application to add EurekaLog's features. EurekaLog does not affect application performance (it runs only when an exception occurs) and increases compiled file size by just 0.5% - 4% (it uses this space to store some additional, compressed and encrypted debugging information). You do not need to distribute any additional files with your EurekaLog-enabled application.

EurekaLog Compatibility

EurekaLog is compatible with Delphi 3, 4, 5, 6, 7, 2005, 2006, 2007, 2009, 2010, XE, XE2, XE3, XE4 and with C++Builder 5, 6, 2006, 2007, 2009, 2010, XE, XE2, XE3, XE4 (including Personal, Turbo and Starter editions). It works on Windows 95, Windows 98, Windows ME, Windows NT, 2000, Windows XP (x32 and x64), Windows Vista (x32 and x64), Windows 7 (x32 and x64), Windows 8 (x32 and x64), Windows Server 2003, Windows Server 2008 (x32 and x64), Windows Server 2008 R2 (x32 and x64), Windows Server 2012 (x32 and x64). It supports both Win32 and Win64 platforms. It supports VCL, CLX and FMX (FireMonkey) frameworks.

Note: Delphi 3 and Windows 95-NT are supported only by EurekaLog 4-6. EurekaLog 7 is the current and most recent version of EurekaLog. With EurekaLog, you also get free access to licenses for older versions EurekaLog 4, EurekaLog 5, and EurekaLog 6. Download links to installers of earlier versions will be available in your control panel after purchase. Please note that old versions are no longer developed nor supported. They are provided only for backward compatibility purposes. You can use them, if you need support old systems (Delphi 3, Windows 95, Windows 98, Windows ME, Windows NT).