Questions tagged [responsibility]
37 questions
8
votes
5 answers
Whose responsibility is it to cache / memoize function results?
I'm working on software which allows the user to extend a system by implementing a set of interfaces.
In order to test the viability of what we're doing, my company "eats its own dog food" by implementing all of our business logic in these classes…

Michael
- 3,099
- 4
- 31
- 40
6
votes
3 answers
Data Access Layer - Designing Class where should responsibility of creating saving be
I am designing Data Access Layer with ADO.NET 2.0 and C#, Sql Server 2005. I often fight with my brain over where to place those calls. Which way of the below i should follow for maintainable robust code.
Method 1
Public Class Company
{
public…

Deeptechtons
- 10,945
- 27
- 96
- 178
5
votes
1 answer
Interface with service layer or domain objects themselves? (DDD)
I'm still learning about DDD and I have these two (probably simple) questions:
If a Factory creates new object/graph/aggregate instances, but also "reconstitutes" objects/graphs from the Repository, then:
(1) Does your service layer…

Matt Kocaj
- 11,278
- 6
- 51
- 79
5
votes
3 answers
MVVM what part of pattern responsible for grouping of datagrid
I've been tinkering around with the MVVM pattern and now I'm trying to implement a little application based on it.
This application has a datagrid in which, surprisingly enough, some data is presented. Now I'm trying to add some grouping ability to…

user362397
- 53
- 4
4
votes
5 answers
How do you name a class/method that only calls other methods?
Say I follow the Single Responsibility Principle and I have the following classes.
public class Extractor {
public Container extract(List list) {
... some extraction
}
}
public class Converter {
public String…

reach44
- 41
- 3
3
votes
1 answer
Determine responsibility of saving settings (controller, services and mappers)
EDIT:
Because I was to late with awarding the initial bounty of 300 to @arcain I'm reopening. And awarding the additional 150 to @arcain. Unless of course somebody provides even a better answer. :)
/ EDIT
Consider the following form:
language |…

Decent Dabbler
- 22,532
- 8
- 74
- 106
3
votes
1 answer
Changing a Parameter - who's responsible?
I've got a table which gets filled by another application. This table contains an attribute called IsMailSent.
EF builds my objects of Type Request based on the database data.
The object looks something like this:
public class Request {
int…

Th1sD0t
- 1,089
- 3
- 11
- 37
3
votes
1 answer
Code design: Who's responsible for changing object data?
Assuming I have some kind of data structure to work on (for example images) which I want to pre- and postprocess in different ways to make further processing steps easier. What's the best way to implement this responsibility with an OOP language…

user1709708
- 1,557
- 2
- 14
- 27
2
votes
2 answers
Which class should be responsible for starting / ending transaction in JPA?
So I have a sample code like this:
package biz.tugay.books10Aug.dao;
/* User: koray@tugay.biz Date: 10/08/15 Time: 22:54 */
import biz.tugay.books10Aug.model.Book;
import javax.persistence.EntityManager;
import…

Koray Tugay
- 22,894
- 45
- 188
- 319
2
votes
2 answers
Properly design a code editor application
I'm working on personal project which is basically a code editor. Imagine standard File menu with menu items New, Open, Save, Save As, Save All, Close, Close All.
I'm stuck with proper design. Currently I have:
A Document class which represents a…

Hemaulo
- 979
- 2
- 9
- 16
2
votes
3 answers
Pointers and Object Oriented Programming
How do pointers work with the concepts of Object oriented programming?
As I understand it (and please recognize, I'm classified as an ID-10T), the main tenet of OOP is containment and keeping management responsibility (memory/implementation/etc.)…

chessofnerd
- 1,219
- 1
- 20
- 40
1
vote
4 answers
Android HelloWorld response
I know that the heading of this thread sound silly, but I can not repair my code.
package HelloAndroid;
import android.app.Activity;
import android.os.Bundle;
import android.widget.*;
public class HelloAndroidActivity extends Activity {
/** Called…

user35443
- 6,309
- 12
- 52
- 75
1
vote
2 answers
What is responsibility-driven design?
I am very confused about the responsibility-driven design concept. Mainly because of ever so slightly changing definitions depending on the source.
Quoting BlueJ (the book I am learning that teaches Java):
Responsibility-driven design expresses the…

Sebastian Nielsen
- 3,835
- 5
- 27
- 43
1
vote
2 answers
Who should be responsible for calling a method?
If I have complex a task to solve I sometimes end up in a situation where I have one method that controls the execution. Because of null checks, if statements, calling methods that map between types and so on, this method can become really long and…

Paul Adam
- 251
- 1
- 2
- 11
1
vote
1 answer
Responsible time delays - web crawling
What is a responsible / ethical time delay to put in a web crawler that only crawls one root page?
I'm using time.sleep(#) between the following calls
requests.get(url)
I'm looking for a rough idea on what timescales are:
1. Way too…

Andrew Allen
- 6,512
- 5
- 30
- 73