Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
1answer
75 views

PHP, would this class pass the single responsibility principle?

I have a user class comprised of the code below. It has functions to insert a user, update a user, delete a user, look up a user, and search for users. What I'm wondering is if I this class would pass ...
1
vote
0answers
78 views

Database Handler - Dynamically create “mdf file” and tables from classes (NEED HELP/SUGGESTIONS) [closed]

I'm trying to create a handler that first of all creates a "mdf" file, which I later connect to. Then I can add tables from a type, that gets all its properties and values. So a class with 2 ...
1
vote
2answers
106 views

Is this good class design (OOP PHP)?

Explained what I'm doing in the comments: class User { public $id; public $email; public $username; public $password; public $rep; public function __constructor($id, $email, ...
4
votes
1answer
113 views

C# Class of client methods for interacting with web servers

I'm in QA Automation, and C# isn't my first language. I've written a small class of methods for GETting and POSTing to web URLs. I use these when I want to test certain things that really fall outside ...
2
votes
3answers
120 views

Communication between two classes in ruby

I cannot understand how I can make two classes work together by passing variables between them. During the last 5 days, I learned the basics of inheritance, singleton methods and eval methods. I even ...
1
vote
2answers
59 views

Ruby - class definition for connecting to external API

I've defined a Client class to connect to an external API. The Client class will return XML responses for various resources. Here's what it looks like now: require 'nokogiri' class Client ...
1
vote
0answers
52 views

Set of classes for generating social plugins, is my design correct?

I've created a set of classes thatwork together to create the html needed to display social plugins like Facebook like, google plus and twitter. At firsti defined an abstract class ...
3
votes
1answer
132 views

How to convert my classes to Dependency injection?

I am still learning to develop my skills in OOP. It uses a combination of the factory and its real singletons? As I did more research, I have realized this design pattern is bad because of global ...
3
votes
2answers
98 views

Returning Groovy class fields as a map

I want to get a map of all the fields in a class (aka value object) in a generic way. The following works fine for me: class Baz { String foo = "foo2" int bar = 2 public Map asMap() { def ...
4
votes
2answers
174 views

Is it a good practice to wrap datatypes in custom classes?

So in my current application, I was thinking to make a extended class for all the datatypes. For int, it will be something like ExtendedInt, for bool it will be something like ExtendedBool. These ...
3
votes
2answers
179 views

Authentication Class

I've wrote this class in PHP for my future projects: <?php /** * Auth * This class is used to securely authenticate and register users on a given website. * This class uses the ...
3
votes
1answer
277 views

C#: Simplfy code using Interfaces + business rules / validation

I have a workflow; within the workflow I can have many stages. I want to open and close a stage based on some business rules. E.g., stage 7 cannot be opened, because stage 5 + 6 need to be closed ...
2
votes
1answer
105 views

Best way to Structure class + Instantiation

Is this a good way to design a class so I can prevent values being changed/ the state must remain as it was when it was intantiated... This code would be normally instantiated after a call from the ...
3
votes
1answer
171 views

Should I split class or keep it all in one?

Currently, in my project I have one class that is dedicated to the all of the queries for the IBM i and converts it into usable models for my .NET code. There is already 12 methods in this class and ...
2
votes
2answers
179 views

beginner's class inheritance question C# VB Visual Studio 2010

I understand the typical example of fruit as a base class and banana, orange, and pear as derived classes. But what about when there is only one property in common? Do you still use class ...

1 2 3
15 30 50 per page