Tag Info

Hot answers tagged

11

If you design a system where 20-30 people all have to edit the same class of your codebase on a daily basis, I would say you will have a pretty big organizational issue and a pretty big architectural issue as well with your system. If such a class is a facade or something else is irrelevant. To solve these issues, I would start with splitting the teams to ...


4

Decorators usually augment the original functionality in some way, not replace it altogether. So they need to hold a reference to the original object. For example, a decorator that adds memoization to a function will need to be able to call the original function if its result is not found in the cache. However, the calling code should not need to know if ...


3

You might also look into expert systems, business rule engines, declarative programming, inference engines, A* search algorithm, Rete algorithm, Prolog, Datalog, CLIPS, metaknowledge, metaprogramming, reflection, etc... J.Pitrat's blog has interesting entries, e.g. Know thyself etc... Is there a programming pattern that allows me to make an extendable ...


2

Automated testing Invest your time in automated testing. It will pay you off very quickly. The basic idea is that if you do manual testing only, you'll be unable to handle the ever increasing number of tests. It is not unusual for even a relatively small application to have thousands of tests, not counting integration, system, functional, load and other ...


2

Just think of a decorator as having 2 functions: adds/modifies the functionality of the original class. In order to do so, it needs to have reference to the original class, and therefore need to have composition. look the same as original class to the client. By look the same, I mean from the client's perspective, they will not know and don't need to know ...


1

Should I use DataTable and shove it to gridview just like the rest of my team do? Hell no. That's just bad code. It's ok code for very small uncomplicated projects that are unlikely to change and has a database schema that will rarely if ever change. Or for quick one-off-projects. Otherwise that is bad code practice and it will come back and bite you in ...


1

if any of the methods fails, there is really no point in calling subsequent methods. How should I address those possible method failures? Throw an exception. Should the Carousel class be 'injected' into my class before it is used? Yes, if there is more than one implementation of Carousel (including the possibility of a mock object for unit testing ...


1

Normally, no. The callback is part of the API exposed by layer B. The API of Layer B defines the form (prototype) of the callback, the API of Layer B defines the functions to register and unregister the callback, and Layer B defines the conditions under which the callback will be invoked. Furthermore, since the callback gets registered, it will work even ...


1

Your problem is comparable to a program simulating a chess player. When in need of using a set of knowledge rules to produce the most suitable decisions, the logic programming seems to be the ideal solution. Using such a programming language (like Prolog), you can define the whole set of rules that govern your 'world', and finally you have to create a query ...


1

You can't add stored properties, but you can add computed properties. A computed property can act just like a stored property. In fact ObjC provides a handy set of calls to make that if not actually easy...well, at least not hard. Performance might not be where you want it, but if performance is a big deal let the profiler tell you when you should give up ...



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