Search Results

Search found 4 results on 1 pages for 'nullorempty'.

Page 1/1 | 1 

  • Relationship between Repository and Unit of Work

    - by NullOrEmpty
    I am going to implement a repository, and I would like to use the UOW pattern since the consumer of the repository could do several operations, and I want to commit them at once. After read several articles about the matter, I still don't get how to relate this two elements, depending on the article it is being done in a way u other. Sometimes the UOW is something internal to the repository: public class Repository { UnitOfWork _uow; public Repository() { _uow = IoC.Get<UnitOfWork>(); } public void Save(Entity e) { _uow.Track(e); } public void SubmittChanges() { SaveInStorage(_uow.GetChanges()); } } And sometimes it is external: public class Repository { public void Save(Entity e, UnitOfWork uow) { uow.Track(e); } public void SubmittChanges(UnitOfWork uow) { SaveInStorage(uow.GetChanges()); } } Other times, is the UOW whom references the Repository public class UnitOfWork { Repository _repository; public UnitOfWork(Repository repository) { _repository = repository; } public void Save(Entity e) { this.Track(e); } public void SubmittChanges() { _repository.Save(this.GetChanges()); } } How are these two elements related? UOW tracks the elements that needs be changed, and repository contains the logic to persist those changes, but... who call who? Does the last make more sense? Also, who manages the connection? If several operations have to be done in the repository, I think using the same connection and even transaction is more sound, so maybe put the connection object inside the UOW and this one inside the repository makes sense as well. Cheers

    Read the article

  • How do you plan your asynchronous code?

    - by NullOrEmpty
    I created a library that is a invoker for a web service somewhere else. The library exposes asynchronous methods, since web service calls are a good candidate for that matter. At the beginning everything was just fine, I had methods with easy to understand operations in a CRUD fashion, since the library is a kind of repository. But then business logic started to become complex, and some of the procedures involves the chaining of many of these asynchronous operations, sometimes with different paths depending on the result value, etc.. etc.. Suddenly, everything is very messy, to stop the execution in a break point it is not very helpful, to find out what is going on or where in the process timeline have you stopped become a pain... Development becomes less quick, less agile, and to catch those bugs that happens once in a 1000 times becomes a hell. From the technical point, a repository that exposes asynchronous methods looked like a good idea, because some persistence layers could have delays, and you can use the async approach to do the most of your hardware. But from the functional point of view, things became very complex, and considering those procedures where a dozen of different calls were needed... I don't know the real value of the improvement. After read about TPL for a while, it looked like a good idea for managing tasks, but in the moment you have to combine them and start to reuse existing functionality, things become very messy. I have had a good experience using it for very concrete scenarios, but bad experience using them broadly. How do you work asynchronously? Do you use it always? Or just for long running processes? Thanks.

    Read the article

  • Stream video from a computer to a tablet

    - by NullOrEmpty
    I would like to watch presentations and college videos I have on my computer, from my tablet. There are almost a hundred of GB in videos, so I would like to watch them in streaming from my computer. My wife has also tons of videos so I have decided to do a kind of streaming local service to watch the videos from our tablets. I have found an article about how to do it with Internet Information Server, but the article is relaying in an application that is not free (Expression Encoder). Since this is for home fun, I am not willing to pay, so I would like to ask for some free encoder that can do the trick. I have no idea about streaming. Actually, I tried to hang the files directly on IIS, and the browser tried first to download some of them and some other (mp4?) got played badly, so I could not get a smooth video experience. What is missing? What is the deal with H.264 ? Can I roll with VC-1 and play videos in my Android tablet with streaming with an acceptable quality through my WLAN home network? Any better solution? Thanks.

    Read the article

  • Windows 7 x64 cannot kill Skype

    - by NullOrEmpty
    Skype got stuck, and Windows was unable to kill the process even when the UI had disappeared. I had to restart the computer to get Skype again working. Running as administrator: C:\Windows\system32>tasklist | find "Skype" Skype.exe 2708 Console 1 92,328 K C:\Windows\system32>taskkill.exe /pid 2708 /F /T SUCCESS: The process with PID 2708 has been terminated. C:\Windows\system32>tasklist | find "Skype" Skype.exe 2708 Console 1 92,328 K How can this be even possible? Cheers.

    Read the article

1