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
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

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).

"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 ?

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

org/bar/ <--------------------------------- org/foo/bar ?
org/foo/bar/Bar1.class <--------------------------------- or org/bar ?
org/foo/bar/Bar2.class <--------------------------------- and org/bar ?

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

" 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.

'For example, if your bundle
wants to expose and, then it is only necessary to declare a
dependency on

to export no ?

" 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"


"Bundle-ManifestVersion: 2
Bundle-Version: 2.0.0
Bundle-Name: Simple Shape Implementations
Import-Package:; version="1.0.0"
Also :
Export-Package :; version="1.0.0"

"Bundle-ManifestVersion: 2
Bundle-Version: 2.0.0
Bundle-Name: Circle Implementations
Import-Package:; version="1.0.0"
Export the circle package also

"Bundle-ManifestVersion: 2
Bundle-Version: 1.0.0
Bundle-Name: Simple Paint Program
Import-Package:; version="1.0.0"
Alos export

"making them able and to observe and react"
Remove and ?

'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 ?

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

"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* ...

" 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 ...

" 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 ?

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

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

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

sorted set ?

Hope this could be useful for the authors and kudos for the book (and the subject) smilie
richard.hall (87) [Avatar] Offline
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.