Hot answers tagged

5

Tests of the kind you describe are brittle. As you've correctly pointed out, small changes are likely to break a significant number of the existing tests. But that is by design; tests like these are meant to break over the smallest change to your code. They are the proverbial "canary in the coal mine," meant to detect breaking changes in your code before ...


4

You basically answer your own question. Strictly following the "clean architecture" dogma leads to "many new classes and boilerplate code (...) this option may do more harm than good." If following some rule or principle leads to worse (more complex, less maintainable) code, then it is a bad principle and should be ignored. Or to be more charitable, the ...


2

I am working with such automated tests since several years, and though we have several hundred of complex XML files in one test suite, they are very well maintainable, even if some of the tests break from time to time. Our team accomplishes this in the following way: We use custom "diff" algorithms to detect differences between different the actual and ...


2

I'm assuming: You want to be able to search through thirty million HTML documents with XPath. The search itself should be relatively fast (say two seconds). You are looking at the way you could pre-process those files and store the processed information in order to be able to perform the actual searches. The first thing you may try is to walk through all ...


2

The problem with different versions of an XML document is that not every change is compatible with previous versions. Coding around that can be difficult. There's a few approaches you can take: Have a separate set of DTO objects depending on the version Use XQuery to read the version attribute so you know which document root to serialize to Major ...


2

Indexing options with PostgreSQL A sequential scan on 30ish million HTML documents should take less than an hour on cheap notebooks this days. Most database servers work with XML. If this performance level is acceptable you can use your preferred database server. But if you need faster queries, you will need to develop a good indexing strategy. PostgreSQL is ...


1

There are a couple of alternatives. First of all, objects should not change just because their data changed. That is just a basic consequence of basic concepts object-orientation. One of which is that objects are defined by behavior, and data is encapsulated under that behavior. You could define your Shape to have the behavior you need, like drawing on a ...


1

Creating classes for different versions (approach 1) doesn't scale that well. If there will be many versions to come, you end up with a class inflation which is never a good thing. And then, what if there will be ShapeV3, that can not be modeled as a subclass of V2, but just of a subclass of V1 or the base class, yet it offers similar features than V2? Then ...


1

Excellent analysis. Writing an object graph is notoriously difficult because it can involve a lot of foreign key lookups and these are hard to implement without incurring a lot of waits. To make a dent in the performance, you need to widen your approach. Few ideas to consider: Blasting all the new data into a temporary table and reconcile with the main ...


1

It might depend on what you are comfortable with, but one way to approach it is to write your own parser with a library for example BS in Python. That would enable a detailed control of exactly what data and information you want to index and full freedom to create your own structure. If you do not want to code anything yourself you can try importing ...


1

But now I want to create a static HTML site that has basically the same content (and structure) as the XML, but with tables, parts that can be collapsed, images and so on. This seems like a basic use case for HTML, CSS stylesheets, and maybe some Javascript. Tables are basic HTML (and are so old that many people regard them as being obsolete), collapsing ...


1

Yes, this is a valid class diagram. UML does not have any restrictions on the number of associations between two classes, no matter the types of the associations. You only specified multiplicities on one side of the association. This means that the multiplicities on the diamond side of the associations are undefined (in old versions of UML, an absent ...


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