Skip to main content.
May 16th, 2008

Building Data Driven Applications with LINQ-to-SQL and ASP.NET: The Session-Per-Request Pattern for ASP.NET

In this article I will focus on buiding the data access layer in ASP.NET 3.5 Web applications with LINQ to SQL and SQL Server.

Lots of articles introduce the LINQ technology, the LINQ to SQL object-relational mapping technology and ASP.NET 3.5 so I will skips these introduction and will explain the main problem I found when I started using LINQ to SQL in ASP.NET web applications. The problem was standard: “How to manage the database session?”.

Managing LINQ to SQL Database Session (the DataContext) in ASP.NET Web Applications

As an experienced Java developer when I started using LINQ to SQL with ASP.NET I had rich experience with Hibernate, NHibernate and other object-relational mapping (ORM) engines like OpenJPA. I was familiar with the common patterns and approaches used to manage the database session and transaction in Web applications (mostly in Java) and I wanted to leverage my existing experience.

The “Session-per-Request” Pattern

The first idea I came upon was to implement the classical “session-per-request” pattern. This pattern opens the database sesion in the beginning of the HTTP request and closes it at the end of the HTTP request. Thus the dynamic Web pages that interract with the database assume the connection is already open. Usually I also start a transaction along with the session and commit it when closing the session. If I need multiple transactions, I start and end them manually. In the most common case the developer do not write any additional code to handle the database connection and session. This worksvery wells for lots of my projects.

The “Session-per-Request” Pattern in Java (with Servlet Filter) 

In Java the “session-per-request” pattern is best implemented with so called “servlet filter” which is just an HTTP request interceptior. Inside the intercepted HTTP request I open the Hibernate session, process the HTTP request and finally close the HTTP session. I can go further and catch the exceptions and rollback transaction as well. Typically after opening the session I put it in the current thread’s local context so all my database access objects (DAO classes) do not need to take it as a parameter. The DAO objects just get the session from the local context of the currently running thread. This works great in Java for many projects and many years.

Typical Java code for this can look like the following:

In the above code the openSession() and closeSession() handle the transaction as well.

The “Session-per-Request” Pattern in ASP.NET

I wanted to implement the same pattern in ASP.NET with LINQ to SQL. In ASP.NET we don’t have servlet filters and HTTP request interception functionality. We have something similar, but with limited functionality and flexibility, the so called HTTP handlers. In ASP.NET the HTTP handlers can catch specific events that are produced during the execution lifecycle of the ASP.NET pages. We can catch events like BeginRequest and EndRequest but we can’t completely override the request processing logic (we don’t have chain.doFilter(request, response) which can be called or not).

In HTTP Module BeginRequest and EndRequest Execute in Different Threads

I don’t know if this is an optimization of architectural issue, but unlike in Java EE in ASP.NET the events BeginRequest and EndRequest for the same HTTP request can execute in different threads. ASP.NET actually uses the same thread for executing several concurrent requests. Really! Thus we cannot open the database connection in BeginRequest, put it in the thread’s local context, use it from the DAO classes when rendering the application’s dynamic web pages and finally in EndRequest remove it from the thread’s local context. No, this does not work with HttpHandler. I found this by debugging.

I tried to fix this by using the Application_BeginRequest and Application_EndRequest in Global.asax, but the result was the same: sometimes ASP.NET runs Application_BeginRequest and Application_EndRequest event handlers belonging to concurrent requests in the same thread.

After lost of experiments I fixed this.

In Global.asax Application_PreRequestHandlerExecute and Application_PostRequestHandlerExecutein Execute in the Same Thread

Following the documentation for the ASP.NET execution lifecycle I found that I can intercept the execution of the HTTP requests in many other ways, in the different stages of the request procesing. I found that the events Application_PreRequestHandlerExecute and Application_PostRequestHandlerExecute are called in the same thread for each request. If we have two concurrent HTTP requests, ASP.NET wil run two parallel threads and will execute each request in separate thread. The same applies for the Application_PreRequestHandlerExecute and Application_PostRequestHandlerExecute events.

Implementing Session-Per-Request Pattern in ASP.NET with LINQ to SQL

Finally I put the following code in Global.asax:

This is what I have in the DataContextManager class which handles my DataContext (database session) by few static methods:

In the examples my data context (.dbml mapping file) is called MMDataContext.

Implementing the Data Access Logic (DAO Classes)

Finally I implemented the data access logic as set of DAO classes and a generic basic DAO parent class:

I wanted to implement the method:

… but I failed. I think there is no way to do this as generic. This is a weakness of the LINQ to SQL framework.

Once I have the generic baseic DAO class I can use it to define my DAP classes, e.g.

Implementing the ASPX Pages that Use the DAO Classes

Once I have implemented the DAO classes I can use them directly in an .aspx page or ascx user control by ObjectDataSource or at event handler. All methods are static and developers do not need to care about thesession management. A sample ASPX page is given below:

Posted by nakov as .net, blog at 12:29 AM EEST

Comments Off

April 28th, 2008

My Talks @ Microsoft Days 2008 in Sofia

Microsoft Dev Days 2008 - LogoI gave two talks at the Microsoft Days 2008 in InterExpo Center Sofia on 24 and 25 April:

What is New in ASP.NET 3.5?

This session focused on the exiting recently introduced features and technologies in ASP.NET 3.5. Starting from ASP.NET and LINQ integration and ASP.NET dynamic data, the I went through the new ASP.NET MVC framework (ala Ruby on Rails) and further through the ASP.NET AJAX and the AJAX Control Toolkit and finally presented the new ASP.NET controls for Silverlight. I presented just few slides and all the rest was a rich set of live demonstrations.

Download the presentation: ASP.NET 3.5 - New Features @ MS DevDays 2008 - PowerPoint Presentation (4.8 MB).

Download the demonstrations: ASP.NET 3.5 - New Features @ MS DevDays 2008 - Demos (2.1 MB).

Best Practices for Optimizing Transactional Code in SQL Server 2008

Transaction management is the most important technique to handle concurrent access and data consistence in the database systems. In this session I talked about optimistic and pessimistic concurrency, database transactions and isolation and explained how SQL Server 2008 handles transactions and isolation by locking and row versioning. The talk started with a deep overview of the traditional isolation levels (read uncommitted, read committed, repeatable read and serializable) and locking mechanisms in the database and presented the “snapshot” isolation level in SQL Server which ensures transaction level data consistency while providing better concurrency with less locking.

Download the presentation: SQL Server 2008 Transactions @ MS DevDays 2008 - PowerPoint Presentation (0.7 MB).

Download the demonstrations: SQL Server 2008 Transactions @ MS DevDays 2008 - Demonstrations (0.1 MB).

Posted by nakov as .net, news, blog at 12:32 AM EEST

Comments Off

March 15th, 2008

Rejected a Program Manager Position at Microsoft Dublin - My Successful Interview at Microsoft

Microsoft DublinLast month I was invited by Microsoft to an interview in their largest european development center in Dublin. It was exciting trip and real challenge to see the Microsoft development live. I was excited of their professionalism in all directions:

I was most excited on the people and process. I think this is what makes Microsoft so successfull: brilliant people and solid engineering process.

Microsoft had a small fault. They didn’t ask me to sing any NDA agreement, so I can share all the interview questions to help all other candidates that want to join Microsoft.

Interview Questions @ Microsoft Dublin

I had 5 interviewers asking me lots of software engineering questions. The questions were very adequate for the team leader position that was my objective (”program manager” position in Microsoft is senior technical position, like team leader in a typical software development company). Interviewers was not only asking me to explain some concept. They gave me a blackboard to write some code and to see how I am attacking the problems, what types of pictures I draw, how my thinking flows, etc.

I remember most of the questions and the answers I gave. I hope my answers were good because I was approved and Microsoft sent me an offer few days after the interview. Below are the questions with my answers:

Question 1: You need to architecture the security for a bank software. What shall you do?

There is not exact answer here. This is about thinking: follow the exisitng standards in the banking sectors, establish global security policy, secure the network infrastructure, secureg the application servers, secure the database, establish auditing policy, securing the operators workstations, secure the Internet and mobile banking, etc. Think about authentication (smart cards), authorization, secure protocols, etc.

Question 2: You are given a string. You want to reverse the words inside it. Example “this is a string” –> “string a is this”. Design an algorithm and implement it. You are not allowed to use String.Split. After you are done with the code, test it. What will you test? What tests you will write?

Elegant solution in 2 steps:
1) Reverse whole the string char by char.
2) Reverse again the characters in each word.
You need to write a method Reverse(string s, int startPos, int endPos).
Test normal cases first (middle of the word, beginning of the word, end of the word, 1 character only, all leters in the string). Check bounds (e.g. invalid range). Test it with Unicode symbols (consisting of several chars). Perform stress test (50 MB string).
Write a method ReverseWords(string s). Test it with usual cases (few words with single space between), with a single word, with an empty string, with words with several separators between. Test it with string containing words with capital letters.

Question 3: What is the difference between black box and white box testing?

Black box testing is testing without seeing the code. Just looking for incorrect bahaviour.

White box testing is about inspecting the code and guessing what can go wrong with it. Look inside arrays (border problems), loops (off by 1 problems), pointers, memory management (allocate / free memory), etc.

Question 4: What is cross-site scripting (XSS)?

In Web application XSS is when text coming from the user is printed in the HTMl document without being escaped. This can cause injecting JavaScript code in the client’s web browser, accessing the session cookies, logging keyboard, and sensitive data (like credi card numbers).

Question 5: What is SQL injection?

SQL injection is vunerability comming from dynamic SQL created by concatenating strings with an input comming from the user, e.g. string cmd = “SELECT * from USERS where LOGIN=’” + login + “‘ and PASS=’” + password + “‘”. if username has value “‘ OR 1=1 ‘;”, any login / password will work. To avoid SQL injection use parametric commands or at least SQL escaping.

Question 6: What is the most challengeable issue with multithreading?

Maybe this is the synchronization and avoiding deadlocks.

Question 7: Explain about deadlocks. How to avoid them.

Deadlock arise when 2 or more resources wait for each other. To avoid it, be careful. Allocate resources always in the same order.

Question 8: Do you know some classical synchronization problem?

The most important classical problem is “producer-consumer”. You have several producers and several consumers. Producers produce some kinf of production from time to time and consumer consume the production from time to time. We have limited buffer for the production. When the buffer is full, producers wait until space is freed. When the buffer is empty, the consumers wait until some producers put something inside.

Practical use of the producer-consumer pattern is sending 1 000 000 emails (production) with 25 working threads (consumers).

Question 9: You need to design a large distributed system system with Web and mobile interface. Through the Web customers subscribe for stock quotes (choosing a ticker and time interval) and get notified by SMS at their mobile phones about the price for given tickers and the requested intervals. A web service for getting the price for given ticker is considered already existing.

Use 3-tier architecture (ASP.NET, C# business tier, SQL Server database). Use a queue of tasks in the business tier and a pool of working threads (e.g. 100 threads) that execute the tasks. A task has 2 steps (query for the ticker price and send SMS). These steps are executed synchronously (with reasonable timeout).

We have another thread that performs SQL query in the database to get the subscriptions matching the current time and appending tasks for SMS notification.

We consider the SMS gateway is an external system.

Question 10: How you secure the stock quote notification system?

We need to secure all its parts:
1) The user registration process - need to verify phone number with confirmation code sent by SMS. Need to keep the password with salted hash. Need to keep the communication through HTTPs / SSL.
2) The application server with business logic. Secure the host, put reasonable limitations to avoid flooding the server.
3) Secure the database (e.g. Windows authentication without using passwords).
4) Secure the network (e.g. use IPSEC)
5) Secure the access to the Web service (WS Security).
6) Secure the mobile phone (e.g. sending encrypted SMS messages and decrypt them with a proprietary software running on the phone).

Question 11: How you write a distributed Web crawler (Web spider)? Think about Windows Live Search which crawls the Internet every day.

You have a queue of URLs to be processed and asynchronous sockets that process the URLs in the queue. Each processing has several states and you describe them in a state machine. Using threads with blocking sockets will not scale. You can still use multiple threads if you have multiple CPUs. The Web crawler should be stateleass and keep its state in the DB. This will allow good scalability.

A big problem is how to distribute the database. It is very, very large database. The key here is to use partitioning, e.g. by site domain. Take the site domain, compute a hash code and distribute the data between the DB nodes based on the hash code. No database server can store all the pages in Internet, so you should use thousands of DB servers and partitioning.

Question 12: You have a set of pairs of characters that gives a partial ordering between the characters. Each pair (a, b) means that a should be before b. Write a program that displays a sequence of characters that keeps the partial ordering (topolocial sorting).

We have 2 algorithms:
1) Calculate the number of the direct predecessors for each character. Find a character with no predecessors, print it and remove it. Removing reduces the number of predecessors for all its children. Repeat until all characters are printed. If you find a situation where every character has at least 1 predecessor, this means a loop inside the graph (print “no solution”). Use Dictionary<string, int> for keeping the number of predecessors for each character. Use a Dictionary<string, List<char>> to keep the children for each character. Use PriorityQueue<char, int> to keep the characters by usign their number of predecessors as priority. The running time will be O(max(N*log N, M)) where N is the number of characters and M is the number of pairs.
2) Create a graph from the pairs. Use recursive DFS traversal starting from a random vertice and print the vertices when returning from the recursion. Repeat the above until finished. The topological sorting will be printed in reversed order. The running time is O(N + M).

Question 13: You are given a coconut. You have large building (n floors). If you throw the coconut from the first floor, if can be croken or not. If not you can throw it from the second floor. With n attempts you can find the maximal floor keeping the coconut intact.

Now you have 2 coconuts. How many attempts you will need to find the maximal floor?

It is a puzzle-like problem. You can use the first coconut and throw it from floors: sqrt(n), 2*sqrt(n), …, sqrt(n) * sqrt(n). This will take sqrt(n) attempts. After that you will have an interval of sqrt(n) floors that can be attempted sequentially with the second coconut. It takes totally 2*sqrt(n) attempts.

Question 14: You have 1000 campaigns for advertisments. For each of them you have the returns of investments for every day in a fixed period of time in the past (e.g. 1 year). The goal is to visualize all the campaigns in a single graphics or different UI form so the user can easily see which campaigns are most effective.

If you visualize only one campaign, you can use a classical bar-chart or pie-chart to show the efficiency at weekly or monthly basis. If you visualize all campaigns for a fixed date, week or month, you can also use classical bar-chart or pie-chart. The problem is how to combine the above.

One solution is to use a bar for each campaign and use different colors for each week in each bar. For example the first week is black, followed by the second week, which is 90% black, followed by the third week which is 80% black, etc. Finally we will have a sequence of bars and the most dark bars will shows best campaigns while the most bright bars will show the worst campaingns.

I knew that I was approved even at the interview. It was a good sign that the manager of the development in Microsoft Dublin for the Windows Live platform Dan Teodosiu personally invited me in his office at the end of the interview day to give me few additional questions and to present me the projects in his department. Dan is extremely smart person - PhD from Stanford University, technical director and co-owner of a company acquired by Microsoft few years ago. It was really pleasure for me to meet him.

There were 2 teams in Dublin that wanted to have me onboard: the edge computing team working on Windows Live and the Office Tube team working on video recording and sharing functionality for the Microsoft Office. I met the manager of the Office Tube team at the end of the interview day to discuss their products and development process.

I was Offered a Senior Position @ Microsoft Dublin

Few days later I was offered senior software engineering position at Microsoft in Dublin. I was approved and the recruiters started to talk with me about my rellocation in Dublin. Few days later I received the official offer from Microsoft. It was good enough for the average Dublin citizen but not good enough for me.

I Rejected Working at Microsoft Dublin

Yes, I rejected the Microsoft’s offer to work in their development center in Dublin. The reason was that their offer was not good enough. The offer was better than the avegare for the IT industry in Dublin. It was good offer for a software engineer and if I got it 5-6 years ago I would probably accept it.

I was working as software engineer for more than 12 years. I am currentlty CTO and co-owner of a small software development, training and consulting company and I am a team leader of 3 software projects in the same time (two Java and one .NET project). In the same time I am a head of the training activities and I manage directlty more than 10 engineers and of course I am paid several times better than the average for the industry. In the same time I am part-time professor in Sofia University. I am about to finish my PhD in computational linguistics. I have share in few other software companies. All of this was a result of many years of hard working @ 12+ hours / day.

In Bulgaria I was famous, very well paid, working at own company with no boss, managing development teams and having very good perspective for development. To leave my current position, I needed really amazingly good offer. I got good offer, but not amazingly good. That’s why I rejected it.

My Experience at Interviews with Microsoft and Google

Few months ago I was interviewed for a software engineer in Google Zurich. If I need to compare Microsoft and Google, I should tell it in short: Google sux! Here are my reasons for this:

1) Google interview were not professional. It was like Olympiad in Informatics. Google asked me only about algorithms and data structures, nothing about software technologies and software engineering. It was obvious that they do not care that I had 12 years software engineering experience. They just ignored this. The only think Google wants to know about their candidates are their algorithms and analytical thinking skills. Nothing about technology, nothing about engineering.

2) Google employ everybody as junior developer, ignoring the existing experience. It is nice to work in Google if it is your first job, really nice, but if you have 12 years of experience with lots of languages, technologies and platforms, at lots of senior positions, you should expect higher position in Google, right?

3) Microsoft have really good interview process. People working in Microsoft are relly very smart and skillful. Their process is far ahead of Google. Their quality of development is far ahead of Google. Their management is ahead of Google and their recruitment is ahead of Google.

Microsoft is Better Place to Work than Google

At my interviews I was asking my interviewers in both Microsoft and Google a lot about the development process, engineering and technologies. I was asking also my colleagues working in these companies. I found for myself that Microsoft is better organized, managed and structured. Microsoft do software development in more professional way than Google. Their engineers are better. Their development process is better. Their products are better. Their technologies are better. Their interviews are better. Google was like a kindergarden - young and not experienced enough people, an office full of fun and entertainment, interviews typical for junior people and lack of traditions in development of high quality software products.

Posted by nakov as .net, news, blog at 1:02 AM EET

Comments Off

March 8th, 2008

Java Won the IT Boxing Match on Web Technologies (ASP.NET vs. Java vs. PHP vs. Ruby)

The Java team won the second IT Boxing match on Web technologies on 6 March 2008 in Sofia.

The battle was merciless: 24 contestants in 4 teams (.NET, Java, PHP and Ruby) fighted for proving their technology better in 9 technical talks with live demonstrations. The teams presented ASP.NET, ASP.NET AJAX, ASP.NET MVC, Echo2, Google Web Toolkit, JavaServer Facaes and other Java EE technologies, PHP, Symfony framework and Ruby on Rails along with lots of demonstrations and discussion.

Finally the visitors voted and the results states:

The winner is the Java team!

IT Boxing - Java Champions - 6 March 2008

Video from the Fight

We recorded the fight so everybody can enjoy it:

Posted by nakov as news, blog at 7:14 PM EET

Comments Off

February 26th, 2008

ASP.NET vs. PHP vs. Java Web Frameworks vs. Ruby on Rails - 6 March 2008 - park-hotel “Moscow”, Sofia

IT Boxing - FightThe topic of this event is “Web Development Technologies: ASP.NET vs. Java & JSF vs. PHP vs. Ruby”. The .NET team will present the ASP.NET, ASP.NET AJAX, ASP.NET MVC and the new ASP.NET extensions in .NET Framework 3.5. The Java team will stand up for JavaServer Faces (JSF), Google Web Toolkit (GWT), Echo Framework and other Java Web development frameworks. The PHP team will stand up for the Web frameworks in PHP, especially the Symphony framework. The Ruby team will stand for Ruby on Rails.

Venue

The event will be held on 6 March 2008, starting from 17:30 h in Park-hotel Moscow, Sofia, hall Moscow. The hall capacity is 350 people.

Sponsor

The event is sponsored by Telerik, a leading world wide vendor of User Interface (UI) components for ASP.NET and Windows Forms, and .NET Reporting solutions.

Telerik - logo

Agenda

Time

Topic Speakers
17:30-17:50 Presenting the “IT Boxing Championship” initiative, the dispute topic, teams and rules Svetlin Nakov,The Referee Team
17:50-18:10 Technical talk #1: ASP.NET AJAX Alex Thissen,The .NET Team
18:10-18:30 Technical talk #2: Echo Framework Peter Milev,The Java Team
18:30-18:50 Technical talk #3: PHP and PHP Web Frameworks Peter Vukadinov,The PHP Team
18:50-19:10 Technical talk #4: ASP.NET MVC Framework Alex Thissen,The .NET Team
19:10-19:30 Technical talk #5: Google Web Toolkit - Dynamic Web on Java(Script) Jordan Jordanov,The Java Team
19:30-19:50 Break
19:50-20:10 Technical talk #6: Symphony Framework for PHP Peter Vukadinov,The PHP Team
20:10-20:30 Technical talk #7: ASP.NET The .NET Team
20:30-20:50 Technical talk #8: JavaServer Faces (JSF) Nikolai Dokovski,The Java Team
20:50-21:10 Technical talk #9: Smashing Rails Sava Chankov,The Ruby Team
21:10-22:20 Open dispute and direct fight between the teams The .NET TeamThe PHP TeamThe Java Team The Ruby TeamThe Referee Team
22:20-22:30 Voting, announcing the results and awarding the winners All visitors vote

ASP.NET

ASP.NET is a set of Web development technologies provided by Microsoft as part of .NET Framework. It is used by developers to create dynamic Web applications and Web services. ASP.NET provides component-based architecture with comprehensive page rendering and execution model that relies on the concepts of the event-driven development. ASP.NET supports the concept of separation between the code and UI presentation and supports custom components, data binding and master pages. Developers can use C#, VB.NET and other .NET languages to create ASP.NET Web applications. ASP.NET is the best Web technology, isn’t it? If you don’t agree, come to fight at the ring.

ASP.NET AJAX

ASP.NET has a really strong story for AJAX. The AJAX implementation supports both a server centric and a client centric programming model. On the server new AJAX controls extend the Page Framework and offer the well-known control based and event-driven way of working. The AJAX controls take care of partial rendering of Web pages. Microsoft has released an impressive cross-browser compatible AJAX library on the client side. It allows you to do full client-side JavaScript development, and adds object orientation with inheritance, a type system including reflection and namespaces. And to top it all, the AJAX library is royalty-free and you can use and change it however you like. Surely no other AJAX framework can put up against this much power and survive a 12 round fight!

ASP.NET MVC Framework

Microsoft goes into a new direction of web application development with the introduction of the Model-View-Controller framework for ASP.NET. The benefits of the MVC approach include the ability to achieve and maintain a clear separation of concerns (data, presentation and actions), and also facilitates test driven development (TDD) and define page navigation rules. Microsoft’s MVC implementation is all about extensibility and flexibility. You have a free choice of the type of controller, the way URLs are routed and how views are created. The MVC Framework leverages the ASP.NET runtime and should be easy to learn for existing ASP.NET programmers, but also those coming from other runtimes and frameworks. All in all, the ASP.NET MVC Framework is sure to pack a punch. Will the combination of ASP.NET and MVC bring a quick knockout?

Java Web Technologies

The Java Enterprise platform (Java EE) provides solid foundation for development of Web applications and Web services. It introduces the concept of Web containers and Web applications. Java Web applications are built on the top of Servlet/JSP standards which serve as basis for the more complicated Web technologies. The Servlet API provides the basic execution model for the Web applications. The JavaServer Pages (JSP) technology provides additionally custom tags and tag libraries and has built-in expression language.

JavaServer Faces (JSF)

As a natural extension to the Servlet/JSP standards JavaServer Faces (JSF) provides standard component based architecture for Web applications. It provides reusable UI components and comprehensive rendering and execution model. Developers can benefit of using event driven development, data binding, control validation and page navigation rules. JSF is naturally extended to support AJAX with partial rendering and asynchronous execution and update of controls on the page. Shall the JSF gain a victory over the opponents as a technical effort or the Java team fill fall into boxing combat? Be sure to come and see.

Google Web Toolkit (GWT)

This session intends to reveal some of the benefits of GWT as UI Framework. Nowadays having a dynamic web UI is a must. Java programming is always preferred compared with pure HTML and Java Script. So combining both can really boost productivity and in the same way give us the opportunity to have a nice and flexible UI. The session will also include the usage of GWT in a real SAP project so that everybody can get a feeling for the product. Somebody mentioned JavaScript and AJAX support in .NET and PHP? No need of fight: GWT does not just use JavaScript and AJAX; those are in its blood.

Echo2 Framework

Echo2 is a platform for building Web applications that approach the capabilities of rich clients. The applications are developed using a component-oriented and event-driven API, eliminating the need to deal with HTML, JavaScript and the “page-based” nature of Web browsers. Echo2 applications are by their nature AJAX-enabled. To the developer, Echo2 works just like a user interface toolkit with and presents very simple approach to write efficient Web applications. Any AJAX pugilists?

PHP and PHP Web Frameworks

Some developers believe that PHP code is always low quality and PHP does not have good frameworks and standards for enterprise development. Is this true? What makes PHP the most widely used Web development language?

PHP frameworks are hot topic in the Web development community. Some of the most popular frameworks are: ZendFramework, Symfony, Codelighter, CakePHP, eZ Components but this list can not be either accurate or comprehensive.

PHP does not need to fight or dispute with the rest. It is the largest community and keeps the largest market share in Web technologies, isn’t it?

Symphony Framework for PHP

Symfony is a complete PHP framework designed to optimize the development of Web applications. It contains numerous tools and classes aimed at shortening the development time of a complex Web applications. Additionaly, it automates common tasks so that the developer can focus entierly on the specifics of the application. Some of the key features are: MVC separation, simple templating and helpers, cache management, smart URLs, scaffolding, multilingualism and I18N support, AJAX support and built-in unit and functional testing framework. Does anybody think Symphony is not better than ASP.NET and JSF? We shall see.

Smashing Rails

Since its inception several years ago Ruby on Rails has steadily garnered a lot of attention. The rolling stock seems not to be hype-powered only in shunting established technologies. Rather than presenting Rails the Ruby team decided to let it speak on its own. Ruby on Rails will squash the other Web technologies. Come to see this.

Teams

5 teams and 23 contestants take part in the event. The teams:

Free Event

The event is free and the hall is large, so please come with your friends! Everyone will get small gifts from our sponsors.

Official Web Site

Visit the IT Boxing Official Web site for more information.

Posted by nakov as .net, news, java, blog at 12:20 PM EET

Comments Off

February 6th, 2008

Design Patterns Course @ Sofia Univeristy

With a few collagues I teach a course in Design Patterns in Sofia University for the summer semester of 2007/2008. We will cover the classical GoF patterns (creational, functional and behavioral) and as well as some additional topics like architectural patterns (like MVC). Our curriculum is based on the classical book “Design Patterns: Elements of Reusable Object-Oriented Software”:

Creational Patterns

Structural Patterns

Behavioral Patterns

Architectural Patterns:

Visit the official site of the Design Patterns course for lecture materials, enrollment, news and forum: http://patterns.dev.bg/.

Posted by nakov as news, blog at 12:51 AM EET

Comments Off

January 30th, 2008

Next IT Boxing Is Comming: Web Technologies (ASP.NET, JSF, PHP)

IT Boxing - LogoThe next IT Boxing event is coming. The date is 6 March 2008. TThe venue is the same: Sofia, Park-hotel Moscow. The topic is “Web technologies” and the team will present the hottest Web technologies from .NET, Java and PHP.

Talks will be split into short sessions (20 minutes) and the focus will be on the demonstrations rather than theory.

The match we will have 3 teams:

1) The .NET team will have on the board a famous International speaker - Alex Thissen from INETA. Alex will come for the event from The Netherlands to talk about ASP.NET and ASP.NET MVC. I have confirmations from other famous speakers: Branimir Giurov, Galin Iliev, Martin Kulov, Stefan Dobrev, Deyan Varchev.

2) The Java team will be lead by Nikolay Dokovski, a JSF industry expert, working for SAP A.G. He will defend the JavaServer Faces technology along with hid team.

3) The PHP team will stand for proving that PHP is a strong platform for Enterprise Web applications. Speaker will be Peter Vukadinov from Varna.

Visit the IT Boxing Official Web Site for more information.

Posted by nakov as news, blog at 2:24 PM EET

Comments Off

December 27th, 2007

Overqualified to Work in Google

Google - Zurich Office

My Interview at Google in Zurich

A week ago I visited Google in Zurich, Switzerland. The reason: during the years their recruiters asked me once monthy to join Google. I had so much invitations to join Google in Mountain View, Zurich and other locations that I finally decided to see at least what they offer. After passing successfully two phone interviews I was invited in their office in Zurich for a comprehensive 1 day interview.

Google Interview Process is Like a Programming Olympiad

I was amazed how Google perform their interviews. Really! They asked me only about data structures and algorithms. I was feeling like at a programming contest. I needed to solve 10 Olympiad style problems, each for 20-30 minutes. They requested to write a source code on the dashboard.

I will not reveal any of the questions (because I signed NDA) but their interview style was like at the programming contests and Olympiads which was lost ago in my childhood and student’s years.

Believe me, a 15 years old schoolboy, a good programming contestant, can pass these questions without having any experience in commercial software engineering.

That was all. Nobody asked me about my software engineerign skills, technologies, etc. Only algorithms and problem solving, data structures, complexity, etc.

Google Interviewers Don’t Ask About Software Engineering, Technology and Soft Skills

I have been interviewed in tens of interviews and was and interviewer for tens of job candidates but I have never thought that some company could could employ anybody only by his technical skills.

What Google don’t aked me:

1) They don’t ask anything about technologies, e.g. AJAX, Java, Java Web technologies, databases, SQL, XML, Web services, multithreading and synchronization, software architecture, etc.

2) They don’t ask about software engineering, e.g. the software project lyfecycle (requirements, design, implementation, testing etc.).

3) They don’t ask about your experience. No questions about what is your current job, what is your experience, what projects you have been part of, etc.

4) They don’t ask about personal character, e.g. are you a team pleayer, are capable to manage a team, do you have experience working in an International team, do you have good communication skills, etc.

It is really strage. My experience shows that soft skills are more important than the technical skills and I always weight them more.

How Google will employ somebody that has only algorithmic thinking and analytical skills without having a team working and communicational skills? I have no idea. I asked my collegues working for Google and they also don’t have an idea. Strange …

I was Overqualified to Work in Google

I week after my visit to Google I was informed that my results at the interview were very good but I was not accepted because they don’t have a suitable position for me. It was strange because I solved well all the algorithmic problems during my whole day interview sessions in Zurich. I was a leading programing contestants for more than 10 years, a champion in tens of Olympiads and contests (Bulgarian and International) so the technical questions were not complex for me. There were no other questions except the technical ones which I solved so I believe I passed the interview successfully.

I filled an employment application form in which I requested a relatively high salary and high position because I was an Olympiads medal winner, had more than 12 years of commercial experience as software engineer, trainer, consultant and project leader, and currently hold very high technical position in Sofia. I believe Google will have such open positions in Zurich but unfortunately they didn’t. I was rejected probably because I was overqualified.

Posted by nakov as news, blog at 3:45 PM EET

Comments Off

Never Use GoDaddy Services!

Never use GoDaddy! GoDaddy are cheaters!

A year ago I needed to purchase hosting services for hosting few domains and emails. In the adveertisment it was said that GoDaddy supports anything I need (hosting emails, web, subdomains, enough traffic and hosting space) but it was misleading advertisment. GoDaddy is a fraud!!! Here are few reasons why:

1) You can not try the service for free. The only chance is to purchase it. You can not purchase it for just a month. They let me purchase 1 year hosting with not option for money back refund.

2) After they crarged my credit card, I found that GoDaddy can not host email for subdomains, e.g. if you need to have email like somebody@subdomain.host.com this is not possible with GoDaddy. They don’t have secure FTP. They don’t support catch all email filter. They don’t have most usual hosting features offered by cPanel.

3) GoDaddy has extremely unusable user interface. If you want to do some change, e.g. create a new mailbox, you should submit the change and wait for few hours for changes to happen. Hey, GoDaddy, which century you are living? I was amazed how terrible is their admin interface.

4) After you register, you will soon find the GoDaddy’s service is unusable and you want to cancel it. This is impossible! They don’t refund money back. You pay some money, find that the service you purchased is fake and does not work and you can not do anything.

5) A year after GoDaddy fraud me, I received a notice that my credit card is charged again for a service that I have never used and have not purchased. They sent me an email saying “We just want to let you know we’ve automatically renewed the following items … We have billed your Visa card …”. You can not cancel this charge. They just charge you without requesting a confirmation.

GoDaddy are fraud! Once created, you can not delete your account. There is not such option in their site menus. The only way to stop their charges to your credit card is to ask your bank to revoke your credit card. You don’t have a chance for chargeback. No way.

Now I am trying to cancel my account at GoDaddy and their support don’t answer me. They just steal my money.

Never use GoDaddy! GoDaddy are cheaters!

Posted by nakov as blog at 2:26 PM EET

Comments Off

December 12th, 2007

The .NET Team Won The First “IT Boxing” Match : ADO.NET+LINQ vs. Hibernate and JPA

The “IT Boxing” Visited by 250 Developers!

On 11 December 2007 I organized the largest event of the Bulgarian Association of Software Developers (BASD). It was held in Sofia and was visited by 250 software engineers and thus BASD was proved to be #1 community organization in Bulgaria.

IT Boxing

The subject of this first “IT Boxing” event was “.NET vs. Java database access technologies and ORM tools”. The .NET team presented the LINQ and the ADO.NET Entity Framework and Visual Studio 2008. The Java team presented Hibernate, Java Persistence API (JPA) and DB4O.

The Winner is the .NET Team!

The .NET Team won the first IT Boxing match named “ADO.NET Entity Framework and LINQ vs. Java Persistence API and Hibernate”. The vote of the audience stated the following results (not all visitors voted):

More details about the event:

Posted by nakov as .net, news, java at 3:15 PM EET

Comments Off

« Previous Entries