1 / 3
Caption Text
2 / 3
Caption Two
3 / 3
Caption Three margin testing

Wednesday, June 10, 2009

Using packages for code organization - Flex best practices

Flex best practices – Part 1: Setting up your Flex project | Adobe Developer Connection

Follow the best practices below on using packages for code organization:

checkmarkUse packages to organize and structure your projects codebase.

Packages are the standard for OOP-based applications. Packages represent logical groupings of related ActionScript and MXML files in the form of classes. The use of packages and classes is fundamental to object-oriented programming.

To continue with community standards, use the following practices for naming your packages:

checkmarkUse lowerCamelCase.

For example: com.seantheflexguy.stringUtils

checkmarkBegin the package name with the top-level domain (TLD) of the application's owner:

for example, com, net, us;

then use the application owner's name:

for example: seantheflexguy, adobe;

then the project name:

for example: burrow;

then the logical grouping of related code files:

for example: utils, components, or whatever is appropriate.

Here's an example of a package name using this convention:

com.seantheflexguy.burrow.view

Integrating unit testing - Flex best practices

Flex best practices – Part 2: Development practices | Adobe Developer Connection

Unit testing can ensure the quality of your codebase. Writing test cases can lead to more reliable and better code. Testing your code will help find errors and save debugging time. Here are a few best practices that can be applied when implementing unit testing.

checkmark Test behavior instead of testing methods

Writing code to test private methods is not always needed. This should be evaluated on a case by case basis. Write code to test against an object's public API. Typically private methods are used internally by a class to support its public API.

checkmark Apply the "too simple to break" rule

Don't over test the codebase. If the method is a very simple one line method, like a getter method, don't worry about writing a test case for it.

checkmark Use standard OOP best practices in test cases

Follow the same OO methodology you use to write the rest of your application. Refactor test cases to move common functionality into base classes as appropriate.

checkmark Use clear and concise test method names

Follow the same method naming conventions used elsewhere in the application's codebase. Avoid generic names for test case methods. This helps other developers easily understand the relationship, responsibility, and purpose of the method.

checkmark Write simple test case methods

Keep test cases simple and limit the decisions that are made within them.

checkmark Use static values in the assertion method calls when possible

This reduces the chances for error in your test cases and improves the maintainability and understandability of the test code.

checkmark Document the test code

Add comments that explain what is being tested and why. Also, outline any special circumstances regarding the test.

checkmark Create independent unit tests

Each unit test should execute a single behavior for each method.

checkmark Limit assertions to one per test case

Multiple assertions in a single test case can lead to performance issues. In addition, if one assertion fails the other assertions will not be executed until the first assertion passes.

Application development frameworks - Flex best practices

Flex best practices – Part 2: Development practices | Adobe Developer Connection

Using a framework you will greatly increase your chances of success, especially if your application contains a substantial amount of source code.

checkmark Consider using an application development framework

There is some disagreement about whether or not frameworks should be used when developing Flex applications. For enterprise level applications, as well as in teams of developers, frameworks are more generally recommended. My personal preference and recommendation is to use an application development framework. This enables a common language for the architecture of a codebase and provides direction for application development and scalability.

checkmark Use frameworks for team-based development efforts

Frameworks help teams to work together in a unified effort and can reduce the chances of duplicating development efforts.

checkmark Mate

Mate (pronounced "mah-tay") is a tag-based application development framework created for use with Flex. Mate is an unintrusive framework that allows for a loosely coupled codebase.

checkmark Cairngorm

Cairngorm is the de facto standard for Flex application development. If you don't already know Cairngorm you should definitely consider learning it. For more information on Cairngorm, check out this great Introducing Cairngorm article. Adobe Consulting uses Cairngorm and fully stands behind it for their development efforts.

checkmark PureMVC

This is a pure ActionScript 3.0 Model-View-Controller application development framework. Futurescale, the makers of PureMVC, describe it as follows: "PureMVC is a lightweight framework for creating applications based upon the classic Model-View-Controller design meta-pattern… The PureMVC framework has a very narrow main goal: to help you separate your application's coding concerns into three discrete tiers; Model, View and Controller."

checkmark Other frameworks

There are numerous other application development frameworks that can be used in conjunction with Flex or even just straight AS3 projects.

checkmark Know when NOT to use a framework

There are times when a framework is simply overkill for an application. If you are the sole developer of an application and you will be the only developer of the application for its lifetime, then you may not benefit from a framework. If you're developing something very simple, such as a banner ad, you can also skip the framework. The robust feature set offered by an application development framework is often not needed for very simple applications with limited data manipulation and minimal events. For another perspective, see this classic blog post by Steven Webster on the topic of when and when not to use an application development framework.


Application architecture - Flex best practices

Flex best practices – Part 2: Development practices | Adobe Developer Connection

Flex applications are complex systems that greatly benefit from thoughtful planning. Use proven methodologies to ensure the application being built is structurally sound.

checkmark Create use cases

Generate use cases for each goal or task in the application. Define the use cases from the perspective of an Actor. Typically, an Actor is simply a user of the application you are building. A use case can be created around any interaction that a user performs. Actors can also be the application itself, another application, or an outside system such as a web server.

checkmark Consider using UML

Describing the application's main classes and data model using the Unified Modeling Language (UML) can help refine the objects in your application and avoid potential rework to the code later.

checkmark Consider using code generation

There are a number of tools that will generate ActionScript 3.0 source code from UML diagrams. This can save time in some cases. Two tools worth investigating are Enterprise Architect from Sparx Systems and the free Violet ActionScript 3 Generator (VASGen).

checkmark Consider using design patterns

Two great books to have in your library are: Design Patterns: Elements of Reusable Object-Oriented Software and Head First Design Patterns.

Q&A: What’s in a Linux Name?

Q&A: What's in a Linux Name? - Gadgetwise Blog - NYTimes.com

June 9, 2009, 1:49 pm
By J.D. Biersdorfer

Question

Why does Linux seem to have multiple choices in operating systems, such as Ubuntu or Slackware, and where do the names come from?

Answer

First created by the Finnish programmer Linus Torvalds in 1991, Linux still maintains its open-source status today. This means that unlike a closed system (Microsoft Windows, for instance), the underlying source code for Linux is open for programmers to tinker, enhance and improve. With 18 years of programmers fiddling with the system, variations — commonly known as distributions — of Linux have naturally popped up.

The name of a particular distribution comes from its creator, so these can range from serious to silly, depending on who's doing the naming. Ubuntu, a community-developed Linux distribution sponsored by Canonical Ltd., gets its name from the Zulu word that roughly means "humanness" or "a person is a person through other people."

Slackware Linux, originally a side project by its creators, takes its name from the concept of slack as defined by Church of the SubGenius (the "religious" group that satirizes religion, among other things) as a sense of independence, originality and freedom.

Another popular Linux distribution, Debian, gets its moniker from its developer's wife and his own name: Debra + Ian = Debian. At least one blogger has compiled a list of Linux-name origins and sites like DistroWatch and Linux.org have information on the many Linux distributions out there as well.

Open source, digital textbooks coming to California schools

Open source, digital textbooks coming to California schools - Ars Technica

The cash-strapped Golden State has decided that, starting next school year, schools will be able to use open source, digital textbooks for a number of math and science subjects. Ars talked with Brian Bridges, the Director of the California Learning Resources Network, which will be reviewing the texts, to find out more about what the program entails.

Featured Post

Windows和Ubuntu双系统完全独立的安装方法

http://www.ubuntuhome.com/windows-and-ubuntu-install.html  | Ubuntu Home Posted by Snow on 2012/06/25 安装Windows和Ubuntu双系统时,很多人喜欢先安装windows,然...