E
E
Evgeny Elchev2014-04-21 07:30:54
OOP
Evgeny Elchev, 2014-04-21 07:30:54

What is the best way to implement such functionality in OOP (C#)?

Hello, the essence of the idea is an algorithm for processing references, roughly speaking a cycle. I need to implement the storage of settings for processing specific references (only three parameters - height, width and orientation). That is, while the cycle is running, I need to get these three parameters by the name of the help. The application is simple and therefore there are no particular resource requirements, but I want to do it right right away so as not to learn how to write shitty code.
How I see it:
1) Create a help class

private string _naim;
        ....

        public string naim
        {
            get { return _naim; }
            set { _naim = value; }
        }
        ...

2) Create a class that would organize a collection of objects of this class, quickly search through them, read and write this collection to a file.
Am I seeing the problem correctly? And if it is correct, what type of collection is better to choose, taking into account the fact that its size is not known in advance, how to implement a quick search in the collection by the property of the object and how to save and read this collection?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2014-04-21
@rsi

- Create a structure for your references
- Store them in an ArrayList (because the length is not known in advance)
- Implement a class that will store a collection of your structures and implement search methods, returning collections. Inside, you can already use linq to fetch.
- Implement a service (a class belonging to the service layer) that will store the settings and process the collection supplied as input.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question