New answers tagged

0

It is not entirely clear to me what you want to achieve, but to me it sounds like basic text search. If you are saving the message in the database I would imagine it looks something like (id, chatId, senderId, text). I would then do the following query: SELECT * FROM messages WHERE chatId = :chatId AND senderId = :senderId AND text LIKE '%' || :query ...


0

I guess what you are looking for is the repository pattern. The idea is to implement any persistence-related methods not inside the domain object, or some god-class-like "datastore" object, but inside repository objects, which are structured in a 1:1 manner to your domain entities. Repositories can be seen as a layer between your domain objects and ...


1

I would use a message queue, but pre-apply the search. So in your example you could have queue per device, this allows the worker to pull only from selected devices. I found this article on the problem https://derickbailey.com/2015/07/22/airport-baggage-claims-selective-consumers-and-rabbitmq-anti-patterns/


1

It depends on how things are structured. It's possible to have a persistence layer with 1k methods and have a client that uses them all. It may not use them all equally, but that isn't relevant. That is just fine as far as the ISP is concerned. Generally as applications grow, interfaces are split into multiple interfaces based on different business objects ...


0

There are excellent answers here, but I'm not certain that they have captured the breadth of the original question. It seems the original question is purposefully open not to limit the answers and invite broad exposition. For example, how to project the inheritance relations of structured data to tabular form is still a controversial topic with no one-size-...


3

A data structure is not an object. It has nothing to do with object-orientation and you shouldn't think of it as an object either. I know what you mean though, you can sort-of write it down with an object-like syntax. Have a class with "properties", a bean, a DTO, whatever. And to be fair, a lot of developers do exactly that. However, object-like ...


2

You're asking about a mental image, which is inherently subjective. You're also conflating two different visualisations. A class is equivalent to a table structure (not data!), and a class instance is equivalent to table data. I think this is leading to you comparing apples and oranges here. You're very visually inclined here about the tabular example. In ...


0

Use to the abstraction that's most intuitive to reason about in the domain, and use something different at the edges where the abstraction fails to scale. In my experience, for my particular needs, classes and objects are easy to reason about, easy to work with, and do a lot to organize business rules. But, with enough data, some questions are most ...


Top 50 recent answers are included