Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove creation design pattern class with in place implementation #1036

Closed
12 tasks done
elfenpiff opened this issue Jan 22, 2022 · 0 comments · Fixed by #1041, #1053, #1418, #1443 or #1852
Closed
12 tasks done

Remove creation design pattern class with in place implementation #1036

elfenpiff opened this issue Jan 22, 2022 · 0 comments · Fixed by #1041, #1053, #1418, #1443 or #1852
Assignees
Labels
globex refactoring Refactor code without adding features technical debt unclean code and design flaws
Milestone

Comments

@elfenpiff
Copy link
Contributor

elfenpiff commented Jan 22, 2022

Brief feature description

Inheriting from the creation design pattern class has certain drawbacks which can be very error prone.

  1. In move and copy operations one has to delegate the call to the base class first
  2. m_isInitialized, m_errorValue are sometimes overlooked or not set correctly
  3. the creation class has to be a friend class of the resource which is using it

A better implementation alternative would be to create a static method in such classes called create and create the system resource directly in there and provide the handle to that successfully created resource to the constructor of the class. The constructor does not create the system resource it just acquires a existing one and handles its lifetime.

Another approach is to introduce a builder pattern when the class constructors requires more then zero arguments to improve the readability.

Classes where Creation pattern must be replaced with static create method

  • SharedMemoryObject
  • MemoryMap
  • SharedMemory
  • UnixDomainSocket (high prio)
  • MessageQueue (medium prio)
  • NamedPipe (medium prio)
  • FileLock
  • Semaphore (will be solved in The semaphore posix wrapper should not be movable. #751)
  • Mutex (high prio)
    • Implement builder pattern
    • Integrate new API into iceoryx and remove old constructor, all @todo iox-#1036 should be gone
  • move creation.hpp to iceoryx_dust (high prio)
@elfenpiff elfenpiff added refactoring Refactor code without adding features technical debt unclean code and design flaws labels Jan 22, 2022
@elfenpiff elfenpiff added this to the Low prio milestone Jan 22, 2022
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Jan 24, 2022
…rected const correctness

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Jan 24, 2022
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Jan 24, 2022
…ilder patterns more easily and implemented MemoryMapBuilder with that

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Jan 24, 2022
Signed-off-by: Christian Eltzschig <me@elchris.org>
@elfenpiff elfenpiff linked a pull request Jan 24, 2022 that will close this issue
21 tasks
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Jan 24, 2022
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Jan 24, 2022
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Jan 25, 2022
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Jan 25, 2022
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Jan 26, 2022
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Jan 26, 2022
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Jan 26, 2022
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Jan 26, 2022
… accessing baseAddressHint when the optional is not set

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Jan 26, 2022
… accessing baseAddressHint when the optional is not set

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Jan 26, 2022
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Jan 26, 2022
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Jan 26, 2022
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Jan 26, 2022
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit to ApexAI/iceoryx that referenced this issue Jan 26, 2022
Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added a commit that referenced this issue Jan 26, 2022
…memory-map

Iox #1036 in place creation for memory map
@elBoberido elBoberido reopened this Jan 26, 2022
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Sep 2, 2023
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Sep 2, 2023
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Sep 2, 2023
elBoberido added a commit that referenced this issue Sep 4, 2023
…-message-queue

iox-#1036 Builder pattern for message queue
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Sep 4, 2023
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Sep 4, 2023
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Sep 4, 2023
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Sep 4, 2023
elBoberido added a commit that referenced this issue Sep 4, 2023
…-named-pipe

iox-#1036 builder pattern for named pipe
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Sep 4, 2023
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Sep 4, 2023
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Sep 4, 2023
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Sep 4, 2023
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Sep 4, 2023
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Sep 4, 2023
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Sep 4, 2023
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Sep 4, 2023
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Sep 4, 2023
elBoberido added a commit that referenced this issue Sep 4, 2023
…-unix-domain-socket

iox-#1036 builder pattern for unix domain socket
@elBoberido elBoberido linked a pull request Sep 4, 2023 that will close this issue
21 tasks
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Sep 4, 2023
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Sep 4, 2023
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Sep 4, 2023
elBoberido added a commit to elBoberido/iceoryx that referenced this issue Sep 4, 2023
elBoberido added a commit that referenced this issue Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment