Tag Info

New answers tagged

2

I've found the following picture a good key for the difference between different measures (although undirected graphs are depicted, some apply to directed as well). Degree centrality [D] is straightforward: who has most in/out links. Eigenvector-centrality [C] captures the notion of indirect influence better. See Centrality on wikipedia for the definitions ...


1

I am trying to understand how to design classes which take an input, do some processing, and return a result. There is a principle in object orientated design called "Tell, don't ask" What this generally means is you tell an object to change itself, you don't ask an object for data that you then manipulate some where else. So when thinking about how ...


0

If removeHeaderFooterText is an atomic operation, then the solution is simple. Your class for implementing the algorithm will have one public entry point. In pseudo code, it would look something like this: class HeaderFooterFilter { public removeHeaderFooterText(pages); }; No caller should ever be concerned with how removeHeaderFooterText works. All ...


3

Before discussion, notice that When given a business use case, object-oriented programmers can usually arrive at some consensus about how the surface design (the partitioning of responsibilities between classes, and the publicly accessible methods and properties of these classes) should look like. On the other hand, when given an algorithm, ...


2

There is nothing wrong with writing pure functions as statics in object oriented programming. Given your example, it does not appear necessary to make instance fields out of the intermediate results. However, you should be prepared to refactor when and if necessary, into a real object. Several reasons you may need to do that are: You choose to define ...


0

This is a perfect example for an use of interface, or if you may, a public API. Within your Book domain, you are dependant on an implementation of IBookRepositoy, to whom you will interact with via it's public API (its public methods). Now you just need to follow the Single Responsibility Principle and Separation of Concerns in order to achieve a good ...



Top 50 recent answers are included