class-design Questions

7

Solved

My question is about what should be go first in software developing: database model or domain model? Or these notion are parallels? Thanks.
Emulous asked 22/4, 2011 at 13:52

4

Solved

I have an Interface which contains one property. I need to set the default value for that property. How to do that?. Also is it good practice to have a default value for a property in Interface? or...
Humber asked 12/10, 2011 at 5:20

8

Solved

In PHP 5, what is the difference between using const and static? When is each appropriate? And what role does public, protected and private play - if any?
Odlo asked 6/11, 2009 at 7:10

12

Solved

I want to create an alias for a class name. The following syntax would be perfect: public class LongClassNameOrOneThatContainsVersionsOrDomainSpecificName { ... } public class MyName = LongClassN...
Luanneluanni asked 28/10, 2008 at 18:9

20

Solved

I'm just trying to streamline one of my classes and have introduced some functionality in the same style as the flyweight design pattern. However, I'm a bit confused as to why __init__ is always c...
Newsman asked 23/3, 2009 at 17:13

9

Looking at the (mature) codebase at my new job, there is an interface, and only one class implements it (as far as I can tell). Can/should I get rid of the interface?
Metropolis asked 18/5, 2010 at 1:53

4

Solved

When I was creating the first time an uml class diagram for a small C# project I had some trouble with the properties. At the end I just added the properties as a variable with <<property>...
Darrel asked 28/9, 2012 at 8:43

7

Solved

I am a beginner to programming when I start to code I just start writing and solve the problem. I write whole program in a single main function. I don't know when to make class, and functions. Wha...

4

I want to know the why a singleton class should be sealed. If we are giving the constructor as private we can prevent the class to be derived right?.. Below i'm pasting few lines from MSDN. Please ...
Dysuria asked 26/7, 2012 at 11:35

5

Solved

#include "Includes.h" enum BlowfishAlgorithm { ECB, CBC, CFB64, OFB64, }; class Blowfish { public: struct bf_key_st { unsigned long P[18]; unsigned long S[1024]; }; Blowfish(Blowfish...
Psychophysiology asked 12/2, 2011 at 23:13

6

Solved

Given class A, which contains sets of raw data, and class B, which contains a re-organized version (GUI ready) of that data I would like to make the raw data in A visible in B. Clearly the raw dat...
Casar asked 1/2, 2010 at 16:36

3

Solved

My app uses two databases (separate files). To handle these databases I have created two Helper classes which extend SQLiteOpenHelper, one for each database. I am now going to add a third database...
Dressel asked 20/11, 2010 at 17:31

5

Solved

Suppose, I write class A { }; The compiler should provide (as and when needed) a constructor a destructor a copy constructor = operator Is this all the compiler provides? Are there ...
Hive asked 17/4, 2010 at 20:18

6

Solved

I have these classes and a procedure: TParent = class(TObject); TChild1 = class(TParent); TChild2 = class(TParent); Procedure DoSomething(obj:TParent); What I would like to do is when obj ...
Listlessness asked 10/3, 2011 at 4:6

5

Solved

I personally don't have my entities implement interfaces. For a Task class I wouldn't have ITask that just had the same properties defined on it. I've seen it done a few times though, so I'm wonde...
Touchmenot asked 17/11, 2010 at 11:58

8

Solved

When should i make a function private and why is it good idea?
Sybilla asked 22/12, 2010 at 3:31

1

Solved

For a library (.NET Standard 2.0), I designed some classes that look roughly like this: public class MyContext { // wraps something important. // It can be a native resource, a connection to an ...

2

Solved

can somebody describe the following exception? What is the "object layout" and how it is defined? Thanks Traceback (most recent call last): File "test_gui.py", line 5, in <module> suite = ...
Clouet asked 22/7, 2010 at 12:27

2

Solved

I am just getting started with .NET ORMs, to the point where I haven't even decided between Entity Framework and NHibernate. But in both cases, I'm running into a problem in that they seem to want ...
Federicofedirko asked 19/3, 2011 at 20:12

6

Solved

Suppose I have a class 'Application'. In order to be initialised it takes certain settings in the constructor. Let's also assume that the number of settings is so many that it's compelling to place...
Attendant asked 3/12, 2008 at 13:37

2

Solved

This is in regards to the design principals behind the Startup class explained here: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/startup?view=aspnetcore-2.1 I understand that the c...
Zettazeugma asked 12/11, 2018 at 0:49

5

Solved

I was asked this question in an interview. There are 3 classes A, B extends A & C extends B. We have to design these classes conforming to these constraints Client can instantiate only one i...
Veteran asked 27/5, 2019 at 14:34

5

Solved

Let's consider python (3.x) scripts: main.py: from test.team import team from test.user import user if __name__ == '__main__': u = user() t = team() u.setTeam(t) t.setLeader(u) test/user.p...
Anonymous asked 17/10, 2010 at 23:30

10

What is the purpose of a marker interface?
Neibart asked 21/6, 2009 at 2:38

3

Solved

Suppose I already have 2 classes in my code: class SomeOrder { String getOrderId() { return orderId; } } class AnotherOrder { String getOrderId() { return orderId; } } How to create an interf...
Thermoelectric asked 20/4, 2018 at 18:29

© 2022 - 2024 — McMap. All rights reserved.