Archive for January, 2012

By Mike Hubbartt, © Copyright 2012, All Rights Reserved.

Title: The Object-Oriented Thought Process
Author: Matt Weisfeld
Edition: 1st (2000)
ISBN: 0-672-31853-9
Publisher: SAMS Publishing
Price: $29.99
Length: 226 pages (9 chapters, 2 appendices)

This book, according to the author, is ‘an introduction to fundamental O-O concepts’. It is not a book aimed at people already familiar with OO concepts, so bear in mind it is not intended for people that already understand OO development. I read the first edition of this book in 2000 and enjoyed it, but it sat on my bookshelf until last summer. I had a class in grad school at UST and the professor recommended this book before taking the class so I decided it was time to reread it. I read 3 chapters per day, so it only took 3 days to finish it, even though I took notes from each chapter. Like the 1st ed K&R, this book is not huge – 226 pages including the title page, table of contents, index, and acknowledgments – but it explains how procedural programmers can make the move to OO development. Let’s look at the book chapter-by-chapter.

Chapter 1 – Introduction to Object-Oriented Concepts

This chapter explains classes and objects and how they differ. Encapsulation, one fundamental advantage of OO programming, is covered nicely in this chapter, as is the introduction to the difference between a class interface and implementation, polymorphism, constructors, and overriding.

I liked the code samples included to demonstrate some of the concepts like overriding. I also liked the UML class diagram showing how class elements are displayed via UML – very easy to follow. I would have liked more code samples covers more concepts introduces in the chapter.

Chapter 2 – How to Think in Terms of Objects

This chapter teaches how to think in an OO manner. This chapter goes into the introduction of public interface and private implementation portions of a class. Very nice, clear, simple explanation. Not over or under covered – just enough to introduce the material that will be covered in more depth later in the book.

Chapter 3 – Advanced Object-Oriented Concepts

This chapter covers object creation and initialization, plus error handling. Very good explanation of constructors – what they must and must not have – and how there can (and often should) be more in some classes. Exception handling, which is a topic that could fill a book, is introduced here. There was a bit of source code showing how to use exception in Java code. I liked how the author covered static attributes, which can be used to allow multiple objects to share attributes.

Chapter 4 – The Anatomy of a Class

This chapter explains the differences between the implementation and interface of classes. This is the meat-and-potatoes section of the book. Where a class is broken down using Java to show the implementation and interface sections, as well as constructors. Very clear and my favorite chapter of the book.

Chapter 5 – Class Design Guidelines

This chapter explains that classes must interact and it covers the iterative nature of class design. This goes into design considerations, covering a safe constructor to initialize a class, serializing (deconstruct a object), persistence (maintaining the state of an object), and stubs (minimal implementations of an interface). More good Java code examples, although C++ concepts are also covered.

Chapter 6 – Designing with Objects: The Software Development Process

This chapter explains how to identify class responsibilities and class collaboration. This goes into the way to design an application, covering statements of work, requirements documents, and CRC cards. This was my least favorite chapter of the book – I liked the issues to take into consideration during the OO design process, but I’d rather have more OO concepts than requirements gathering information.

Chapter 7 – Mastering Inheritance and Composition

This chapter covers the differences between composition and inheritance. Very good coverage going into important means of code reuse: inheritance and composition. The author has nice UML diagrams to cover the concepts, and the text explanations are clear and accurate. I also liked how the book explains abstract classes and methods – very clear.

Chapter 8 – Frameworks and Reuse: Designing with Interfaces & Abstract Classes

This chapter covers frameworks and abstract classes vs Java Interfaces. Another good chapter, which covers APIs. I liked the code sample for an abstract class, and the author includes nice UML diagram that demonstrates a interface, inheritance and composition. A short chapter but good material and worth the time spent to read it.

Chapter 9 – Building Objects

This is where you learn how to use objects to build other objects. This goes into both types of composition: aggregations and associations. The author also goes into cardinality (a familiar concept to DB developers). I liked the material here but would gladly give up all of chapter 6 for more information in this chapter. Good, but I’d like more.

Conclusion

A very good book that is well illustrated, deep enough to explain the material without overwhelming someone new to OO development, and a good starting point for more advanced/in-depth books on OO development.I like how the author goes into UML enough, but not too deep to obfuscate the topic of OO development – the appendix is a good starter for people new to UML, but I wouldn’t recommend it as the source for programmers needing to gain more mastery of that topic.

Recommendation

I enjoyed reading it and will pass it along when I find someone that could benefit from it. The most current version of this book is the 3rd edition, which was published in September of 2008. I would recommend this book to undergrad computer science majors that learned to develop with any non-OO language, or for procedural programmers moving on to OO development. I would not recommend this book for an intro to UML

By Ted Bade, © Copyright 2012, All Rights Reserved.

Product: SkyFi Wifi to Serial Adapter
Vendor: Southern Stars (http://www.southernstars.com/index.html)
Price: $149.95

Introduction

SkyFi is another fine product from Southern Stars, who sell SkySafari software for mobile devices and Mac computers, as well as other telescope-related hardware products. SkyFi uses WiFi to connect the RS232 control data flow from a telescope controller to an device (iPod/Phone/Pad apps as well as computer applications).

Setup

Figure 1 - SkyFi

Connecting the SkyFi to your telescope controller isn’t difficult. The package includes a couple of adaptors which will work with the mosre common telescope setups. The connection on the SkyFi itself is an RJ11 telephone jack. You can make a cable that connects the SkyFi directly to your telescope controller, use the included adaptors, or purchase a cable specifically for your computer from Southern Stars. Once connected to the telescope controller, you turn it on and it creates a wireless network.Your remote device needs to be connected to this network and also needs to be running software that can send and receive telescope control and data using the TCP IP. The connection scheme is the same as the one in the previous article. The Southern Stars web site has a nice explanation and pin out of the cables you need, in case you want to make one.

The SkyFi device itself is a bit larger then a cell phone. It is powered by 4 double-A batteries and can accept a power brick as well (6 to 12 VDC). There is no on/off switch, but there is a switch that selects either external or internal voltage source. Switching to external voltage source disconnects the internal batteries. (Which acts like a switch). A piece of velcro can be used to attach the SkyFi to the telescope mount, out of the way of motion. It is very light and once running, you won’t need to adjust it at all.

Once on, the SkyFi makes a wifi hotspot available. Firmware on the device controls the IP address and security. There is a standard IP address which is printed on the SkyFi, but you can change this and security settings if needed. I didn’t bother changing the default settings, as they worked well. I could find no fault with the defaults!

Using the Product

Before you begin using the SkyFi, you need to be sure that the telescope control software you use can communicate to the telescope using TCP IP. I Didn’t know some programs do not support TCP IP. On my MacBook, I have Voyager 4.5 and a copy of Sky Safari Beta that will work. The Starry Night Pro Plus that I like using doesn’t do TCP connections to telescopes. The people at Starry Night were unaware of a solution that would work on the Macintosh. For Windows users there are a couple of shareware applications that create a virtual com port that can be tied to the TCP connection, so I imagine this would work with a Window based machine and Starry Night or any other non-TCP controller application.

Figure 2 - SkyFi with a Telescope

If you are controlling with your i-device, you will need the Southern Stars Sky Safari package. (I am unaware of any other astronomy app that controls a telescope). We looked at these Apps a bit in the last article. In the App’s settings, you choose to use TCP IP to connect to the telescope controller. The default address is the same as the default on the SkyFi. (No surprise there!) Select to control the telescope and you are in control using your iPod/iPad/iPhone.

Working with the Voyager software, I had no issues controlling my telescope computer at all. Commands were instant as was feed back. The only issue I had was with me forgetting to choose the SkiFi network rather then my own home wireless network. You also need to make sure the controller software has the same TCP address that the SkyFi has. In Voyager 4.5, there is a box to enter this address. The default address is printed on the SkyFi device, which is another good reason for keeping to the defaults. However, if you need to change it, you can always re-label the back of the unit.

When I first read about the SkyFi, I thought that it was a wireless device and that it would log onto the local wireless network and make the telescope available on that network. It doesn’t do that. Rather then logging onto an existing network, it creates one of it’s own. So I couldn’t use this device to control my telescope with my desktop computer, since it doesn’t have a WiFi card. Nor would one be able to use it to allow access to the telescope from a remote site. You need to be in range of the SkyFi’s wireless netwrok to connect.

Figure 3 - VSP3 Screen

Since the computer you are controlling the telescope with is connected to the SkyFi network, it won’t be connected to your regular one. While observing I usually listen to Internet radio and I will often pop onto some internet site to inspect images and information about the object I am seeking. So I don’t get to listen to the Internet Radio, but I can still do my research by logging back onto my home network, do the research, then re-connect to the SkyFi. Luckily, this isn’t a big issue. Once the telescope is aimed at an object, the onboard controller takes care of compensating for the movement of the earth. Once connected back to the SkyFi, the data stream identifies the slightly changed location and all is well. It is just an added step in the process.

Conclusion

The biggest issue I had with the SkyFi is that it doesn’t come as a package. You buy the SkyFi and then need to find some compatible software. If the software you already purchased isn’t compatible, then you need to consider this as part of the purchase cost. It would be a whole lot nicer if the SkyFi came packaged with either SkySafari or Voyager. However, if you are into astronomy, you probably already have some package that will work with the SkyFi.

Much to my chagrin, I had expected that using the SkyFi would remedy the tangle of cables that I “need” to deal with when observing. However, I found that I still need to bring an extension cord to power the AutoStar (or use the battery adaptor). Since I had the power cord there, I went ahead and plugged in my MacBook Pro, so I still had the extension cord cable and the power supply cord to the MacBook. Thus, the tripping issue wasn’t really resolved. I suppose I could run the Scope on battery and bring the extension cable to the MacBook Pro, but that would cost me a lot in the battery budget.

As far as distance, the SkyFi does pretty well. I walked around the yard with my MacBook and had to get pretty far away to loose the connection. I think I was able to move slightly father then the expected 100 feet from the device. I was also able to put the MacBook on my dining room table and still control the telescope in the yard. I can see this as a real advantage in the winter as it would give me a chance to warm up between observations.

SkyFi is available through the Southern Star’s web site as well as many other astronomy stores. Southern Star also sells Sky Safari for MacOS X in three flavors, the Plus and Pro versions includes telescope controls ($20 and $50 respectively). The version for the iPod/Phone/Pad can be purchased through iTunes store again, you will need either the Plus or Pro version to control the telescope. In the next installment of this series, I will look specifically at the Sky Safari applications for the Macintosh.

Recommendation

Overall, the SkyFi works very well. If you are looking for a wireless connection to your telescope, this is the device you want. I don’t think there are many other options. I had no issues controlling my telescope using the device. If you have an iDevice and want to control your telescope, this is again a terrific solution.

By Mike Hubbartt, © Copyright 2012, All Rights Reserved.

Spring is a nice Java framework that simplifies J2E tasks, and is in wide use in many real-world business development environments. If you don’t know it and want to do dynamic web development with Java, this is a good time to learn it.

You need a couple of things to do Spring development. A good IDE, Tomcat for local development, and a good database for dynamic content. I enjoy using Eclipse IDEs, so this Spring setup procedure covers Eclipse Indigo.

Spring Configuration

  1. Download and install Eclipse Indigo from http://www.eclipse.org.
  2. Download and install Tomcat 6 from http://tomcat.apache.org/.
  3. Download and install a relational DBMS like MySQL or SQL Anywhere for Developers.
  4. Download the Spring framework with dependencies (for this example, I downloaded Spring 2.5 RC2) from http://www.springsource.org/download and then unzip the file into a folder. I keep all of my Spring files a folder surprisingly called Spring – it holds the Spring framework files and any Spring-specific articles I find to be useful as references.
  5. Download the Spring plug-ins by
    1. Using Help – Install New Software.
    2. At the Install pop-up, select the Add button.
    3. At the Add Repository pop-up, use Spring for the name and http://dist.springframework.org/release/IDE as the location.
    4. Select Core/Spring IDE and Resources/Spring IDE, then press the Next button.
    5. Select the Next button.
    6. Select the ‘I accept…’ licensing option and then press the Finish button.
    7. Restart Eclipse when prompted after the plug-in is installed.
  6. In Eclipse, select File – New – Other, then select Dynamic Web Project, then press the Next button.
  7. Enter a Project Name, then press the Finish button.
  8. You have 2 options: create a WAR directory or use the existing WebContent folder. If you want to use the WebContent folder, skip to step 11, otherwise continue with this step. Create a war directory in the project – this is where non-Java source (.JSPs, XML, etc) are stored. In Eclipse, use File – New – Folder, and enter ‘war’ as the folder name, then press the Finish button.
  9. In the new war folder, create a WEB-INF folder using File – New – Folder just as you did in step 8.
  10. In the new WEB-INF folder, create a lib folder using File – New – Folder just as your in step 8.
  11. Time to configure the build path:
    1. Highlight the project name in the IDE, right mouse click (Mac users use Control-mouse click for the same list), then select build path/configure build path.
    2. At the Properties dialog box, select the Java Build Path option at the left of the dialog, then select the Source tab.
    3. Select the ‘Add Folder’ button, then select the ‘war’ folder – do not select the folders below war, then select the OK button.
  12. Now add 2 JARs to the project.
    IMPORTANT NOTE: Starting with Spring 3.1.0, there is no longer a Spring.jar file, so this process is best used with pre-3.1.0 Spring.

    1. Using Windows Explorer, locate the Spring.jar file, then drag and drop it onto the war/WEB-INF/lib folder in Eclipse.
    2. Using Windows Explorer, locate the commons-logging.jar file, then drag and drop it onto the war/WEB-INF/lib folder in Eclipse.
    3. With the project name highlighted, select File – Refresh from the Eclipse menu options.
  13. You are done – the project is ready to be used as a blank Spring project.