OSGi Sunum

0

Gerçekleştirdiğim OSGi hakkındaki sunuma ait belgeye buradan ulaşabilirsiniz. Gerçi anlatım ağırlıklı olmasını amaçladığım için belgeyi çok kısa tutmuş bulundum, o yüzden sunum olmaksızın fazla anlam ifade etmeyebilir, ancak yine de konu başlıkları ve genel bir fikir vermesi açısından incelemek isteyebilirsiniz. İstemeye de bilirsiniz (bu kelime böyle mi yazılır, emin olamadım şimdi bak..).

[ Uzun zamandır yazmadığım için bu sunum vesile olsun istedim ama yazmayı unutmuşum neredeyse, idare edin :) ]

 

Şehitlerimiz anısına

0

Dünya tarihinde eşi benzeri görülmedik bir fedakarlık ve vatanseverlik örneği olan Çanakkale zaferinin yıldönümünde, Mehmet Akif’in eşsiz dizelerinden, aziz şehitlerimizin anısına..

(more…)

Share

Konsol için Python sözlük

0

Linux‘da terminal kullanırken gerekli durumlarda sözlük için internetten arama yapmak gereksiz vakit kaybına neden oluyor. Bunu engellemek için yine terminal üzerinden arama yapmak amacı ile basit bir script yazayım istedim. Aşağıdaki script, sözlük için severek kullandığım tureng sitesinden sayfayı tarayarak ilgili sonuçları listeliyor.

HTML dosyasını işlemek için BeautifulSoup kütüphanesini kullandım, script Python 2.6 ve Ubuntu 10.10 ile düzgün çalışır durumda.

Share

Wish you were here, Annotation …

0

I want to share a quick tip about preserving annotations in subclasses. First, the problem:

When you define an annotation, it will only be available for the target you define, unless you explicitly tell it to do more.

For example, you may have an annotation like this one:

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Bean {
  // ...
}

and a class that using it :

@Bean
public class MyBean {
   // ...
}

When a class that extends the one above comes to a code that searches for the annotation, code will find none, if the annotation is defined in this way. Cause the following code will result in “false”. (more…)

Share

SimpleAssist: A basic “aspect like” library

108

Bytecode manipulation is something that we can use for lots of reasons. Especially for the ones that named as “cross-cutting concerns“, explained as “parts of a program which rely on or must affect many other parts of the system. They form the basis for the development of aspects. Such cross-cutting concerns do not fit cleanly into object-oriented programming or procedural programming” in wikipedia(*). Examples of such concerns can be given as, authentication, transaction management, caching, monitoring, persistence, logging, etc.

Bytecode manipulation gained popularity along the years. There are lots of libraries that enables us to change the behaviour of compiled code at runtime. BCEL (Byte Code Engineering Library), Javassist and ASM are some of them. Even a programming approach has emerged based on this concept: AOP (Aspect Oriented Programming).

What I would like to mention you about is a simple library that I wrote: SimpleAssist.
(more…)

Share

Top Ten Reasons Why Large Companies Fail To Keep Their Best Talent

42

I’ve read an article on Forbes.com which mentions about large companies that fail to keep their talented people. Since I think it contains lots of good points about the reasons, I wanted to share it here.

Here are the reasons listed in the article :

1. Big Company Bureaucracy.
2. Failing to Find a Project for the Talent that Ignites Their Passion.
3. Poor Annual Performance Reviews.
4. No Discussion around Career Development.
5. Shifting Whims/Strategic Priorities.
6. Lack of Accountability and/or telling them how to do their Jobs.
7. Top Talent likes other Top Talent.
8. The Missing Vision Thing.
9. Lack of Open-Mindedness.
10. Who’s the Boss?

You can read the complete article here.

Share

Using enum as key for map: EnumMap

337

Enum is a useful programming construct that introduced in Java version 1.5. Since then I use enums heavily cause it gives much more opportunities especially compared to constant values. Some of these advantages can be counted as being type safe, providing additional methods (such as values(), valueOf(..), name(), ordinal() ..) and abilitiy to use as a normal class and match with additional values.

One of the practices that I like to do with enums is using them as a map for constant keys. Consider following example :

public enum DbKeys {
    USER, PASSWORD, URL, MIN_CONNECTION, MAX_CONNECTION;
}

This enum can be used as a key for database connection property values. A property file may have a content like this :

db_connection.properties

user=admin
password=admin
url=jdbc:oracle:thin:@host:1521:db
min_connection=10
max_connection=100

These properties can be parsed with help of the DbKeys enum class. Here, I want to mention about the EnumMap class. Actually I was about to write my own implementation of EnumMap cause I was not aware of existence of the java.util.EnumMap class. Since we are aware from now on, we will use this implementation. (more…)

Share

Bash içerisinde vi kullanımı

46

Bugün ihtiyaç üzerine bash betikleri içerisinde vi ile bir ifadeyi değiştirme işlemini aradım ancak uzun süre aradığım işleme ulaşamadım. Burada hem not olması hem de başkalarının da işine yarayabileceği düşüncesi ile aktarmak istiyorum:

vim '+%s/replace_me/with_this/g' '+wq' file.txt

Normalde ifade değiştirme işlemleri için sed daha uygun olsa da, aynı dosyayı değiştirmek istediğimizde vi daha kullanışlı olabiliyor. Bir dizin altındaki tüm dosyaları değiştirmek için ise aşağıdaki gibi bir ifade kullanılabilir :

find -name "pattern" -exec vim '+%s/replace_me/with_this/g' '+wq' '{}' \;
Share

Linux kaçar ! (proxy’den kurtuluş)

43

Bilgisayar dünyası ile yüzeyselin ötesinde ilgisi olan, hele de hayatını bu sektörden kazanan hemen herkesin yolu mutlaka bir gün Unix ile kesişecektir. Ya da benim kanaatime göre kesişmelidir. Zira Unix, yapısı, tasarımı, esnekliği, sağlamlığı ve günümüze kadar ulaşan başarısı ile her alandan bilişimciler ve yazılımcılar için güzel bir örnek ile birlikte güçlü bir çalışma ortamıdır. Unix ile ilgili önyargılardan birisi, kullanımının zor olduğu ve kullanıcı dostu olmadığı şeklindedir. Bu kanaate karşı ise aşağıdaki sözü hatırlatmak istiyorum :

Unix *is* user friendly. It’s just selective about who its friends are.


Unix
‘in seçici olması gibi, işletim sistemi konusunda seçici olanlar ve window$ tekeline mahkum olmak istemeyenler, kullandıkları ortama gerçekten hakim olmak; esnek, güçlü, güvenli ve özgür bir işletim sistemi kullanmak isteyenlerin tercihi ise Unix, yani daha doğrusu güncel anlamda, Linux oluyor.

Linux konusunda detaylı bir yazı yazacak değilim, belki ilerleyen yazılarda bu konudan bahsedebilirim, ancak bu yazının konusu Linux‘un bizzat kendisi değil, onu özgür kılmak ile ilgili olacak. (more…)

Share

OSGi: An Introduction

125

OSGi, created for Java-based systems, provides a framework for modular systems. OSGi makes it possible to define the dependencies of each individual module with the others and enables users to control the lifecycle and dynamically change each component of the system. OSGi is a specification and the most common implementations can be counted as Equinox, Apache Felix and Knoplerfish. In this article, I will try to give an example of creation of a simple OSGi bundle in Equinox.


OSGi Structure

Basic OSGi structure can be seen in figure on the right side. OSGi implementations sits on the top of the JVM and provide mechanisms for service management, component definition, execution, management and life cycle control of modules. The most essential OSGi concepts are described below:

Bundle
In OSGi systems, the components that builds the structure are given the name, “Bundle“. On the deployment stage, each OSGi bundle is a jar file. But the main difference of bundle jar files with regular ones can be counted as the OSGi specific manifest definition and some OSGi specific classes. We will discuss these differences in oncoming sections and in the example.

Services
Services provide the interaction between the bundles of the structure. Services are exposed as interfaces and registered with an implementation that performs that interface. In parallel with SOA structure, the being of access through OSGi services makes OSGi based systems more loose-coupled compared to regular jar based java structures. These structure also makes it possible to change change components of the system in runtime.

OSGi implements a service directory for services to be registered and accessed through. OSGi also provides mechanisms for management of the services. (more…)

Share
Go to Top