Generating a New Type using Refactoring

Hi Friends,

Today, i would like to introduce one quick and very useful technique to generate a new type. Basically, Types here am referring for classes. Many a time, when you are coding, you need to feed data to some service, so rather passing the same as individual parameters, we usually prefer via model.

Let me give a brief demo on the same. Now, below am accepting few parameters from the webpage in old school style.

1st

Now, rather doing this, we can wrap the same in one class and then expose the same. So, here i’ll use the re-factoring technique to create my class as shown below.

2nd

Then, specify the parameters as shown below

3rd

 

4th

Now, in that class you can go ahead and specify these properties as shown below.

5th

So,  now when you run and check, it will produce the same thing but in a more structured pattern.

6th

That’s it for now. Till then stay tuned and happy coding.

Thanks,
Rahul

977 total views, no views today

My New Dev box

Hi Friends,

I would just like to share my new Dev Box, multicore processor. So, basically i have 3 big systems designated for development. All these boxes are of different resolution and different processor, highest configuration being is I7 processor, 16 GB RAM, 500HDD. simply fast enough accommodate to tackle 5 projects @ time.

Dev_Box

am loving it.

Thanks,
Rahul
Happy Coding

1,334 total views, no views today