Tag Info

Hot answers tagged

32

Databases are not very good at information hiding, which is quite plausible, because their job is to actually expose information. But this makes them a lousy tool when it comes to encapsulation. Why do you want encapsulation? Scenario: you tie a couple of components to an RDBMS directly, and you see one particular component becoming a performance ...


26

What is more important and significant about a microservice: its API or its database schema? The API, because that is its contract with the rest of the world. The database schema is simply a convenient way of storing the data managed by the service, hopefully organised in a way that optimises the microservice´s performance. The development team should be ...


12

Microservice Architecture is hard to describe but the best way to think about it is a marriage between Component Oriented Architecture and Service Oriented Architecture. Software as a suite is composed of many small business components with a very specific business domain responsibility. Their interface to the outside world either in provided services or ...


6

As you can't control when the mobile apps will be updated to a new release, you need to version at least your REST API. If you don't it will be impossible to make backwards-incompatible changes to that interface. Besides the REST API, it is a good idea to version also the other communication interfaces that go over a network interface. That way, you are ...


5

I believe you misunderstood the recommendations for logging. The 12 Factor site states A twelve-factor app never concerns itself with routing or storage of its output stream. It should not attempt to write to or manage logfiles. Instead, each running process writes its event stream, unbuffered, to stdout. During local development, the developer will ...


5

I'm not sure that I see what "huge impact on the database" a process would have that polled the database every 5 minutes. Presumably, you have some sort of table that stores your meetings and their start times. It should be relatively easy to index the column that stores the start time and to write a query that looks for all the meetings set to start ...


4

I would take an approach that shared libraries are the responsibly of the core, and that modules can be updated however they want on an individual basis except when that requires an update to a shared library. Additionally, I would track versions of the libraries by keeping a single version number for the core platform which is incremented at each release, ...


4

The key in understanding MVC lies in the separation of the responsibilities, as MVC is simply SRP applied to UI code. It separates what data has to be displayed, from how to display it, from how to handle screen events. But an important (and often missed) detail of the original definition of MVC is that it was designed for a far more granular level. For ...


3

50 applications in 6 weeks sounds enormously ambitious. You need to tell your new CTO that this is only a lightweight review; there's no way you're going to detect bugs or security flaws in this time. I'm mostly familiar with code review for security, and the rule of thumb I use is 10 KLOC per day - and even that is ambitious, and can only be achieved by ...


3

This post makes an interesting point about your question. In a more practical way, if you have 3 components: 2 Consumers: a Front-End and a Mobile App 1 API provider: a Back-End You could use the typical M.m.p (Major.minor.patch) versioning scheme for each but, on your Back-End url you could put something as http://youhost/M.m/resourceURI. As you ...


3

It looks like you are confusing your underlying model objects with your API resources, they are not necessarily mutually exclusive. If you are simply serializing your classes as JSON, you going to duplicate content (and get the profile appearing several times) which is not needed and a smell. You could: Create specific resource models that represent your ...


3

You don't have to change existing code, because you can just add more event handlers. JavaScript naturally supports multiple event handlers on a single element, and it's even easier with libs/frameworks like jQuery: // in existing code: $('#button').on('click', function (event) { console.log('normal behavior'); }); // somewhere else: ...


3

Yes, there are drawbacks Code that is easy to read is good, but also beware of what the code communicates as well. When an object's methods always return the object, it communicates a couple of things: I require advanced configuration that isn't necessarily obvious in which order things should be set or configured Each subsequent method call builds on the ...


3

Depending on the number of fields, you might find it easier to use the Builder pattern to combine these changes than to create a separate constructor for each possible set of changes. It does requiring one object that is not going to be used (returned), but you can use one builder instance for as many books as you need to change. public final class Book { ...


2

I will try to answer with the info you gave me. You wrote I need to: detect new Authors, so I can insert them detect removed Authors, so I can remove them assume everything else is updated. So I think that your aproach is too CRUD for DDD and aggregate roots. My 2 cents your business method is something like Update(Book) and the ...


2

If authors are Value Objects, you can easily re-create the whole list each time because only their value matters, you don't have to relate them to identified objects. This might be at the cost of losing business intent though, since you don't capture what the user precisely wants to do. If they are Entities, I suggest sending granular commands to Book -- ...


2

The presence of a service layer does not necessarily imply the model is anemic. A service layer might provide a simplified facade to a complex domain model. I.e. a business user may just want to create a new poll. The UI is simplified if it speaks in those terms and the service layer would translate from what the UI understands into operations leveraging the ...


2

As long as you are the only vendor for all "plugins", and as long the invidual modules don't need hundreds of MB disk space, I suggest you put always all DLLs into every released package, and treat everything as one product, with one version number. This makes deployment easier, since you don't need separate packages for partial updates, and if you need a ...


2

One useful pattern is to define a public interface which can report all of the properties associated with the class, as well as a package-private interface which extends it with a few additional members. A package-private version of the class should be mutable, but the public-facing one should be immutable. The public-facing class should hold a reference ...


2

We have a cluster-environment too. We use Hazelcast for such jobs. With Hazelcast you could embed the codeblock for updating within a "Hazelcast-Lock-Section". It is not my favourite solution, but this is how it is done in our application (and maybe suits hazelcast your needs). I opt for a smaller and easier solution: I would write a small (buzzword-alarm: ...


2

Typically a Service Bus is used for routing and connectivity. I would use a Service Bus where I need to have multiple changing subscribers to a particular service, or routing of messages changed depending on some event etc. In your example, where it is literally a point to point connection, then a Service Bus is not really going to be relevant. What might ...


2

The author makes the distinction between what is in the "board game" or not with the following example: eBay the website and eBay the board game both need buyers, sellers, items, and bids – but only eBay the website needs users, sessions, cookies, login/logout etc. See how he mentions "buyers" and "sellers"? These are just different names for "users", ...


2

expose the existing complex data model without introducing DTO classes One major flaw of this approach is that of coupling data access layer with API. It can go very bad very quickly if those models are used elsewhere except API. I currently work on a project where both web interface and JSON API (kind of REST, but not quite) use the same Hibernate ...


2

Your problem has striking parallels to functional programming: Monads, Functors, and composing functions. Your composability requirements essentially states that each operation must be a function that takes a stream and returns a stream: operation : Stream -> Stream Most functions will not be expressed in terms of whole streams but rather single frames ...


1

... intuitive for developers to use, so the code itself explains and forces developers to use it in certain way... It's a myth that OO bits can be intuitive unless they are trivial. like the most fundamental framework elements. LOB objects are the opposite of that. They need good documentation and examples demonstrating all the functionality you'd hope ...


1

I recommend you install a continuous integration server, hook it up to your code repository and a snapshot/release repository and automate your builds. This will have a number of advantages: Every component will be versioned when it is released. This includes low-level libraries as well as your final products. Every code commit will trigger a snapshot ...


1

First, I'm lets start off by framing the problem a little differently. You've asked which pieces of software you need to "version". Version is an overloaded term in CS, and could mean about 100 different things. The primary things I would look at is: Version Control - Version control is a configuration management tool that helps you keep track of snapshots ...


1

Using a messaging broker seems like the best tool to inform other applications that they should update rather than polling (which is fine really too). http://www.rabbitmq.com/ Locking the database table for writing is what you want to prevent race conditions.


1

There's a risk that the second approach leads to a Fat Controller, which is often considered an antipattern. It's effectively a violation of "clean architecture" (as by Uncle Bob Martin) since your controller is now not only a "delivery mechanism" but also deals with applicative transactions/use cases, orchestrating calls to the repositories and services and ...


1

Here's a twist on Matt's answer, using the builder pattern combined with Java 8's new functional capabilities: Book.java import java.util.*; import java.util.function.Consumer; public class Book { private String title; private List<String> authors; private int year; public Book(String title, List<String> authors, int year) { ...



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