Tag Info

Hot answers tagged

7

I'm going to have to make a couple of guesses here You mention EF so I'm guess the mocks in question are related to the datalayer? Since you are using EF, I guess your Repository presents an IQueryable and your Models construct queries within themselves? This would lead to you then having to craft you mock with data which is consistent with the various ...


4

The challenge is how should this information be stored efficiently in an RDBMS? The question should be why should this information be stored in a RDBMS at all? What are you going to do with it once it's there? If all you're going to do is "save" a spreadsheet into the database and then pull it back out again, then I'd suggest you're wasting your ...


4

Is consistency important? If you consider saving data in SQL, why not go with SQL all the way? Anyways... aggregate functions like count is not a feature of Table Storage, so you either need to fetch all rows and count "client side" (can be very slow), or figure out a way to cache the "count" in another entity. It really depends on your data and ...


4

In general, it turns out very badly if objects of the same level know about each other. Once objects know about each other they are tied, or coupled to each other. This makes them hard to change, hard to test, hard to maintain. It works out much better if there is some object "above" that knows about the two and can set the interactions between them. The ...


4

You need to understand that DDD is not about primary keys, rows or tables - these are just means to implement it. Aggregate root is usually implemented as a class, because you are expected to access all the functionality and data of the aggregate through the root. It therefore needs to have some behavior, something which primary key of the table can't have. ...


4

If you have 4 independant services, then they have to independant. No data should be shared in common DBs or similar, as then you simply make them dependant! Now while its OK to share a single DB in production, the services should use their own schemas as to DB is just there as a common container, similar to how a single Linux server can run all 4 services. ...


3

To reflect the changed state of an object (I will call this object now and reference with this to the OOP paradigm) you can return this object again which in itself is immutable again, e.g. playerOne = doSomeMove(playerOne) Basically this is the idea behind the state pattern. With this the single object is immutable but your changes are reflected by ...


2

This sort of problem is well-suited to dynamic typing. That will give you the most straightforward solution, with the obvious trade offs. If you wish to use static typing, you'll have better luck if you don't centralize your pipeline construction. Your stages are the ones who know the most about the types of their dependencies and results, so you should ...


2

If Employee is an aggregate root, it means that all the outside objects can reference only the Employee (and not the ActiveEmployee/InactiveEmployee). Any references from outside the aggregate should only go to the aggregate root. DDD aggregate by Martin Fowler I don't think that's your intent. I think ActiveEmployee and InactiveEmployee are both ...


2

Yes, the big question is what do you want to do with these excel documents once they're in the DB. You can store them as BLOBS quite happily, but then you can store them as files on the filesystem too, and the latter allows you to manipulate the documents in various ways (eg running code to change them). If you're just storing them for later retrieval, ...


2

Your example is a bit abstract, but let me run through my thoughts. Option A : In my experience this is Always Bad regardless of your reasons. sure DBs like MSSQL can have friend databases etc, but if the data is linked, it should be in the same DB Option B : Not sure whats going on in here, you are adding an API which queries all DBs and brings the ...


1

You shouldn't store a user's login credentials to a third-party service. Instead, reddit provides an oAuth API to acquire access to parts of the website that require user authentication. See: https://www.reddit.com/dev/api/oauth.


1

Very purpose of ViewModel is to covert and display the data in your model to match the view. Simply creating a ViewModel per view would be the best way to handle this.


1

In examining problems and possible solutions, it helps me to use a method popularized by Jeff Atwood: If God were to create a way to store sensitive configuration information, how would he do it? Well, he would know who needs configuration information and only give it to those people, and the information would never be able to be accessed by anyone else. ...


1

Possibly there is no one good answer to this. It seems that you need to store this data somewhere safe, as it will be needed for disaster recovery purposes one day. This applies equally to properties files and scripts that set environment variables. With the source code (in SVN/GIT etc) is a really bad idea, as this data will contain production database ...


1

First MVC has 3 layers. Model, View, and Controller. Trying to Make BLL or n-Teir Layers fit is not going to work very well. M - Model, this is where you "access and store" your data. V - View, This is where you render, or represent your data. C - Controller, This is the glue that lets views tell your models how/what to render via views. In a modern web ...


1

I assume by REST you mean a Web Api of some sort? this should be an alternative UI layer ie DAL -> Repo -> Model/Services -> MVC app OR -> Web.API OR -> Windows app OR --> Mobile App etc Alternatively you can expose the repository as an API layer (although you'll have to consider security) DAL -> Repo -> RepoService API -> RepoClient -> ...


1

I agree that web app must be the only one accessing mysql. So web app must inevitably provide some sort of api that let your public web api access relevant data. This API is a contract between web app and mysql that allow them to be developed separately without breaking. The complexity and flexibility of this API must reflect your business needs but keep ...


1

Assuming that you're already in this situation: Store form config in a DB and reference the version number, rather than serialize it to Json over and over again. Don't use conditionals, just have completely separate html/js pairs and backend end points. You might have to do some internal rewrite if you want to have the forms appear under a single url. ...


1

At the topmost level, you can use a fold to feed the output of the last step into the input of the next step without having to give it an intermediate name that gets reassigned. Basically, at each step you create a whole new scope. This part is a lot easier with functional reactive programming or actors. Below that level, the key insight is because of ...



Only top voted, non community-wiki answers of a minimum length are eligible