dotnetrockz Posted June 18, 2014 Report Posted June 18, 2014 What is dependency injection? In a nutshell, dependency injection is a design pattern where external dependencies are “injected” into components rather than baked in. If that made your eyes glaze over, think about it like this: imagine your friend asked you to drive him to the supermarket: You would probably just hop in your car and take him: But what if your friend asked you to drive him and his 5 friends to the supermarket, but your car only seats 4? You would need a bigger car, right? Well, the good news is that since most cars implement the same interface (steering wheel, accelerator, brakes, etc.), you’re not only capable of driving your own car but many other cars as well. So if you had access to say, your mom’s minivan, you could complete the trip: At the root of it, that’s what dependency injection is all about. Instead of you being stuck having to always use your car for your trips, you will be given the correct car to use based on the circumstances. Bringing this back into software terminology, in the analogy above you (the driver) are a class and the car is your dependency. You depend on the car to drive your friend(s) to the supermarket. It doesn’t matter which car you use, so long as it’s familiar to you. Without dependency injection, the You class might look something like this: 1 2 3 4 5 6 7 8 9 10 11 public class You { private Car myCar = new Car(); public void Drive(IList<Person> passengers, Location destination) { foreach (var passenger in passengers) myCar.AddPassenger(passenger); myCar.Drive(destination); } } view raw gistfile1.cs hosted with ❤ by GitHub Notice how you’ll always be using that particular instance of Car to complete the trip. With dependency injection however, the You class would look something like this: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 public class You { private ICar myCar; public You(ICar car) { myCar = car; } public void Drive(IList<Person> passengers, Location destination) { foreach (var passenger in passengers) myCar.AddPassenger(passenger); myCar.Drive(destination); } }
dotnetrockz Posted June 18, 2014 Report Posted June 18, 2014 even though this is in java....nobody can explain this clearly about DI http://www.sivalabs.in/2012/06/how-i-explained-dependency-injection-to.html
puli_keka Posted June 19, 2014 Report Posted June 19, 2014 first time Parallel.For vaada .. endhi saami intha super undhi.. Parallel.For(0,100,ctr=> {if (Request_chainpl_partnerwcf_net(out response)) //ee method lo I do a HttpWebRequest call for rest webservice { response.Close(); } }); inthaku mundu for loop vaaduthunde parallel.for cheyagane asalu rachu completing 100 webrequests in like 10 seconds.. previously it used to take more than couple of minutes ala.
puli_keka Posted June 19, 2014 Report Posted June 19, 2014 picha pichaga interset vasthundi parallel programming meeda..
karna11 Posted June 19, 2014 Author Report Posted June 19, 2014 first time Parallel.For vaada .. endhi saami intha super undhi.. Parallel.For(0,100,ctr=> {if (Request_chainpl_partnerwcf_net(out response)) //ee method lo I do a HttpWebRequest call for rest webservice { response.Close(); } }); inthaku mundu for loop vaaduthunde parallel.for cheyagane asalu rachu completing 100 webrequests in like 10 seconds.. previously it used to take more than couple of minutes ala. GP. web request lu eppudu trigger avuthundhi? i mean application lo
rachaRimbola Posted June 19, 2014 Report Posted June 19, 2014 Different question bhaiyya. memu MVC5 using. Registration page undhi with a form. Page load aiynappudu. Focus "PostCode" aney textbox ki velthundhi. memu code em focus pedthalemu. this textbox is just like any other textbox on the form . why focus is going to this textbox. How to prevent any focus on the form. Naaku focus ae oddhu asalu. how can we do this?
Mama77 Posted June 19, 2014 Report Posted June 19, 2014 picha pichaga interset vasthundi parallel programming meeda.. more info please
puli_keka Posted June 19, 2014 Report Posted June 19, 2014 GP. web request lu eppudu trigger avuthundhi? i mean application lo Not in dev code. I wanted to generate load.. Oka request ni fiddler lo capture chesi request to code add on undi which generates c# code.. Same request ni oka 100 times for lo petti execute chestha which I changed to parallel.For
puli_keka Posted June 19, 2014 Report Posted June 19, 2014 more info please Multi threading, task parallel library lock semaphore concepts nerchukundam anukuntunna.. Last ki operating systems text book kuda chuduvudam ani fix ayya by galvin gagne
dotnetrockz Posted June 19, 2014 Report Posted June 19, 2014 lets share somethings about testing.....(we'll again get back to our .net concepts) mee firm lo testing ela chestharu.....i mean i saw people talking abt using 3rd party frameworks..like nunit.....but actual ga unit testing ki maname test cases list chesukoni okko case ki set of parameters tho test chesthe saripoada?
puli_keka Posted June 19, 2014 Report Posted June 19, 2014 lets share somethings about testing.....(we'll again get back to our .net concepts) mee firm lo testing ela chestharu.....i mean i saw people talking abt using 3rd party frameworks..like nunit.....but actual ga unit testing ki maname test cases list chesukoni okko case ki set of parameters tho test chesthe saripoada? We use msunit which is part of vs test project.. We create common methods to get data from dB make Webservice call etc. Then we create [TestMethod] s for bvt functional negative path and in every test get parameters use common methods to make call and to Assert Will share more details later
rachaRimbola Posted June 19, 2014 Report Posted June 19, 2014 Naa question ki evari daggaranna answer undha?
dotnetrockz Posted June 19, 2014 Report Posted June 19, 2014 Naa question ki evari daggaranna answer undha? im no expert on mvc but paricularly aa textbox midha focus undhi ante did u check the jquery or javascript code for onload method or did u define any attributes on tghis particular textbox..... is "PostCode" name of that particular txtbox?
Best_Villain Posted June 19, 2014 Report Posted June 19, 2014 Need help .Net 1.1 to 4.0 project migration. So many people advised me to upgrade to 2.0 first then to 4.0 but I just converted the project in VS 2005 and it is giving me 120 errors! Any extra suggestions please.
dotnetrockz Posted June 19, 2014 Report Posted June 19, 2014 Need help .Net 1.1 to 4.0 project migration. So many people advised me to upgrade to 2.0 first then to 4.0 but I just converted the project in VS 2005 and it is giving me 120 errors! Any extra suggestions please. post the errors here...mostly they will be assembly refernce errors or some components which dont work no more in 2.0/4.0
Recommended Posts