Comments (8)
Is there any particular reason why there is no function with the
following prototype:Node Node::AddFolder(const std::string& name) const
In fact there was such methods. But we removed them to force users to think
correctly. Namespaces are importants so before creating nodes you should
always start by getting your namespace index or registering a new one. Then
use this index in all node creations.
In addition there were many places were inheriting namespace was directly
wrong don't remember where.
from freeopcua.
Hi all.
Folder is an object. Node is a common thing.
It is wrong to add method AddFolder to node. With node you should be able
only manipulate attributes and add other subnodes.
It is better something like this:
Create class FolderType inherited from ObjectType and initialize it with
some NodeID folder type. And also required class Folder which is inherited
from Object class. Folder class can be initialized with either NodeID or
FolderType..
Add method AddFolder to Server and to Folder classes.
Folder classes hierarchy should have folder behavior. :)
2015-01-11 9:57 GMT+03:00 oroulet [email protected]:
Is there any particular reason why there is no function with the
following prototype:Node Node::AddFolder(const std::string& name) const
In fact there was such methods. But we removed them to force users to think
correctly. Namespaces are importants so before creating nodes you should
always start by getting your namespace index or registering a new one. Then
use this index in all node creations.In addition there were many places were inheriting namespace was directly
wrong don't remember where.—
Reply to this email directly or view it on GitHub
#110 (comment).
Best regards,
Alexander Rykovanov.
from freeopcua.
Hi all.
Nice to see that you're back :-)
Folder is an object. Node is a common thing.
Things are not that simple. opcua defines a folder type. it also defines a
variable types, but then you have properties but properties are of variable
type with a reference of type property. In fact you can create crazy things
like a node of type folder which is linked to its parent as a property or
component and create custom links....
It is wrong to add method AddFolder to node. With node you should be able
only manipulate attributes and add other subnodes.
At the beginning I thought about create FolderNode, VariableNode, ...
classes but then found out that those objects were just the common ones and
many other types were possible, so I just created a Node class with a few
helper methods (CreateFolder, CreateObjects, etc...).
I saw that you created ServerNodes, VariableNodes, but I think it would
just make things more complicated to expose those. I am now quite sure that
a Node object is sufficient and more flexible. If you really want them ,
they should at least inherit from Node. No need to duplicate code.
But maybe the methods AddFolder, AddVariable, etc should not be part of the
Node class at all, maybe they should be part of the Server or Client
objects og maybe just member functions of OpcUa namespace
It is better something like this:
Create class FolderType inherited from ObjectType and initialize it with
some NodeID folder type. And also required class Folder which is inherited
from Object class. Folder class can be initialized with either NodeID or
FolderType..
Add method AddFolder to Server and to Folder classes.Folder classes hierarchy should have folder behavior. :)
2015-01-11 9:57 GMT+03:00 oroulet [email protected]:
Is there any particular reason why there is no function with the
following prototype:Node Node::AddFolder(const std::string& name) const
In fact there was such methods. But we removed them to force users to
think
correctly. Namespaces are importants so before creating nodes you should
always start by getting your namespace index or registering a new one.
Then
use this index in all node creations.In addition there were many places were inheriting namespace was
directly
wrong don't remember where.—
Reply to this email directly or view it on GitHub
#110 (comment).Best regards,
Alexander Rykovanov.—
Reply to this email directly or view it on GitHub
#110 (comment).
from freeopcua.
One more argument agains having specialized classes for folder, objects etc
is that it creates many issues.
for example when browsing we get a list of nodeids, unless we create a
filter,we know these are Nodes, but we have no ideas if they are folders,
variables, etc. to find out we need to do more network queries (performance
issue), or only return Node objects, but then users will need to
cast/instanciate specialized objects. Same problem for almost any query to
address space.
So my conclusion was that having specialized classes was both unnecessary
and would raise many issues with no good solutions.
It is better something like this:
Create class FolderType inherited from ObjectType and initialize it with
some NodeID folder type. And also required class Folder which is inherited
from Object class. Folder class can be initialized with either NodeID or
FolderType..
Add method AddFolder to Server and to Folder classes.Folder classes hierarchy should have folder behavior. :)
2015-01-11 9:57 GMT+03:00 oroulet [email protected]:
Is there any particular reason why there is no function with the
following prototype:Node Node::AddFolder(const std::string& name) const
In fact there was such methods. But we removed them to force users to
think
correctly. Namespaces are importants so before creating nodes you should
always start by getting your namespace index or registering a new one.
Then
use this index in all node creations.In addition there were many places were inheriting namespace was
directly
wrong don't remember where.—
Reply to this email directly or view it on GitHub
#110 (comment).Best regards,
Alexander Rykovanov.—
Reply to this email directly or view it on GitHub
#110 (comment).
from freeopcua.
Yes, I am reading you. :)
Well, this a subject for discussion... :)
If you are implementing a lamp controlling it is better to have a class
Lamp which will hide lamp details and nodes manipulating. From outside it
will be still a set of nodes and attributes. :)
When you will implement for example a Room you will have corresponding
class several vectors with lamps, switches etc. From outside it will be
still a set of nodes and attributes.
Folder has: node class - Object, Reference - HasType->FolderTypeID. Class
Folder can hide and maintain all this details automatically.
But in python may be reasonable to export only Node class and implement
required classes in python...
for example when browsing we get a list of nodeids, unless we create a
filter,we know these are Nodes, but we have no ideas if they are folders,
variables, etc. to find out we need to do more network queries
I agree that for such things is better to manipulate nodes.
Specialized classes should be developed to have as little queries as
possible.
They just for convenience when implementing some model.
For python may be reasonable to export only node class and implement
required classes with python.
2015-01-11 13:34 GMT+03:00 oroulet [email protected]:
One more argument agains having specialized classes for folder, objects
etc
is that it creates many issues.
for example when browsing we get a list of nodeids, unless we create a
filter,we know these are Nodes, but we have no ideas if they are folders,
variables, etc. to find out we need to do more network queries
(performance
issue), or only return Node objects, but then users will need to
cast/instanciate specialized objects. Same problem for almost any query to
address space.So my conclusion was that having specialized classes was both unnecessary
and would raise many issues with no good solutions.It is better something like this:
Create class FolderType inherited from ObjectType and initialize it with
some NodeID folder type. And also required class Folder which is
inherited
from Object class. Folder class can be initialized with either NodeID or
FolderType..
Add method AddFolder to Server and to Folder classes.Folder classes hierarchy should have folder behavior. :)
2015-01-11 9:57 GMT+03:00 oroulet [email protected]:
Is there any particular reason why there is no function with the
following prototype:Node Node::AddFolder(const std::string& name) const
In fact there was such methods. But we removed them to force users to
think
correctly. Namespaces are importants so before creating nodes you
should
always start by getting your namespace index or registering a new one.
Then
use this index in all node creations.In addition there were many places were inheriting namespace was
directly
wrong don't remember where.—
Reply to this email directly or view it on GitHub
<
https://github.com/FreeOpcUa/freeopcua/issues/110#issuecomment-69485747>.Best regards,
Alexander Rykovanov.—
Reply to this email directly or view it on GitHub
#110 (comment).—
Reply to this email directly or view it on GitHub
#110 (comment).
Best regards,
Alexander Rykovanov.
from freeopcua.
In addition there were many places were inheriting namespace was directly wrong don't remember where.
The "Objects" folder is in namespace 0. But everything the user adds to this folder must be in a different namespace as only standard-defined nodes can be in namespace 0.
from freeopcua.
Well, this a subject for discussion... :)
If you are implementing a lamp controlling it is better to have a class
Lamp which will hide lamp details and nodes manipulating.
I completely agree, I am just saying that at our level there are so little
difference form a folder to a variable, and so many possible objects, that
we should handle everything as Node and let users implements the
specialized classes
from freeopcua.
I think this can be also closed... If not we can reopen it...
from freeopcua.
Related Issues (20)
- How to install on Windows10
- Unable to create value change subscription HOT 2
- Some Bugs when building on Windows (uri_facade_win.cpp,socket_channel.cpp AND tcp_server.cpp) HOT 3
- Terminate called after throwing an instance of 'std::runtime_error' what(): Response timed out HOT 2
- Logging macros are not namespaced HOT 2
- How to report a security issue?
- issue with src/server/endpoints_parameters.cpp HOT 1
- Cmake Library error while compiling? HOT 1
- How to read a user-defined structure
- [please delete]
- Build Error has occurred. (Cmake, Visual Studio 2017)
- Build error (w10, visual 2019 and Boost 1.80) HOT 1
- Terminate when reconnected opc server
- algorithm library is missing in file: endpoints_parameters.cpp HOT 1
- sometime, error in node::GetVariables
- Installing using GNU autotools possibly outdated HOT 1
- Visual studio project: Release config has an invalid Runtime libray
- Race condition between "send request" and "receive response" threads HOT 1
- can I use this library to receive data from a robotic arm? [Technical question]
- UNABLE TO connect to Siemens 828D HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freeopcua.