Questions tagged [responsibility]

37 questions
1
vote
2 answers

In C#, what are some rules of thumb for _where_ to clone objects?

Here's the situation: I am trying to determine the where part of cloning an object to avoid modifying the original. I have two options: Clone the object in the caller and pass the cloned object to a method ("callee"), thus preventing potential…
aholmes
  • 458
  • 9
  • 20
1
vote
2 answers

WPF - MVVM - Who is responsible for a new DataProvider Connection?

I know this might be a "style of coding" question but at this point I'm really confused. Currently I'm trying to follow the MVVM pattern (ViewModel, Repository, Controller etc.) But who should initiate a connection to the source of data? Especially…
Th1sD0t
  • 1,089
  • 3
  • 11
  • 37
1
vote
1 answer

How does patterns help loose coupling?

I'm new to java patterns and I'm trying to figure out how it fits in to the REAL WORLD. Most sites and books on patterns seems to be written by non-programmers. I'm trying to define how patterns help with coupling, and this is my definition so far.…
1
vote
2 answers

responsibility based modeling versus class reasons to change

In this text I read Be alert for a component that is just a glorified responsibility. A component is supposed to capture an abstraction that has a purpose in the system. It may happen that what appears at one moment as a meaningful …
koen
  • 13,349
  • 10
  • 46
  • 51
1
vote
1 answer

Responsibility of object creation within class

This might sound like a noob question. class MyClass { public List myObjects; public MyClass() { //... } } class UserClass { public void SomeFunction() { MyClass obj = new MyClass(); …
ShaQ.Blogs
  • 1,264
  • 4
  • 17
  • 30
0
votes
0 answers

Responsibilities in a Java Menu using MVC pattern without JavaSwing

This is my first post here. If i'm doing something wrong, please tell me. I want to create a Menu in Java with MVC pattern without JavaSwing, so with a View that only prints. My program has a Model which generates Runnable tasks. So when the…
Stefano
  • 13
  • 5
0
votes
2 answers

How handle transaction in Chain Of Responsibility pattern?

I have a transaction issue on COR pattern: AbstractChainHandler | | | | FirstChainHandler SecondChainHandler -create A -create B -delete A -delete…
0
votes
2 answers

.Net Class Libraries: Threading responsibility

I am working on a class library and one of the classes is responsible for retrieving an Xml file using XDocument.Load(url) from the internet. Seeing as this operation could take a few seconds to complete, it makes sense to run it on it's own…
aligray
  • 2,812
  • 4
  • 26
  • 35
0
votes
0 answers

Why CSS dimensions doesn't work on low width?

i'm doing the responsibility of my page and i have a problem. When i write for example this: @media (min-width: 321px) and (max-width: 580px) { body {width: 100%; font-size: 15px;}} dimensions dosen't work. I can't change any width, even font size.…
0
votes
1 answer

Ownership responsibility and reusability

I had a disscusion with a collegue about approaches to these topics in our project. Im making a Progress System, in short a ProgressMonitor class and a Task class, ProgressMonitor handles an array of tasks. All pretty straight forward stuff. But…
Rottjung
  • 493
  • 1
  • 5
  • 15
0
votes
1 answer

Class Responsibilities

I want to create an application that maintains a list of Computer objects, checks those objects for availability (using Ping) and if they're available use PSExec to add or remove users to/from the list of administrators. Currently I can not figure…
Th1sD0t
  • 1,089
  • 3
  • 11
  • 37
0
votes
2 answers

How can i set @media only screen less then 320px for indetificator?

I have this piece of code. I'm beginner :/ https://ibb.co/ccrFFG Id like to add some responsibility by @media only screen and (max-width: 320px) {} but it doesnt works with IDs. How would you change the code pls? :) Thanks
user9055366
0
votes
1 answer

Make it so that the end user is responsible for their actions

I have a program that can find sites that are exploitable and exploit them, I posted this on my Github and people started using it. I recently have been contacted by an owner of one of the websites (my email address is there for troubleshooting…
Gyzo
  • 65
  • 6
0
votes
1 answer

Should a view flag be updated by API or the consumer?

I do hope this question is too subjective, as I am actually looking for a "best practice" that makes sense. However, the question is a bit more broad than just this case. Lets say I have a view flag on an object (seen or not). When this object is…
Lars Holdgaard
  • 9,496
  • 26
  • 102
  • 182
0
votes
1 answer

Class and their responsibility analysis

Suppose i have a use case "Customer Deposits Money on Account". Where should the functionality "Deposit()" go ? Customer or Account?. What should be the design for this use case ?
aspxsushil
  • 514
  • 1
  • 5
  • 16