You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@celix.apache.org by GitBox <gi...@apache.org> on 2022/06/07 18:10:50 UTC

[GitHub] [celix] pnoltes opened a new pull request, #421: Feature/update component and pattern documentation

pnoltes opened a new pull request, #421:
URL: https://github.com/apache/celix/pull/421

   This PR mainly adds updated documentation for Apache Celix components and patterns.
   
   It also contains example code used in the documentation and plantuml files used to generate the diagrams. 
   
   Lastly it containers two improvements for the dependency manager:
    - For C, a `celix_dmComponent_setImplementationDestroyFunction` function is added so that bundle activators only working with component do not need a activator stop function. 
    - For C++, a `celix::dm::Component::createUnassociatedProvidedService` method is added so that C++ components can provided C or C++ services where the lifecycle is coupled to the component, but the service has no inheritance relation with the component. This should result in less boiler plating code in situation where C++ components provide C services.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@celix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [celix] codecov-commenter commented on pull request #421: Feature/update component and pattern documentation

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #421:
URL: https://github.com/apache/celix/pull/421#issuecomment-1166524417

   # [Codecov](https://codecov.io/gh/apache/celix/pull/421?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#421](https://codecov.io/gh/apache/celix/pull/421?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (551514f) into [master](https://codecov.io/gh/apache/celix/commit/cdf2c30eb11e7225cb6efc26de8ca9c2e6e2bb50?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (cdf2c30) will **increase** coverage by `0.18%`.
   > The diff coverage is `93.33%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #421      +/-   ##
   ==========================================
   + Coverage   71.98%   72.16%   +0.18%     
   ==========================================
     Files         180      181       +1     
     Lines       29287    29892     +605     
   ==========================================
   + Hits        21083    21573     +490     
   - Misses       8204     8319     +115     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/celix/pull/421?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [libs/framework/include/celix/dm/Component.h](https://codecov.io/gh/apache/celix/pull/421/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlicy9mcmFtZXdvcmsvaW5jbHVkZS9jZWxpeC9kbS9Db21wb25lbnQuaA==) | `94.44% <89.47%> (+12.62%)` | :arrow_up: |
   | [libs/framework/src/dm\_component\_impl.c](https://codecov.io/gh/apache/celix/pull/421/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlicy9mcmFtZXdvcmsvc3JjL2RtX2NvbXBvbmVudF9pbXBsLmM=) | `86.30% <93.24%> (+5.16%)` | :arrow_up: |
   | [libs/framework/include/celix/dm/Component\_Impl.h](https://codecov.io/gh/apache/celix/pull/421/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlicy9mcmFtZXdvcmsvaW5jbHVkZS9jZWxpeC9kbS9Db21wb25lbnRfSW1wbC5o) | `83.41% <95.83%> (+0.59%)` | :arrow_up: |
   | [.../framework/include/celix/dm/ProvidedService\_Impl.h](https://codecov.io/gh/apache/celix/pull/421/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlicy9mcmFtZXdvcmsvaW5jbHVkZS9jZWxpeC9kbS9Qcm92aWRlZFNlcnZpY2VfSW1wbC5o) | `97.29% <100.00%> (ø)` | |
   | [...ubsub\_serializer\_json/src/pubsub\_serializer\_impl.c](https://codecov.io/gh/apache/celix/pull/421/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnVuZGxlcy9wdWJzdWIvcHVic3ViX3NlcmlhbGl6ZXJfanNvbi9zcmMvcHVic3ViX3NlcmlhbGl6ZXJfaW1wbC5j) | `35.63% <0.00%> (-18.91%)` | :arrow_down: |
   | [libs/utils/src/hash\_map.c](https://codecov.io/gh/apache/celix/pull/421/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlicy91dGlscy9zcmMvaGFzaF9tYXAuYw==) | `93.25% <0.00%> (-1.69%)` | :arrow_down: |
   | [libs/framework/src/dm\_dependency\_manager\_impl.c](https://codecov.io/gh/apache/celix/pull/421/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlicy9mcmFtZXdvcmsvc3JjL2RtX2RlcGVuZGVuY3lfbWFuYWdlcl9pbXBsLmM=) | `75.58% <0.00%> (-1.54%)` | :arrow_down: |
   | [...sub/pubsub\_admin\_zmq/src/pubsub\_zmq\_topic\_sender.c](https://codecov.io/gh/apache/celix/pull/421/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnVuZGxlcy9wdWJzdWIvcHVic3ViX2FkbWluX3ptcS9zcmMvcHVic3ViX3ptcV90b3BpY19zZW5kZXIuYw==) | `84.38% <0.00%> (-1.27%)` | :arrow_down: |
   | [...ubsub\_admin\_udp\_mc/src/pubsub\_udpmc\_topic\_sender.c](https://codecov.io/gh/apache/celix/pull/421/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnVuZGxlcy9wdWJzdWIvcHVic3ViX2FkbWluX3VkcF9tYy9zcmMvcHVic3ViX3VkcG1jX3RvcGljX3NlbmRlci5j) | `54.59% <0.00%> (-1.15%)` | :arrow_down: |
   | [bundles/pubsub/pubsub\_utils/src/pubsub\_utils.c](https://codecov.io/gh/apache/celix/pull/421/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnVuZGxlcy9wdWJzdWIvcHVic3ViX3V0aWxzL3NyYy9wdWJzdWJfdXRpbHMuYw==) | `68.88% <0.00%> (-1.12%)` | :arrow_down: |
   | ... and [12 more](https://codecov.io/gh/apache/celix/pull/421/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/celix/pull/421?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/celix/pull/421?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [fb0ebbc...551514f](https://codecov.io/gh/apache/celix/pull/421?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@celix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [celix] pnoltes commented on pull request #421: Feature/update component and pattern documentation

Posted by GitBox <gi...@apache.org>.
pnoltes commented on PR #421:
URL: https://github.com/apache/celix/pull/421#issuecomment-1166524627

   @jermus67 Could you re-review the PR?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@celix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [celix] jermus67 commented on a diff in pull request #421: Feature/update component and pattern documentation

Posted by GitBox <gi...@apache.org>.
jermus67 commented on code in PR #421:
URL: https://github.com/apache/celix/pull/421#discussion_r897876199


##########
documents/diagrams/whiteboard_pattern.puml:
##########
@@ -0,0 +1,32 @@
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+@startuml

Review Comment:
   Can the flow be inverted? It is the Whiteboard Service Admin that (potentially) wants to use the Whiteboard Participants. It now looks like it is the other way around (even though the service dependency is depicted OK).



##########
documents/diagrams/whiteboard_pattern.puml:
##########
@@ -0,0 +1,32 @@
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+@startuml
+component WhiteboardParticipantA as "Whiteboard Participant A"
+component WhiteboardParticipantB as "Whiteboard Participant B"
+component WhiteboardParticipantC as "Whiteboard Participant C"
+component WhiteboardServiceAdmin as "Whiteboard Service Admin"

Review Comment:
   Is "Admin"  the proper term here? Indeed the Remote Service Admin may use the whiteboard pattern, but than as part of the services on demand pattern (which is what makes it makes Admin to me).



##########
documents/patterns.md:
##########
@@ -19,16 +19,121 @@ See the License for the specific language governing permissions and
 limitations under the License.
 -->
 
-# OSGi pattern in Apache Celix
+# Apache Celix / OSGi  patterns 
+There are several design patterns used in Apache Celix and OSGi.  
+
+## Whiteboard Pattern
+The whiteboard pattern is a pattern where the act of registering a service is enough to participate in or extend 
+an existing functionality.  
+A typical aspect of the whiteboard pattern is that an application should 
+still resolve and startup even if the bundle or bundles that pick up the whiteboard pattern services are absent.
+
+![Whiteboard Pattern](diagrams/whiteboard_pattern.png)
+
+Many Apache Celix services are whiteboard services. For example:

Review Comment:
   Maybe an additional diagram that places the elements mentioned in these examples (or from one example) in the pattern?



##########
documents/patterns.md:
##########
@@ -19,16 +19,121 @@ See the License for the specific language governing permissions and
 limitations under the License.
 -->
 
-# OSGi pattern in Apache Celix
+# Apache Celix / OSGi  patterns 
+There are several design patterns used in Apache Celix and OSGi.  
+
+## Whiteboard Pattern
+The whiteboard pattern is a pattern where the act of registering a service is enough to participate in or extend 
+an existing functionality.  
+A typical aspect of the whiteboard pattern is that an application should 
+still resolve and startup even if the bundle or bundles that pick up the whiteboard pattern services are absent.

Review Comment:
   So optional service dependency, no required service dependency?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@celix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [celix] pnoltes commented on a diff in pull request #421: Feature/update component and pattern documentation

Posted by GitBox <gi...@apache.org>.
pnoltes commented on code in PR #421:
URL: https://github.com/apache/celix/pull/421#discussion_r906766771


##########
documents/patterns.md:
##########
@@ -19,16 +19,121 @@ See the License for the specific language governing permissions and
 limitations under the License.
 -->
 
-# OSGi pattern in Apache Celix
+# Apache Celix / OSGi  patterns 
+There are several design patterns used in Apache Celix and OSGi.  
+
+## Whiteboard Pattern
+The whiteboard pattern is a pattern where the act of registering a service is enough to participate in or extend 
+an existing functionality.  
+A typical aspect of the whiteboard pattern is that an application should 
+still resolve and startup even if the bundle or bundles that pick up the whiteboard pattern services are absent.

Review Comment:
   From the whiteboard perspective they are indeed optional dependencies. 
   But this part of the documentation aims to explain that if you provide a whiteboard service, it will not automatically be picked up. You also need to start the whiteboard service for something to happen.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@celix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [celix] pnoltes commented on pull request #421: Feature/update component and pattern documentation

Posted by GitBox <gi...@apache.org>.
pnoltes commented on PR #421:
URL: https://github.com/apache/celix/pull/421#issuecomment-1168733589

   > Maybe check the whiteboard pattern picture again? I still see "admin" in there, which may be as intended, but contradicts the response on my previous comment.
   
   I checked there is no admin in the generic whiteboard pattern picture.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@celix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [celix] pnoltes merged pull request #421: Feature/update component and pattern documentation

Posted by GitBox <gi...@apache.org>.
pnoltes merged PR #421:
URL: https://github.com/apache/celix/pull/421


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@celix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [celix] pnoltes commented on a diff in pull request #421: Feature/update component and pattern documentation

Posted by GitBox <gi...@apache.org>.
pnoltes commented on code in PR #421:
URL: https://github.com/apache/celix/pull/421#discussion_r906810025


##########
documents/diagrams/whiteboard_pattern.puml:
##########
@@ -0,0 +1,32 @@
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+@startuml
+component WhiteboardParticipantA as "Whiteboard Participant A"
+component WhiteboardParticipantB as "Whiteboard Participant B"
+component WhiteboardParticipantC as "Whiteboard Participant C"
+component WhiteboardServiceAdmin as "Whiteboard Service Admin"

Review Comment:
   removed admin from pattern diagram



##########
documents/patterns.md:
##########
@@ -19,16 +19,121 @@ See the License for the specific language governing permissions and
 limitations under the License.
 -->
 
-# OSGi pattern in Apache Celix
+# Apache Celix / OSGi  patterns 
+There are several design patterns used in Apache Celix and OSGi.  
+
+## Whiteboard Pattern
+The whiteboard pattern is a pattern where the act of registering a service is enough to participate in or extend 
+an existing functionality.  
+A typical aspect of the whiteboard pattern is that an application should 
+still resolve and startup even if the bundle or bundles that pick up the whiteboard pattern services are absent.
+
+![Whiteboard Pattern](diagrams/whiteboard_pattern.png)
+
+Many Apache Celix services are whiteboard services. For example:

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@celix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org