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.

jawher (1) [Avatar] Offline
#1
Hi,
I've nearly finished reading the first 4 chapters, and I thought maybe I post some feedback here smilie
(sorry for the terse style smilie)

1.4.2 :
Maybe add that you need to import org.osgi.framework smilie


2.3.1
Maybe add that another advantage is that you do not need to load classes into the JVM to retrieve the metadata. As an example, Eclipse and plugin.xml (Eclipse can show up the list of all available views without needing to load the hundreds of plugins installed).

2.4
"Attribute groups are created by placing them on one line after the other in the manifest file."
Not very clear ... maybe say a blank line ?

2.4.3
"it searches it for a “static void main(String[])”"
add public ?

(p31)
"META-INF/MANIFEST.MF
org/
org/foo/
org/foo/Main.class
org/foo/Foo1.class
org/foo/Foo2.class
org/bar/ <--------------------------------- org/foo/bar ?
org/foo/bar/Bar1.class <--------------------------------- or org/bar ?
org/foo/bar/Bar2.class <--------------------------------- and org/bar ?
"

(p32)
"The class path is typically a set of JAR files"
It can also contain exploded class files no ?

(p33)
" Bundles declare their internal class path using the Bundle-ClassPath manifest header.
The value of Bundle-ClassPath is an ordered comma-separated list of files relative to the
root of the bundle JAR file. One exception to this definition is when you want to refer to the
bundle JAR file itself, in that case you use the “.” character
"

IIMHO, I think that it should say "a list of files *and locations* ..."
and thus making the "One exception ..." part no longer valid.

(p35)
'For example, if your bundle
wants to expose org.bar.Bar1 and org.bar.Bar2, then it is only necessary to declare a
dependency on org.bar.
"

to export org.bar no ?

(p3smilie
" This statement declares an import for package org.osgi.framework for the version
range including 1.3.0 and up to, but excluding 2.0.0"
maybe add "and up" in the end ? : "... but excluding 2.0.0 and up"

2.6.1
(p53)

"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"
"
Also :
Export-Package : org.foo.shape.impl; version="1.0.0"

(p54)
"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 the circle package also

2.6.3
(p57)
"Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.foo.paint
Bundle-Version: 1.0.0
Bundle-Name: Simple Paint Program
Import-Package: org.foo.shape; version="1.0.0"
"
Alos export org.foo.paint

3.3.
(p63)
"making them able and to observe and react"
Remove and ?

3.4.1
(p66)
'For example, in the case of the bundle
activator, start() and stop() are guaranteed to be serialized, but they still might be
executed by different threads
"
What does serialized mean ?

3.6.3
(p8smilie
" For know, we assume that
we can get the service by a call to a getStartLevelService() method.
"
For now :p

3.7.1
(p95)
"If no bundles are specified, the graph is computed
starting with bundle updated or uninstalled since the last call to this method.
"

starting with bundle*s* ...

(p97)
" One of the gotchas people run into when it comes to updating bundles is that after the
update the old classes of a bundle *still are* being used.
"
Shouldn't are and still be swapped ? : are still being ...

3.8
" The approach we are going to take is actually a well known pattern in the OSGi world
called the extender pattern. The idea is that a base application can be extended by
extensions (hence, the name) that are provided by other bundles
"
IMHO this is the base idea behind modularity/extensibility
Wouldn't the extender pattern be when a bundle makes actions (generally setup/config) on behalf of another bundle instead ?
http://www.osgi.org/blog/2007/02/osgi-extender-model.html


"DefaultShape Listing"
=> Maybe talk more about the bundle.loadClass, and how and why the usual Class.forName won't wok ?

(p103)
"As you can see in figure xx, from here, we can simple start the paint
bundle which will give us the paint frame.
"
simply

4.3.2
(p12smilie
"The first problem requires the use of a
sorted map and relies on the natural ordering
"

sorted set ?

<<EOF>>
Hope this could be useful for the authors and kudos for the book (and the subject) smilie
Cheers
richard.hall (87) [Avatar] Offline
#2
Re: Some feedback on the first 4 chapters
Thanks for the feedback, it is definitely helpful. We will make sure all issues are addressed in some fashion.