September 17, 2010 Opinion 5 comments
September 17, 2010 Opinion 5 comments
September 16, 2010 Book Reviews, TeamWork 3 comments
September 14, 2010 DDD, Presentation, PublicTalks No comments
Tuesday, Presentation for Main Office
Whole night before presentation I spent reading some awesome articles on DDD and really enjoyed it. That leaded to 4 hours of sleep. Also I took some anti-cold medicine with paracetamol, like on the picture below:
Rule of the presenter, you probably have never heard about:
Feedback that I got from this office is like 4.5 out of 5, in details my knowledge of topic and presenting was ok, but something was not really up to their expectations.
Wednesday, Presentation for Dev Centers
Did not get official feedback from them. None voted :(
Thursday, Presentation for Lviv2 Office
September 13, 2010 IT-Jam, MEF, Presentation, PublicTalks 4 comments
So, that have happened: I visited Kharkiv and I spoke on Managed Extensibility Framework at IT-Jam conference.
IT-Jam
So the whole conference was divided into many sections in which of them Speakers, like me, talked on different stuff. Sections were: (.NET), (Databases, Management), (Mobile, WEB), (PHP, QA) and they were located on 3rd floor (see picture below).
Except of the regular speeches in Open Space sections, there was a huge showroom, were Guru, as they call them, were talking:
As I read from other blog posts this year it was first year, when IT-Jam had separate section for .NET and I should be proved that I took part in it.
So the agenda for .NET section:
My presentation
Since I was speaker I did not leave my .NET section till my delivery, so I listened to Viacheslav and Dima. Both presented very well. Dima made the whole public laughing by using jokes with mentioning Kharkiv’s governor and organizers of the IT-Jam.
My time. I plugged in proector and it turned out, that my resolution has significantly decreased. Was needed to move to “Full Screen” mode in VS and making sure that other tools I’m using fit well. My presentation was more about writing code then about showing slides and talking around them.
Here is presentation itself:
In first demo I wrote ever simplest console application, you probably saw in many introduction videos on MEF.
Second demo was dedicated to demonstrate features of the MEF, like Laziness, Recomposition, Metadata. So I built simple WPF (maybe my second WPF app, after VS plugin) and plugin functionality. Each plugin was able to provide simple string. Here I mentioned one of the teachers on first courses in Lviv University. She used to write “Hellow Word!” :) on the board. So I was needed to implement new version of plugin (Metadata) and reload it (with Recomposition, for example). Guys, who studied there do you remember?
In the end I got many-many questions. It was just question-storm. Wow! I really liked it. Just presenting is very simple, but being able to answer for all questions is something where you should be additional prepared.
Parts Lifetime Question
There was one question where I answered not completely correctly. Question was: “Does CompositionContainer keep references to the parts it clued together.” I answered that yes. But correct answer is not that trivial. MEF is smart enough to keep references only to things that are shared and do not implement IDisposable. You can read in details here. I hope that guy will take a look at my blog and will get correct answer. I really worry about my reputation as public speaker.
As I counted up to 70 people were listening to me and this is the biggest audience I ever had. Hope that number of readers of my blog will increase. Cannot check it right now, since I’m now in train and out of any acceptable connection.
THANK YOU ALL!
Thanks to organizers everything was on the top of people expectations. They managed to host 1200 attendees and make everyone happy. Plus to organizing conference they prepared free food everywhere and party for the evening. They made IT-Jam awesome kick-ass cool event!
Kharkiv
Next day I had great time in Kharkiv, I will probably put link [here] to the blog post of my girlfriend very soon. Really enjoyed its monuments (except of “red star” kind), a lot of fountains, great zoo, cable way and other see-sights.
September 9, 2010 Events, MEF, Presentation 5 comments
I’ll be speaking in Open Space Discussion at IT-Jam in Kharkiv this weekend.
So here is the road I will have to take to get there:
For some reason Ukrainian flights are way-way to expensive and therefor not acceptable by most of the people here. Even more this infrastructure is not really developed to be able to provide good services.
That is why I will have to spend 18 hours only for one way trip (>1000 km). At least I’ll have few friends with me and paper book to read.
Since it is far from Lviv and event is only for one day I’ve decided to stay there for one additional day and go out sightseeing.
Aha, almost forgot, I’ll be speaking on MEF:
After I’m back I will definitely post something about this event.
September 4, 2010 CI, Environment, UnitTesting 6 comments
Couple of days ago I’ve been on CI seminar, where guy had been talking about concepts of the Continuous Integration and at some moment mentioned about testing environment and it suddenly dawned upon me and I would like to share my thoughts on this.
Two of many concepts of the CI are:
Feel the difference?
Ok, why do I ask about this?
Maybe a week ago we’ve moved to approach that builds sources and runs unit tests on absolutely virgin machine. Simply saying, nothing is installed into GAC, except of maybe .net framework. Everything needed we take from library folders under source control. And I agree that is really good thing. Compiler is also ok to build projects when they have reference only to root assembly in folder of other assemblies of some particular component. BUT, when you execute your code (run tests) CRL tries to find assemblies in execution folder and then in GAC. Since we have nothing in GAC, we should ensure that everything gets copied to execution folder, and here we dive into issues.
Fixes
In case of simple referencing this is not a big issue. You just should be as a spider and catch what is missed on enigma CI build machine. In some cases this is very trivial – you see System.IO.FileNotFoundException, in other cases it is not obvious.
Interesting trick
Here is one of tricts that we were needed to apply to make UT happy:
Since dll-s like sqlceme.dll are part of SQL CE, but are not CLR dlls we cannot reference them. So we add them as link in your project and then change Build property to “Copy Always” to have them in bin.
There were some other tricks we were needed to try. They are simple, but there are many.
Main Question is still remaining
All that is not main intent of this post. Main is this: Do I really need to do this. Why is this correct?
And if we are so dedicated to CI, then I would like to know also what are we testing? That our code is able to run even if none of 3rd party components are installed?
I still have some doubts, maybe I’m wrong. I would really appreciate any of your thoughts, comments that will help me figure it out and find the right way.
For fun (but maybe will get lucky) I also asked Martin Fowler in twitter:
As you all may know Microsoft committed some efforts to make VS2010 easy to extend. Extensions are built upon Managed Extensibility Framework, which has been shipped in .NET Framework 4.0. If you haven’t heard about it go and check it out on codeplex mef web page or either read my quick article on it.
Visual Studio 2010 SDK
In order to build you first extentions to VS you will need to download Visual Studio SDK
Download Visual Studio 2010 SDK
After you have installed it under New Project -> Other Project Types you will see Extensibility, which leads you to this list of project types:
Add-in Project
If you selected Add-in project it will lead you to nice wizard, which will ask you if you want to have your AddIn in Tools menu if you should like to start it on the start of VS and what are about information. After you finished with wizard you will get project structure similar to this:
What is interesting about this Add-in project?
Connect class
First of all you get Connect class with provides you with basic method within which you can push in your logic. I put MessageBox.Show(“Hello World!”); under Exec() method.
Extensibility configuration
Also you have two xml bases fixes which are describing your plugin. One of the is located inside of your folder and another one lives somewhere like: C:UsersandriyDocumentsVisual Studio 2010AddinsAndriyAddIn – For Testing.AddIn
F5
When you hit F5, accordingly to project properties, it fires devenv.exe with key /resetaddin AndriyAddIn.Connect.
/ResetAddin Removes commands and command UI associated with the specified Add-in.
When it is re-registering AddIn it is using Extension configuration from file which lifes in Documents folder.You can go to Tools -> Add-in Manager… and turn on/off you plugin.
Here it is
For some odd reason I did not find any way to change the icon it gave for my AddIn:
Anyway it works as designed – show message box. :)
I was able to put my logo only into About section using this config:
Visual Studio Package Project
This time Wizard has 7 pages and it generates a huge (as for template) project:
See there MyControl.xaml? It is WPF UserControl which will be smoothly added to your Visual Studio (just like ToolBox).
To create something at least a bit useful I decided to create ever simplest RSS fetcher and use it for my blog. Being new to WPF it took a lot of my nervous to get that working. And one thought: Why did they create graphic editor for WPF. It is very hard to do something with it. XAML is way to much better choice.
So after I added some not really clear code (crappy?) like this:
LoadRss(); if (rssProvider.Document != null) { var entries = rssProvider.Document.GetElementsByTagName("entry"); RssTextList.Items.Clear(); foreach (XmlNode entry in entries) { var displayItem = new DisplayItem(entry["title"].InnerText, entry["feedburner:origLink"].InnerText); RssTextList.Items.Add(displayItem); } }
I know, I know, this doesn’t much standard rss xml, that is why my RssReader will work probably for feedburner urls. Honestly, I’m not sure about that.
Also I gave up to create binding for my ListBox as it could be preferable for WPF. I saw some ready controls for RSS reading, but hey I did it myself.
Ok. Under View -> Other Windows you will see just created Plugin window:
Finally, RSS feed of my blog inside of Visual Studio
And the whole buity of my today’s work – I can see my (or someone else post titles and by clicking navigate to web) inside of Visual Studio:
August 29, 2010 NHibernate No comments
Few days ago I’ve faced with duplication of data in XML we send to vendors and it leaded my to basic understanding how fetching works within NHibernate.
Database
So to make things clear we will start with ever simplest database layout and few datarows as on picture below:
I’m using following code to test our activities.
It fetches Customer with passed in FetchMode and then uses Orders to examine how lazy loading works.
Then I’m calling method for each of the FetchMode in separate sessions like below:
Mapping of the Customer
Generated SQL-s
NHibernate can generate two types of fetching: either join or either separate select statements. So our code generated three join statements for Default, Eager, Join. Also two calls to database with two selects for the Lazy and Select. So all FetchMode except of Default are overriding our Customer mapping.
Join SQL
There is one thing you should remember about such kind of fetching – you will get duplication of the entities in your collections. You should apply joining when you are going to have some specific restrictions in your query.
Duplication of entities:
On the picture above you see two customers, which are the same references and represent same customer with same id = 10. To eliminate this issue you should apply one of the fixes: use distinct, use subquery or filter entities in client code. This article should make this more clear.
My recommendation is never use “.FetchType.Join()” in your One-To-Many relations as I did that. Better let NHibernate do it by default. Nhibernate applies Join to Many-To-One relations and Select to One-To-Many.
In my case better use following:
The less you write code – the less mistakes you do. :)
Two SELECT-s
This type of query is generated if you have Select() fetch type. If you have LazyLoad in your mapping second select will be executed only on accesing of the Orders property of Customer. In other case (Not.LazyLoad) it will be executed immediately on fetching Customer.
Hope this brings some light. At least for me it does.
August 25, 2010 TDD, TeamWork, UnitTesting No comments
Few days ago I worked few hours on Sunday, so there were only me and one of my co-workers in the room. He is Delphi guy, but likes to learn .NET. He had to implement some custom resizing logic for the report and he asked me if I can help to think on the logic. We had spent maybe couple of minutes before we got some preliminary ideas.
Let’s do Pair Programming
We decided to implement some prototype/logic within .net. I suggested pair programming with TDD: “I will be writing tests – you will be implementing logic to make them work”. BTW, do you know how do we call this particular programming pattern? – It is called “Ping-Pong Pair Programming“.
So after I created basic test project and wrote a test that simply has something like “var report = new Report();” and then “report.Draw();“, which of course is failing UT, he proceeded with creating class for Report and putting in place stub method Draw. Then I added functionality that allows adding report columns, then sizing of them, desiredMinimalWidth and delimiting width. Then UT that verifies if we correctly resize columns, if they fit or do not fit into report. Misha was performing extremely well in implementing logic, we had been thinking on. At some point of time he got stuck, so we continued together on making latest UT work.
I enjoyed this try of doing Pair Programming along with TDD.
What are benefits of doing PP as per me?
Are there disadvantages?
It might happen that PP will not be feasible, especially in situations when problem they are trying to solve is trivial or when one of contributors is not interested in going great job. You can read lot of discussion over the internet about the time PP consumes and the quality of the work. Most commonly you will hear that when doing PP it takes +15% of time if two developers work independently and produces 15% fever bugs.
What are preconditions on doing Pair Programming as per me?
In my further professional growth I will try to involve more people in this practice!
August 24, 2010 Career, Success 21 comments
I’m confident that every smart human should have a plan for life, part of which is a career plan. Most of us spend more than half of our lives working. Did you ever think about that? We spend hours working on some projects, solving some problems, interacting with colleagues, creating and modifying things. Are you dedicated to what you do? If no, I have a question for you: Why do you work on xyz? Really! You may say that you could possibly work with more pleasure on another job. If that is your answer, why don’t you plan to change your job?
If you are dedicated to your work, I would assume you want to grow. Right? Do you have an idea on how you should proceed to reach your goals? Do you know exact steps to take and your knowledge gaps to overcome? No? How then can you be sure that you will grow to more respectful position, a position in which you are recognized and admired?
I always ask people about what motivates them and what they would recommend me to do to motivate others. Answers I get are different in formulation, but they all have the same core elements behind: possibility of career growth, recognizing, achievements, possibility to chief. Main question to you is this:
What do you do to reach your professional and life goals? Do you have a plan?
If you are not sure about what you do or what you should do, it is exact time to build your career plan.
Career plan is list of positions and actions you should take in time to reach your short- and long-term career goals.
First of all, building a plan is a great exercise and a process of establishing steps you should perform. The process itself allows you to have a critical view on your current career situation. You should know where you are right now, where you want to be and what are your abilities/skills. Answers for those questions are prerequisites for building a good career plan. If you have no clear vision on where you want to be, don’t be upset. Work on that. Try to write a few words that describe you after you as if you already reached your goals. How you see yourself in future might change, but at least you have some kick-off list. For me the list is something like “MVP, Consultant, Architect, Author, Community developer”. Also thinking out loud: “own company, another country, being manager, etc”
After you have some preliminary plan, you can refine it by removing less important items and by adding some additional ones. Also you can rethink some things and then rethink again and rethink few more times. In the end you will have some kind of more or less good plan. But do not expect it to be you final plan. I would say that you should always take a look on it and consider if anything requires improving.
After creating your personal career plan you will be different from your co-workers, who just continue to work blindly. There are people who work just to get enough money for a living. This cannot be considered as success, clearly not for me and hopefully not for you. Some other people probably think that simply working hard will lead them to success. Hey guys, just don’t think so! Yes, you are right that hard work is needed and respected, but there are definitely other things you have to add to bake a cake!
Once you have established where you want to be it is time to understand the path.
Normally positions for Software Engineer start with these three:
This is the most general part of a path I see in all software companies. What do we have after that? It really deviates from company to company, but generally speaking this depends on the factor of your interaction with other people, with technology and with the company.
The more you interact with people the more you become leader of team, say Team/Tech Leader. The term might differ, but I like the “Technical Team Leader” one. Even more, if you would like to take more responsibilities you can switch to managing positions and become a Project Manager right after being Tech Leader or Senior Developer.
The less you interact with people the more you become an expert (it is even possible to have such position officially in tech industry). Expert is the person with whom others consult and get advise from.
The more you interact with a company the more you become CEO, but depending on your company’s size you might have few more steps here. Of course, position’s title can differ as you climb the career ladder.
Summarizing, your further steps are in one of the following areas:
Why did I say “positions path”? Because this is not whole representation of the path. A good path should also go through you own personal ambitions related to your job to lead you to the established goals. What do I mean by this? Since I want to be recognizable community developer and known over the world, I should commit a lot of efforts in maintaining this blog, in speaking at events, etc. This has no explicit impact on my career growth, but believe me it has huge and tremendous indirect impact. Also, I would love to write a book and I’m planning on it. I still do not have a clear idea on what that book will be about. I only imagine something either on tech or on success. What matters is that I’ve planned it and I’m proud of it. Some remark goes here. I mentioned about this to my friend and he was laughing at me because I want to write a book and planned it but I do not know what about. I can express my arguments against it here, but would love to hear from you. [Edit 2015-Sep-16: I’ve released a free e-book on design patterns in my native language in 2012.]
My company as one of the leading outsourcing companies in Ukraine is trying to make employees happier with helping them in their careers. They create more positions and they also establish processes that allow employees see where they can move. (I hear you scepticism here…)
It is well known that one of the biggest motivation engines is visibility of a career growth. Since I’m considered to be a perspective employee (at least my employer thinks so), me with my company almost finished building my personalized Career Plan. It is the path with steps I should take to move from one position to another.
Of course, the company doesn’t care about my non-career goals even if they are dedicated to my personal improvement. It is the reason why the company has only included official positions in my career path. Highest position they’ve planned for me is to be one of the tech chiefs of one of the divisions. Highest position means a lot of interaction with clients and huge responsibilities in developing and advising on solutions. But it doesn’t include any of my desires to become community developer and stuff I would like to do to achieve my other goals.
So here I will present my own Personal Career Plan that also includes a lot of other things. I would recommend you to build something similar. On the left you can see path I built combined with some positions, certificates (officially needed for those positions). On the right side you can see my table of “Where do I want to be in a year“. List of “where I want to be” is really powerful tool if you keep doing it year after year. (here is list for 2010 & here is list for 2011) [Edit 2015-Sep-16: To see complete list of year plans click here.]
You must be thinking now: “Boy, hold-on, hold-on! It is way too optimistic path. Are you kidding?“. I would answer “Shut-up! I know my path and will do my best to stick to it. And, btw, where is your plan?”
Even I realize there is some overestimation of my possibilities/skills/efforts I would love think I can do all of this. Thinking in such a way is movement to The Success!
[Edited 2011-Jan-10: grammar fixed and few links added]
[Edited 2016-Jan-20: some grammar fixed]
As this post receives a lot of traffic, I decided to fix some grammar. I’m not changing the story though. I want to keep it the same so I can compare my old plan with my current achievements. Probably it is something you would like to know as well. Therefore I’m planning to write a follow up post in coming months.
Just for fun, here is my 2021 career update: I’m a Senior Software Engineer at Google working in Vancouver, Canada. Before Google I worked for Amazon as SDE3. I don’t know if this is an indication of any success or progress. I definitely had greater plans for myself in 2010. My ambitions subsided significantly and I tend to appreciate diversity of life much more than before. I feel like I probably need a new plan.