user-avatar
Today is Sunday
May 20, 2012

December 9, 2011

Upgrading from Composite Application Guidance to Prism 4.0

by maridob — Categories: Technology — Tags: , , Leave a comment

We are currently using the first version of PRISM which is the CAG (Composite Application Guidance) in our application. As I am working away with my story, I bump into a scenario where I need to pass extra parameter into my constructor.  Dang! Not supported in CAG. At this point in time, I have 2 options… first, do a work-around and second, upgrade our prism version.  Check the time. Check the expected finish date for my story. After seconds of mauling it over :-) , I decided to do the latter. For just 1 reason: the longer we wait to upgrade our stuff, the harder and difficult it is to make an upgrade.

We have currently 9 solutions that are being integrated. To make my life a little bit easier I used NUGET for installing the latest Prism.

(more…)

Share

November 21, 2011

Techmasters.Benefits();

by maridob — Categories: Random Thoughts — Tags: , , Leave a comment

The sole reason why I joined Techmasters (TM) couple years ago, because I am not comfortable in public speaking.  Public speaking makes me feel that I want to go to the loo. I mean, I can do it – but there’s always butterfly in my stomach and I must tell you this is happening the whole time of my presentation while holding dozens of index cards. In addition to that, I talked like somebody is chasing me with a gun, because in my head it was an agony and I wanted it to end asap.  In short, the quality of my talk is nada.

(more…)

Share

October 25, 2011

“Lazy”-ness at work

by maridob — Categories: Technology — Tags: , , Leave a comment

We’re having some performance issues with our Application at work. We have this one gigantic business object that just needs help in terms of performance.

One of the improvements that I added is implementing “Lazy Instantiation”. Technically, this is old news and I know I use to do it in a very old-fashioned way, where you have a private backing field, check the null ,you handle your own thread and blah..blah..blah.

Before I started playing with the .Net 4.0 Lazy, let us refresh our memory… what is lazy instantiation?

“ … to defer the creation of a large or resource-intensive object , particularly when such creation might not occur during the lifetime of the program“

The built-in Lazy function in .NET 4.0 has a lot to offer, handles the basic lazy loading up to your threading.

See below for more detailed description or go to this link.

In the code below, you will see that your getter in the Employees property is a lot cleaner than how  we used to do lazy loading.


<pre>internal class Employers
    {
        private readonly Lazy<List<Employee>> mLazyEmployees;

        public Employers()
        {

            mLazyEmployees = new Lazy<List<Employee>>(GetEmployees, LazyThreadSafetyMode.None);

            if (!mLazyEmployees.IsValueCreated)
            {
                Console.WriteLine("-->Employee list is not initialized yet<--");
            }

        }

        public string Name { get; set; }

        public List<Employee> Employees
        {
            get
            {
                return mLazyEmployees.Value;
            }
        }

        public string Description { get; set; }

        private List<Employee> GetEmployees()
        {
            var employees = new List<Employee>();

            for (var i = 0; i < 5; i++)
            {
                var e = new Employee { Name = "Emp"+i.ToString(), JobTitle = "CEO" +i.ToString() , Salary = 10000+i };
                employees.Add(e);
            }

            return employees;

        }

    }</pre>

In main, you will see that even though we created the Employer object right away the “employees” is not created yet – this is the effect of using the Lazy. We are pretty much saying “hey, don’t create me until you really need me at that moment in time”

<pre>        static void Main()
        {
            Console.WriteLine("Calling and initializing Employers; the Employees is not created yet ");
            Console.WriteLine();

            var emp = new Employers
                          {
                              Name = "CrackTheCode LLC",
                              Description = "Team of people that writes the code and make it right the FIRST time."
                          };

            Console.WriteLine();
            Console.WriteLine(emp.Name);
            Console.WriteLine(emp.Description);
            Console.WriteLine("*** Here I want to call my employee list now");
            Console.WriteLine("*** and this will be the only time that you will create the emp.Employees");
            foreach (var ee in emp.Employees)
            {
                Console.WriteLine(ee.Name + "  -  " + ee.JobTitle + "  -  " + ee.Salary.ToString());
            }

            Console.ReadLine();
        }</pre>

Check the output below.

LazyOutput

I know in coding approach, most often than not it’s a preference issue. Reasons why I want to head this way are the following:
- Cleaner look in your getter
- Threading is supported

… why work harder if someone is willing to do the hard part for you? ;-)

Share

August 1, 2011

Custom sorting in 1 line of code

by maridob — Categories: Technology — Tags: , Leave a comment

LINQ rocks! Don’t you think so?

The other day, I had a request from our user to have a special sorting for a certain list. To describe the scenario of what the user wants, I am going to use my shoe collection example (as always :-) )  its like I want my Jimmy Choo to be always on top of my list and after that sort the rest of the records by Name ascending… and I thought, while I am reading the email from our user, the solution that is playing in my head is….

(more…)

Share

July 26, 2011

Are you a jurassic developer?

by maridob — Categories: Technology — Tags: , , , Leave a comment

I’ve been working with Anonymous and LAMBDA quite a bit and last week something bit me, an access modified closure

(more…)

Share

June 24, 2011

IEqualityComparer, my bad guy…

by maridob — Categories: Technology — Tags: , , , , Leave a comment

.. from time to time and yes I’ve been bitten once  again by the IEqualityComparer.

I’ve been coding away and as when I am about to test it and be happy with the  whole thing, of course its not working; it’s the idea of it should be working …”in theory”.

(more…)

Share

June 5, 2011

Are you late in your meeting?

by maridob — Categories: Random Thoughts — Tags: , , , Leave a comment

… so am I!

I hate being late and lately, I am doing that. I don’t the like the fact that I am the last person getting into the conference room and everybody is waiting for me. I value everyone’s time but  whenever I am so focused with what I am doing (I think all developers do) and I am in the world of 1 and 0, I tend to have selective eyesight whereas the blinking orange Outlook in my taskbar does not exists anymore.

…so my solution:

(more…)

Share

May 25, 2011

Binding MaxLength using IValueConverter in CSLA.Net

by maridob — Categories: Technology — Tags: , , , , , , Leave a comment

Every developer wants free maintenance code and this is how this solution came about.

Isn’t that a nice intro? but honestly a teammate of mine came from TechEd Conference and came home with this idea. Saw me looking at our story board, and thought it would be fun for me to work on it… and you can also include the above intro as one of the reasons. :-)

In the project that I am working on, we tend to hard code the maxlength of the string in our textbox (I know, I know… don’t cringe!?). We do this to automatically avoid the mistake of entering longer string length than what the application can support.

        <TextBox Grid.Column="1"
                 Grid.Row="0"
                 Text="{Binding Path=BusinessObject.Shoe.Name, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}"
                 SpellCheck.IsEnabled="True"
                 MaxLength="100"/>

The above code is working just fine; it’s the law of keeping it simple. The problem begins when you have to change the maximum length you allow in your property. In our case, I have to remember to change it in 3 places: database, business object and view. I will not say it’s a hard job but it can get complicated as soon as your project gets bigger and your business object is used in different views.

(more…)

Share

May 15, 2011

Code Analysis VS ReSharper

by maridob — Categories: Technology — Tags: , , , Leave a comment
Thinking Face

I’ve been asked few months ago to research about Visual Studio Code Analysis VS ReSharper. I’ve been using Code Analysis ever since it got integrated with Visual Studio, while with ReSharper I would say for couple of months now and I can say that I enjoy using it, although it messes up my entire shortcut keys (eventually I figured out how to behave it the way I want it). I’ve heard ReSharper many times from the user group, conference etc.. grapevine but I thought people are just using it for the sake of being cool :-) .

So, what are the differences? If I will probably ask my dad he would say, spelling? Yeah! My father has a very dry sense of humor :-p . Anyway, if we look at the definition of Code Analysis it says:
“Analyzes managed assemblies and report information about the assemblies, such as violations of the programming and design rules in the MS Framework Design Guidelines”
~ MSDN

While the ReSharper:
“ReSharper brings smart C# code analysis, editing, highlighting and refactoring features to .NET developers. It inspects code continuously.”
~ jetBrains

(more…)

Share

May 15, 2011

Job Opportunities in Twin Cities

I am trying to be a good wife so that is why I am doing this, just an fyi ;-)
The company that my husband (medical device company) is working for is looking for the following positions here in Twin Cities and you can also see the description below. If you are interested email him at pmd@grason-stadler.com

1 Sr Software Developer
1 System Test Engineer
1 Software Intern

 
(more…)

Share
© 2012 Maria.Blog.Shared All rights reserved - Wallow theme v0.46.4 by ([][]) TwoBeers - Powered by WordPress - Have fun!