Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 29 Nov 2002
Offline Last Active Jan 10 2013 04:51 AM

Topics I've Started

Separating logic/features from data/domain

09 January 2013 - 11:05 AM

Hi all,


my colleagues and I are having a recurring discussion about separation of functionality/logic.

Personally my view (and perhaps I am stuck in this way of thinking) is to separate data/domain and algorithm/functionality. And I notice I'm quite a purist in that.

My colleagues on the other hand tend to put the functionality over multiple classes that I would consider "data"-classes, or domain classes.


More concretely, we are now implementing a user story that aligns images, grouped by date and image series. 

My natural tendency, first reflex, is to start making an ImageAligner class in which I'd implement that feature, using the domain/data. This would have all the "algorithmic" stuff needed for the feature, like grouping by date etc etc, including the alignment logic.

The application would then instantiate that ImageAligner and it would listen to the data/context and do its stuff.

My colleagues argue on the other hand that the ImageAligner class is not needed. They claim it would be fine to put parts of the feature into the domain objects. The feature would be implemented through the collaboration of these domain classes.

One of their other arguments is that, because my solution looks like a strategy pattern, it adds just more complexity. They would even say it's over-engineered. Whereas I find it simpler because it isolates the feature in one place, making it easier to find and modify. 


I'm having a hard time convincing them (and they me). Mainly because what I see as domain/data objects, they consider to be functionality/feature classes. Also I have had some very good experiences in the past separating logic and domain in this way, making it hard for me to let go of this pattern of thinking.

Do you strictly separate algorithms/features/logic from domain/data in separate classes?

What would be arguments for choosing the one or the other design? 

Or am I just stuck in an odd way of thinking?

Penny for your thoughts.

3D Heart UV-unwrap needed for wedding anniversary project

28 May 2011 - 09:24 AM

Hi all,

My parents will have their 25th wedding anniversary later this year and I want to make them a present.

I plan on making a 3D heart out of sheet metal and decorate it with roses (also out of sheet metal), and have it nicely coated (silvery hopefully). However, I am unable to figure out the shape of sheet metal that I need to get the heart in the right shape in 3D. I am not too familiar with 3D modeling, but what I think I need is an UV-unwrap of a 3D heart shape. If I'm not mistaken the UV-unwrap lays out the polygons on a 2D surface, right? Once I know how the 3D shape is laid out in a 2D surface I can better figure out how to work the metal to get it into shape.

If anyone can provide me with a picture of a UV-unwrap of a 3D heart, and a shaded front/side/top view of it, I'd be forever grateful.

To give you an idea of what kind of shape I'm looking for: http://www.turbosquid.com/3d-models/iconic-heart-3ds-free/389728

I hope you can help me with this.

Python: ttk.treeview filling + multithreading = crash

04 November 2010 - 05:12 AM

Hi all, I have a little problem with filling a ttk.treeview widget from another thread.

I have a rather large treeview, and in order to keep the UI responsive while filling the treeview, I decided to fill it from a separate thread. Because direct access to the treeview from a separate thread results in exceptions (parent node not existing (yet)) I dispatch everything on the main thread with Tk.after(delay, func).

However, when I expand a node while the treeview is being filled, or wiggle the scrollbar that scrolls the treeview, the python iterpreter crashes.

I'm running Python 2.6 with pyttk 0.3.2.

My question is if anyone has tried to fill a ttk.treeview from a separate thread before and if someone has encountered this problem before?

I haven't isolated the problem in a small sample application yet. If the need arises I will do so.

Python development tips and tricks needed

03 September 2010 - 02:58 AM

So I started python programming at work a few weeks ago, and coming from languages like C# and C++ and the VS IDE, I find python somewhat tedious to work with because of the lack of "intellisense-like" features for modules that I wrote myself and the lack of a compile step. Whenever I use a class I have to dig in the source to find the member/method name that I want.
Also renaming members/methods is hard because you only find out at runtime if you renamed all occurrences.

I'm currently using the IDLE IDE and running my scripts from the commandline.

Do you people have any tips and tricks for me that would make life easier for me?

thanks in advance.

C# named mutex security, full control, and potential security leaks

17 December 2009 - 09:18 PM

I have to synchronize access to a resource between a service and the IIS service and found out that C# offers a named mutex. Because my service runs under the SYSTEM account and IIS/ASP runs under a restricted ASPNET user account I had to manipulate the security parameters of the mutex so that IIS could use the mutex. The quickest and easiest thing I could think of was to give the "Everyone"-group full control over this mutex because the app may be run under other accounts too. But now I was wondering if this may be a potential security leak. Are global mutexes exposed to the outside world? Can a remote user manipulate this mutex now?