Questions tagged [class-structure]

39 questions
1
vote
3 answers

.NET Nested Classes

The current class library I am working on will have a base class (Field) with over 50 specific "field" types which will inherit from "Field" and nested for maintain readability. For example... abstract class Field { public int Length { get; set;…
Inisheer
  • 20,376
  • 9
  • 50
  • 82
1
vote
2 answers

Assigning dynamic values with variables / constants in classes

Iv'e always been aware that you cannot set dynamic values to variables within a class structure, but is there any way around this? I have this interface: interface IUserPermissions { /* * Public VIEW,CREATE,UPDATE,DELETE */ const…
RobertPitt
  • 56,863
  • 21
  • 114
  • 161
1
vote
0 answers

Building a Simple encryption program using an abstract class

For homework I have been assigned the task of creating a program that encrypts a String based on a method called the Rail Fence Cipher. ( I don't know if this is common knowledge or not, or even if you guys want to see exactly what it is, so i have…
R.Hull
  • 126
  • 1
  • 8
1
vote
2 answers

How to force derived class to implement a static property or field?

This is my abstract class: abstract class Enemy { protected static abstract float HEALTH { get; } float health; void someMethod() { health = HEALTH; } } This is my derived class: abstract class BadGuy :…
xoxox
  • 719
  • 1
  • 13
  • 24
1
vote
3 answers

First member of class of C++ object

I know the following is bad but I was under the impression that the first member of class is the starting address of the class. Is it wrong ? class A{ public: int a; int b; }; class B{ public : int x; …
0
votes
1 answer

conceptual explanation of the red5 java class structure

I'm building a flash based videochat site on which users will create accounts and connect to other users in (for now) 1 on 1 chat rooms (not a porn site--I know you thought it). I've installed red5 and built a few hello worlds, and now I find myself…
s33hunt
  • 11
  • 2
0
votes
0 answers

Auto-create propertys getter and setter for class elements

I'm searching for a way to write less sameish looking code and I'm not sure if there is a solution for this. So far I tried using Visual Studio Snippets, but that was not as helpful as needed. I would love to have C-Style Macros for this, or even…
Darkproduct
  • 1,062
  • 13
  • 28
0
votes
1 answer

How to limit instantiation of class and methods in it -Java

@AllArgsConstructor(onConstructor = @__({ @Inject })) public class TransactionManager { private final TransactionHelper tnxHelper; public void createTransactions(List
details) { tnxHelper.createTransactions(details); …
0
votes
0 answers

How to properly structure classes and events in a WinForms application

I am working on my first real WinForms application using VB.NET and the project is getting a little bigger than originally expected - so I'm more or less forced to deal with the challenge of structuring my code a little better. I'm not used to doing…
0
votes
1 answer

Class Architecture Question

Just after some opinions on this fairly simple issue. Say, I have a DocumentParser class, that extracts lots of data from an excel spreadsheet. The data that is captured is modelled with another object, lets say 'DataObject'. The document parser…
Darren Young
  • 10,972
  • 36
  • 91
  • 150
0
votes
2 answers

Python class interdependencies

I have a python class that serves as a baseclass for further subclasses. It contains a methods that should act on all subclass the same, e.g. I want to put it in the base class. The problem is, that this method should return a new instance of the…
Torilla
  • 383
  • 5
  • 16
0
votes
0 answers

How to call a function using class instead of an object

In my project, I want call a function xieTest() in Datasource class. The content of Datasource class is : namespace common; class Datasource { public function __construct() { } public static function xieTest() { …
stack
  • 821
  • 1
  • 15
  • 28
0
votes
3 answers

Grouping methods logically

Basically I have a class with a private method and lots of public methods that call this private method. I want to group these public methods logically (preferably to separate files) so it'll be organized, easier to use and maintain. public class…
user1061894
  • 109
  • 2
  • 11
0
votes
1 answer

Creating a parent.child class structure where the child has a

I have the following code where a problem occurs because the child objects require parameters before they can create an instance. Do I need to create some kind of function to handle the creation of the child objects? I want to be able to do: a =…
Alexander McFarlane
  • 10,643
  • 9
  • 59
  • 100
0
votes
1 answer

How to parse JSON data without key names into a Java class structure?

I successfully followed the example Simple Spring code to parse JSON into a Java class structure using Jackson. Now i am looking for a hint how to do the same for JSON data without key names, e.g. { "10869918": { "BRANCH":…
rmv
  • 3,195
  • 4
  • 26
  • 29