The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

lcphill (4) [Avatar] Offline
#1
Thought I'd start a "chapter 2 errata" thread... A thoughtful item to add to the list on page 24 / section 2.3.1 (not baking metadata into the source code)... In addition to the bullet that a piece of code could be in more than one bundle (btw, I've never been a fan of split packages)...

This is something I've done before, namely a file logger implementing LogService, but as manifested as two services, a regular file logger and an audit file logger, a la declarative services metadata, with extra tag/value filtering metadata...

Hence, a piece of code can be stood up to provide more than one service, simply by the "external metadata" (in my exemplary case above, by the declarative services metadata)...

Speaking of declarative services -- so, the Manifest is a reference to a separate metadata entity (in this case, the ds.xml typically under OSGI-INF.. if memory serves me correctly)...

FWIW, might be of use in the "argument"...
lcphill (4) [Avatar] Offline
#2
Re: Chapter 2: errata
typo, page 35 into 36, section "Exporting Internal Code"

Before: Version management is not a part of standard Java development, but it is inherent is OSGi-based Java development

After: Version management is not a part of standard Java development, but it is inherent in OSGi-based Java development

[ change 'is' to 'in ]
richard.hall (87) [Avatar] Offline
#3
Re: Chapter 2: errata
Fixed the "in", thanks.

Regarding your first comment, while I agree with what you are saying, I am not sure if fits in the list here since this list specifically is talking about modularity related metadata and services are more of a component- or runtime-level concept.
mattvbv (1) [Avatar] Offline
#4
Re: Chapter 2: errata
Hi,

I just finished reading chapter 2 and there is something I don't get.

(2.6.1) In the Paint program example, shouldn't the "shapes implementation" bundle export the "org.foo.shape.impl" package :

Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.foo.shape.impl
Bundle-Version: 2.0.0
Bundle-Name: Simple Shape Implementations
Import-Package: org.foo.shape; version="1.0.0"
Export-Package: org.foo.shape.impl; version="1.0.0"


which is imported by the Paint program bundle ?

Import-Package: org.foo.shape; org.foo.shape.impl; version="1.0.0"

Same for the one-bundle-per-implementation refactoring a bit further :

Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.foo.shape.circle
Bundle-Version: 2.0.0
Bundle-Name: Circle Implementations
Import-Package: org.foo.shape; version="1.0.0"
Export-Package: org.foo.shape.circle; version="1.0.0"


Or did I miss something ?
richard.hall (87) [Avatar] Offline
#5
Re: Chapter 2: errata
Doh! You are correct, these are mistakes in the example in the book. It is correct in the actual code. We will correct these. Thanks.
janvanmansum (4) [Avatar] Offline
#6
Re: Chapter 2: errata
page 46: "In any dependency cannot
be satisfied, then the resolve fails and the instigating bundle cannot be used until its
dependencies are satisfied."

In -> If
janvanmansum (4) [Avatar] Offline
#7
Re: Chapter 2: errata
Another weird thing op page 46 (and some other places in the book) is the "numbering" of items. On page 46 it is

l)
m)
n)

Maybe 1, 2, 3 is more intuitive ? smilie
janvanmansum (4) [Avatar] Offline
#8
Re: Chapter 2: errata
page 52: "These changes divides our paint ..."

divides -> divide

page 53 "The shapes implementastion .."

implementastion -> implementation
richard.hall (87) [Avatar] Offline
#9
Re: Chapter 2: errata
Thanks for point these out, they are all corrected now, except for the numbering stuff. We are using a master document in OpenOffice. The issue doesn't appear in the individual chapters, but in the combined document. I will check for it in the future.
athomson (3) [Avatar] Offline
#10
Re: Chapter 2: errata
Chapter 2, Page 28, Section 2.4.1 "Human-readable information"

The listing is annotated numerically, then these numbers are used in the text following the listing. The numbers are wrapper in parenthesis "(#)", except for '#3'.

This:

"the Bundle-DocURL at #3 allows you"

Should be:

"the Bundle-DocURL at (#3) allows you"


Andy
richard.hall (87) [Avatar] Offline
#11
Re: Chapter 2: errata
Thanks. It is fixed now.
ksangani (3) [Avatar] Offline
#12
Re: Chapter 2: errata
Page 40, Paragraph 4
class cast exception -> ClassCastException

Page 46, Paragraph 1
In any dependency cannot be satisfied -> If any dependency cannot be satisfied

null
richard.hall (87) [Avatar] Offline
#13
Re: Chapter 2: errata
Fixed. Thanks.
schildmeijer (15) [Avatar] Offline
#14
Re: Chapter 2: errata
p.34 the sentence above subsection "EXPORTING INTERNAL CODE."

The sentence says, "Next we will learn how to specify which external code is needed by our bundle", and that implies that the next subsection would be "IMPORTING EXTERNAL CODE".
But thats not the case smilie
richard.hall (87) [Avatar] Offline
#15
Re: Chapter 2: errata
Oops. This is a victim of some section re-ordering. Thanks. It is now fixed.
schildmeijer (15) [Avatar] Offline
#16
Re: Chapter 2: errata
p.32
before: target3; directive:=value1; attribute:value2
after: target3; directive:=value1; attribute=value2
richard.hall (87) [Avatar] Offline
#17
Re: Chapter 2: errata
Fixed. Thanks!