Embrace Problems – They Will Lead You to Knowledge

 

If you are a developer, you will encounter countless problems in your career. As a developer, problem solving is what you do. Still, some may try to shy away from problems in order to make their lives easier. I say do not, especially if you are a new developer or are learning a new technology. Learn to embrace problems as they come along.

I am not simply referring to basic business problems, but issues that you encounter that cause weird problems that you must solve in order to continue. I’ll give you an example.

Today the other developer on my team asked me for some help. We are using Entity Framework (EF) for our custom ERP program. We had created a view in the database for a piece of our application and had added to our Entity Data Model (EDM). The other developer found that there were duplicates in the view query results and so changed the SQL to eliminate it. However, when he tried to refresh the view in the EDM, it didn’t work because it couldn’t infer an entity key (since views do not have primary keys).

After delving into the problem, we found that EF requires a non-binary, non-nullable field in order to infer an entity key. The old query had a column that was the result of a COUNT() function that EF was using as an entity key and we got rid of it. We ended up having to add the entity manually to the CSDL and the SSDL, assigning an entity key of our choosing.

While some problems can make you bang your head against a wall and frustrate you, understand that these kinds of issues ultimately increase your understanding of the underlying technology. I know much more about how EF works since I now had to create an entity from scratch in the XML, despite the natural want for it to “just work.” Next time this problem arises, I’ll know what to do. And I found it to actually be fun. Remember that knowledge is the treasure that you find when you keep digging to solve problems.

Print | posted on Friday, September 2, 2011 8:52 PM

Feedback

No comments posted yet.

Your comment:





 

Copyright © jboyer

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski