Tag Info

New answers tagged

0

You will want to store the users data locally. And as people come online they broadcast their information. If the local client needs to update your friends profile information it can do so then. As for storing the information locally here are a two options: text file although not generally recommended for normal production deployment but does work for ...


4

It's pretty common to store stuff you want in a database, on a client, in something like sqlite. It's a database that is pretty lite, and very common for desktop apps.


1

Creating a separate class per service method is a bit of overkill, but it absolutely makes sense to have different classes for unrelated methods. So you can have the UserService class to add, update, delete, reset password, or whatever and a FooService to handle all the stuff related to Foo. Ideally you should have a separate class library project where all ...


1

If your only goal is to reduce maintenance efforts, I suggest instead of making such a major architectural change to your service, add some tools which allow you to manage the four instances "as one". For example: starting and stopping of all four instances at once: can be accomplished by start and stop scripts backing up any data written by your services: ...


0

It is hard to say what you'd need to do internally within your service to make this work but what you are building here is effectively a multi-tenant operation inside your service. You are adding an account name parameter that needs to somehow map to an instruction as to which database to use. It actually is pretty straightforward if you've got good ...


0

Windows service is just a host for your application. I may choose to write an application and host it in IIS process, or windows service, or console application, or WPF application. Point I'm making is that it does not matter if it's a windows service or not. Your windows service can host an application that in turn queries multiple databases. It's just ...


0

Microsoft has written and published a very good set of Cmdlet Development Guidelines Excerpt: The topics in this section provide development guidelines that you can use to produce well-formed cmdlets. By leveraging the common functionality provided by the Windows PowerShell runtime and by following these guidelines, you can develop robust cmdlets with ...


2

Identifying the pattern. This pattern is actually pretty smart. In fact it's so useful that Microsoft has written a considerable and well liked library called Reactive Extensions to solve this using a technique called functional reactive programming. The pattern you're trying to name is called an Observable. It generalizes an IEnumerable fundamentally. You ...


1

The biggest change is that the web front end (the part that runs in the browser) has gotten more sophisticated. There are many frameworks that provide enriched functionality at the client; Angular is just one of them. You can look here to find out more about what frameworks are available and what functionality they provide. There is the notion of a Single ...


0

This is a tricky question :) If I really have to choose from only this two options, I would choose A for the simpler form of your task and B for the extended. That is because events does not really make sense until you are calling exactly one function. The primary responsibility of your nodes is to filter the data that they receive. Still when you change ...


0

Have you asked yourself, if the classes do really have the same intent? If one class is more generic than the other, then it will be a GenericClass, a MoreGenericClass and a MostGenericClass. Imagine that each type parameter of a class adds a new dimension to the class, so it may help to ask what dimension it is. Lets take this example: ...


0

In a single application references are easier. Above all, they will allow you to process data asynchronously. If your nodes can be located in different applications (even in different computers) you'll need an event-based pattern like Message Queue. This pattern can be implemented with help of .NET events in each single application. So, if you don't plan ...


2

When you are working with multiple teams on multiple projects, you always had and will have most (if not all) of your troubles relating to interfacing between these projects. You can call it project/library/microservice/etc. - it's always the same as you describe. One team makes breaking changes, the other team(s) suffer. As this problem is quite ...


4

In the case of Tuple and Action that Pete has mentioned, Microsoft themselves use a single file - see Tuple.cs and Action.cs. I think it partly depends on whether or not the functionality for all the classes is basically the same. Personally I dislike lumping classes into a single file, but this might be an exception. In the source code where I work I added ...


11

MyGenericClass`1.cs MyGenericClass`2.cs MyGenericClass`3.cs And so on, where the number after the backtick is the number of generic type parameters. This convention is used by Microsoft. Alternatively, you can use something like MyGenericCollectionClass[TKey, TValue].cs which preserves not only the number of generic type parameters, but also their ...


4

It depends on the layering of the design. If "nodes" are all in the same layer conceptually, then I would prefer references over events, especially read-only references. References are simpler and easier to trace with static analysis tools: References can be read-only fields, whereas event fields are always mutable. A reference field refers to a single ...


1

Use a layered architecture. Place each project in a layer, where each project is dependent only on lower layer projects, so no lower layer project depends on a higher layer project. Without layers, the dependencies become unmanageable as the number of projects multiplies. Once your architecture is layers, you test the lowest layers first, then the layer ...


4

Using Win API, you can support long paths in your application: [PathTooLongException]: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. For more information about using long paths in .NET applications, see this blog series: ...


6

When using .NET (particularly recent versions of .NET), a good guideline is to always use the built-in .NET functionality until and unless there is a marked benefit to doing otherwise. In other words: assume .NET is the right way to get the job done until you strongly suspect (or know) that it isn't. Nine times out of ten, the Framework (having been used so ...


3

So, I'm not sure if what I'm about to tell you is still correct but according to Mark Seeman in his book "Dependency Injection in .NET" he states that: Although the correct usage pattern concerning ADO.NET connections should be common knowledge, it's far less known that the same is true for WCF Clients. They should be closed as soon as we're finished ...


1

In order for unit tests to work you have to be able to mock all the external dependencies to your code (otherwise you're doing an integration test). Your problem is you have direct dependencies to your data access implementations. This is coupled with the problem that your handler is both doing it's handling work and is responsible for creating your data ...


1

There is not such thing as only enterprise web application. In the enterprise world you typically have a full enterprise system, where the web part is pretty small compared to the whole system. There are many systems underneath the web that perform batch processing, queue messaging, enterprise integration, gateways and many more. Event at the top there might ...


5

If you expect certain exceptions to be handled at the top level of the program (or close to it), create a specific exception class for them so you can identify them. That way you don't accidentally catch exceptions that arise from program bugs or unrecoverable errors (e.g. out of memory). I don't know the purpose of ApplicationException but Microsoft's ...


0

I would definitely argue that there is a flaw in the design if you feel the need to throw exceptions from a property setter or getter. A property is an abstraction that represents something that is just a value. And you should be able to set a value without fearing that doing so could throw an exception.* If setting the property results in a side effect, ...


0

I like this approach to value types. The concept is great, but I have some suggestions/complains about the implementation. Casting: I don't like use of casting in this case. The explicit from-string cast is not a problem, but there is not much difference between (ValidatedName)nameValue and new ValidatedName(nameValue). So it seems kind of unnecessary. The ...


0

Your way is quite heavy and intensive. I typically define domain entities like: public class Institution { private Institution() { } public Institution(int organizationId, string name) { OrganizationId = organizationId; Name = name; ReplicationKey = Guid.NewGuid(); new ...


2

This is fairly common in ML-style languages like Standard ML/OCaml/F#/Haskell where it's much easier to create the wrapper types. It provides you with two benefits: It allows a piece of code to enforce that a string has undergone validation, without having to take care of that validation itself. It allows you to localize the validation code in one place. ...


1

what do you see as being the advantages and disadvantages of using this pattern, and why? Good: It is self contained. Too many validation bits have tendrils reaching into different places. It helps self-documentation. Seeing a method take a ValidatedString makes it much clearer about the semantics of the call. It helps limit validation to one spot ...


1

A DLL is a format used for shared libraries by the Microsoft Windows operating system. Other operating systems use other formats, and since DLLs are binary they cannot generally be used on other processor architectures such as ARM devices. Therefore, DLLs are of no or little use under Mac OS X, on Linux-based operating systems such as Ubuntu, and on mobile ...


4

A .NET DLL contains Intermediate Language which requires the .NET runtime to execute it and probably some .NET base libraries that it uses/depends on. This means that the DLL can only be used on hardware/operating systems that have a matching .NET Framework available. Writing code for all possible platforms is nearly impossible and I would advise you to ...



Top 50 recent answers are included