Tag Info

New answers tagged

0

Meet BoxPong, a very simple game I made to get acquainted with object-oriented game development. Making BoxPong helped me formulate, among other things, a fundamental question: how can I have objects that interact with each other without having to "belong" to each other? I have quite a bit of experience writing code for the SNES, where you have ...


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. ...


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 ...


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.


0

As I was clearing up the description, a potential third option (Redesigned java class) dawned on me. So I am going to investigate it further as it looks promising with no model impact. Let me know if this is not a good option based on the use case and if you see any issues with it.


0

It depends on what you intend to do with the content of the files. If you ever need to make queries based on the content of the sheets (and I am pretty sure you will have to), I really think you should consider the table solution. I think there are some ways to improve your performance issues (batch insert...).


0

Perhaps consider a hybrid approach. Fetching and storing documents is the purview of document-centric or "NoSQL" databases. Perhaps store the actual spreadsheets in (e.g.) Cassandra and keep your metadata (and copies of any working data, if you only really care about a subset of the data in the spreadsheet) in Oracle. As to your memory pressure in Tomcat, ...


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, ...


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 ...


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

You might be able to model this using a workflow engine. You can model each of your stage as a workflow step and also parameterize each step. Depending on the engine chosen, manual action can be configured against each step. The following post might help you decide if it is relevant to your use case: ...


0

You can have a common BLL component, exposed as a web service quite happily. Simply expose 2 interfaces on the WCF side of things that are implemented by the same methods in the BLL. Both thick clients and the MVC website will make calls to this common WCF webservice, but each using a different interface. So you have a Website only web service the web site ...


0

The key issue here is, how is business logic invoked transparently when a REST call is made? This is a problem that is not directly addressed by REST. I have solved this by creating my own data management layer over a persistence provider such as JPA. Using a meta model with custom annotations, we can invoke the appropriate business logic when the entity ...


-2

I know it's an oldish question, but check out ReactiveX if you haven't already. I discovered it recently, and it's really changed how I see designs like these. It's basically a combination of type-safe observables, event-based push (sync or async), and classic pipes-and-filters. http://reactivex.io/ You just write little components and snap them together ...


0

As mentioned by Pelican, you are taking the right approach in terms of tailoring your viewmodels to your views. That said, you can still abstract some functionality out for reuse. For example, you might have use for paging lists in multiple views. In that case, create a generic model that can be reused in multiple viewmodels. If you find you require more ...


0

Being a mobile developer myself, the worst thing is offline access. You simply force users to be online which should work in a lot of apps, but not in all. The other great bad aspect is slowness. Time needed to parse remote data can take significant time. Yes, you can pre-fetch data during the load time, but in all other cases you cannot avoid slowness. ...


0

I would recommend implementing Single Sign On (SSO), for example with LDAP. Your larger customers probably would have benefited from it as well, as they would be able to replace your built in auth app with their own existing user database. For your smaller customers that don't support SSO, you can simplify deployment by shipping your app with a default auth ...


0

It's hard to answer. Both approaches seem valid. most of the arguments seem weak. And you can make both of the architectures mimic the other's intended interface. I'm mostly a ""server side"" developer, and i pretty much prefer the first (FE) approach, just because it'll give me more control, and i could offer the client a simple clear interface with less ...


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. ...


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 ...


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 ...


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. ...


0

I think your options are somewhat defined by the OS you are deploying to I would suggest, yes put the values in source control. BUT only the 'dev' versions. You want your source code to compile AND work! not include extra secret steps Your build and deploy process should then swap these values out per environment during deployment. (octopus has this kind ...


0

The answer i've seen most often is to add : public object MetaData To the class. Obviously this provides plenty of flexibility, but no type saftey. Another option would be to add a GUID Id to all 'entity' style classes. This would allow consuming classes to implement thier own store of metadata keyed off the Id


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 ...


0

Since users will be somehow authenticated during usage, you could "flag" trial accounts status and keep track of their activity: User A logs in. User A performs an action against the service A combination of the user ID + timestamp is tracked Check the earliest timestamp associated with the same user ID IF the check passes (the earliest and the current are ...


0

You are correct in that you cant ensure logout with a web application, where you essentially download a client program and then make intermittent requests for data the server. There are a few work arounds for this problem that I know of 1: define 'logged out' as automatically occurring after a period of inactivity This may not be best for you with such ...


-1

I suppose that with this number of users it is not hosting but dedicated servers where you can install everything you need to your service. If it is right my suggestion is to use some external storage like Redis where login token (or other user identifier that passed from client to server) will be the key and value is all data you want to know about the user ...


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 -> ...


0

I think it would be rare in practice to actually have the option. The decision will likely be made for you simply by the requirements of the application. The semantics of your two examples are very different. It's a typical by-value or by-reference decision. I think you just need to ask Content myContent; myContent.Value = "Some content"; Node myNode; ...


0

I don't think each layer should have their own entity classes. Doing this would multiply number of classes and raise complexity without any real benefit. Sometimes one concept from service layer doesn't map well to relational DB (or other persistence technology) so it's sensible to create different entity classes, but mostly it's not necessary and you can ...


0

They probably 'Should' however I recommend not. Map your data layer directly to your model in a Repository, use ViewModels in the controller layer, but just wrap your Models and add extra data where required instead of duplicating them. This Sounds fishy to me. Probably a sign that you need another Model It shouldn't be complicated. I recommend NOT writing ...


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 ...


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 ...


0

The speed of downloading and uploading small files can easily be circumvented by putting several files into an archive (eventually with level 0 compression if files don't need to be compressed, which is the case for example for JPEG files). If the user uploads hundreds of files, this will result in two-three large files. If the user needs to upload only one ...


0

The policies you're citing concern themselves primarily with what has responsibility for maintaining the cache and deciding when and how to read data from the main memory. In Cache Aside, the application assumes the responsibility. The application will look at the cache and see if it has the data it needs. If the cache doesn't contain the required data, ...


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. ...


0

The answer depends on some assumptions not described in the question: 1. You don't have the liberty to change the vendor or internal API 2. The grouping has to be performed in a single transaction. i.e., how strict should the API be against vendor API failures. What happens if 1 vendor fails and the rest succeeds. Do we still consider this a success or ...


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 ...


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 ...



Top 50 recent answers are included