Showing posts with label terminology. Show all posts
Showing posts with label terminology. Show all posts

Wednesday, June 11, 2014

What is a MIME type?

A MIME type is a label for a given type of data so software can know how to handle the data. It serves the same purpose on the Internet that file extensions do on Microsoft Windows.
So if a server says "This is text/html" the client can go "Ah, this is an HTML document, I can render that internally", while if the server says "This is application/pdf" the client can go "Ah, I need to launch the FoxIt PDF Reader plugin that the user has installed and that has registered itself as the application/pdf handler."

Are semantics and syntax the same?

Syntax is the grammar. It describes the way to construct a correct sentence. For example, this water is triangular is syntactically correct.
Semantics relates to the meaning. this water is triangular does not mean anything, though the grammar is ok.
Talking about the semantic web has become trendy recently. The idea is to enhance the markup (structural with HTML) with additional data so computer could make sense of the web pages more easily.

Monday, June 9, 2014

What is “runtime”?

As per Wikipedia: runtime library/run-time system.
In computer programming, a runtime library is a special program library used by a compiler, to implement functions built into a programming language, during the runtime (execution) of a computer program. This often includes functions for input and output, or for memory management.

A run-time system (also called runtime system or just runtime) is software designed to support the execution of computer programs written in some computer language. The run-time system contains implementations of basic low-level commands and may also implement higher-level commands and may support type checking, debugging, and even code generation and optimization. Some services of the run-time system are accessible to the programmer through an application programming interface, but other services (such as task scheduling and resource management) may be inaccessible.

Re: your edit, "runtime" and "runtime library" are two different names for the same thing.

Wednesday, June 4, 2014

What is the difference between Composition and Association relationship?

COMPOSITION
Imagine a software firm that is composed of different Business Units (or departments) like Storage BU, Networking BU. Automobile BU. The life time of these Business Units is governed by the lifetime of the organization. In other words, these Business Units cannot exist independently without the firm. This is COMPOSITION. (ie the firm is COMPOSED OF business units)
ASSOCIATION
The software firm may have external caterers serving food to the employees. These caterers are NOT PART OF the firm. However, they are ASSOCIATED with the firm. The caterers can exist even if our software firm is closed down. They may serve another firm! Thus the lifetime of caterers is not governed by the lifetime of the software firm. This is typical ASSOCIATION
AGGREGATION
Consider a Car manufacturing unit. We can think of Car as a whole entity and Car Wheel as part of the Car. (at this point, it may look like composition..hold on) The wheel can be created weeks ahead of time, and it can sit in a warehouse before being placed on a car during assembly. In this example, the Wheel class's instance clearly lives independently of the Car class's instance. Thus, unlike composition, in aggregation, life cycles of the objects involved are not tightly coupled.

Wednesday, May 7, 2014

What is a Domain Model

Basically, it's the "model" of the objects required for your business purposes.
Say you were making a sales tracking website - you'd potentially have classes such as Customer, Vendor, Transaction, etc. That entire set of classes, as well as the relationships between them, would consititute yourDomain Model.

Tuesday, May 6, 2014

API Endpoint Semantics

According to this WikiPedia article, the endpoint is a web service, defined by a WSDL file, and
does nothing more than define the address or connection point to a web service. It is typically represented by a simple HTTP URL string.
Microsoft uses the term endpoint in various contexts, but they all amount to the same thing: the endpoint is the entire interface, not one particular method.
In the context of a REST endpoint, the endpoint would contain the requisite GET, PUT, POST and DELETE methods (as applicable).

Wednesday, April 2, 2014

What does the term “canonical form” or “canonical representation” in Java mean?

Wikipedia points to the term Canonicalization.
A process for converting data that has more than one possible representation into a "standard" canonical representation. This can be done to compare different representations for equivalence, to count the number of distinct data structures, to improve the efficiency of various algorithms by eliminating repeated calculations, or to make it possible to impose a meaningful sorting order.
The Unicode example made the most sense to me:
Variable-length encodings in the Unicode standard, in particular UTF-8, have more than one possible encoding for most common characters. This makes string validation more complicated, since every possible encoding of each string character must be considered. A software implementation which does not consider all character encodings runs the risk of accepting strings considered invalid in the application design, which could cause bugs or allow attacks. The solution is to allow a single encoding for each character. Canonicalization is then the process of translating every string character to its single allowed encoding. An alternative is for software to determine whether a string is canonicalized, and then reject it if it is not. In this case, in a client/server context, the canonicalization would be the responsibility of the client.
In summary, a standard form of representation for data. From this form you can then convert to any representation you may need.

Monday, March 10, 2014

What is an API?

An Application Programming Interface(API) is often referred to in various contexts making it difficult for non programmers or new programmers to grasp what an API actually is. To make the confusion worse it's meaning has evolved from what it was originally intended to more of a concept or umbrella term. Time to clear up the confusion.
Let me delve into what an API actually is, so no matter your profession you will have a correct and complete understanding of an “API”. We will do this in a few parts. First will get a general but shallow understanding of what an API is. Then we will dissect the word “Application Programming Interface” primarily to understand why it was named such.  Finally we take a look at what a real API might look like and even work with a few very simple API's so you have a practical understanding that will be sure to stick (note: anyone can do this you don't need to be a programmer.)

GETTING A GENERAL UNDERSTANDING OF AN API

wikiAn application programming interface (API) is a specification intended to be used as an interface by software components to communicate with each other.
TaylorAn Application Programming Interface is a set of instructions on how one program can be worked with by another outside program.
So what the heck does that mean? Lets clear this up a bit. As a programmer the way we develop big complex programs is by writing lots of little programs and then putting them all together. For example: Lets say the big program is (the evil) Facebook, a little program that we might need to write so we can use it in the bigger program is a “Poke” program.
The “Poke Program” allows one user to poke another user. The user that is poked is then notified that they were poked and may choose to poke back if the wish.
So to complete the Facebook program we need to write lots of other little programs such as a “like program”, “add friend program”, “login program” , “chat program” and so on. We call all these little programs our library of programs or code library. Once we are done we realize that by letting others use some of our little programs we can grow our facebook platform even more. Facebook does just that and documents and allows anyone the ability to use a number of these little programs.
All of the little programs that Facebook lets others use is known as the “Facebook API”.
I will go into how exactly how “anyone has the ability to use” a little facebook program in the section below.
Facebook API
Screen shot of just a few of the “Little Programs” that make up the Facebook API.

BREAKING DOWN THE WORD “APPLICATION PROGRAMMING INTERFACE”

So to understand the word "Application Programming Interface" we need to back up a second and look at how it originated. So before the web was around, when we talked about programming were were generally talking about either System programming (Windows OS) or application programming (software that ran on top of windows OS, calculators, minesweeper, paint etc...). In order for the application programmers to be able to develop their applications they needed to tap into or interface with the Windows operating system. So naturally Windows offered the .Windows Application Programming Interface. - which was a manual on how application programs could tap into the Windows OS.
As the web and many other technologies evolved the term API seemed to stick even for software and technology that was not specific to the "Application Programming" Context. So now the term API is commonly used to refer to any sort of program to program interface. I'd suggest a better name would be "Program to Program Interface" - but after giving "PPI" a google it looks pretty soundly used - maybe we could take over "PTPI" from these guys http://www.ptpi.org/
Another player that helped the term "API" stick was the commonly referred to "Advanced Programming Interface" also acronym-ed "API". The "Advanced Programming Interface" was a manual on how to work with complex pieces of software.
So there we have it the term "API" is born and brought into the modern age. The common misuse of the word becomes widely accepted and "API" becomes the bona fide term for how one program is able to interact with another program. I will keep pushing for the acronym PPI to become widely accepted..... but I wouldn't hold your breath.

REAL LIFE USAGE OF API'S

So now you should generally understand what an API is, but may not really understand how one can work with or use an “API”. Let's take the facebook API and discuss in detail what it may look like and how one can work with it. So for all of the little programs that make up the Facebook API: “like program”, “add friend program”, “login program” , “chat program”, “poke program” facebook will have a snibbit of documentation. (Every API documentation looks a little different but generally try to follow some common format shown below.)
Lets look at what the “Poke Program” documentation may look like this
NOTE: THIS IS NOT A REAL API JUST AN EXAMPLE
Program name : Poke

Details: “Poke” allows one user to poke another user. The user that is poked is notified of the poke and may choose to poke back.

Usage: When being used the little poke program needs to know the id of the user who is doing the poking and the id of the user who is getting poked.

Description: Poke program may be accessed over http at the following url, the “from_poker” parameter should be a integer and the “to_poker” should be and integer.

Url: http://www.facebook.com/api/poke?from_poker=123&to_poker=234
So if (this were real and) you went to the following url in your browser “http://www.facebook.com/api/poke?from_poker=123&to_poker=234” you would have just made user “123” poke user “234” - Congrats. We will do some real examples in a second.
So this is an example of accessing an API over the web, this is how most API's today are accessed and will generally be what people are talking about when they say “API”. Fun fact -  API's that are accessed over the web are called “Web Services” and use the HTTP protocol.
The cool thing about these API's is that non programmers could potentially work with them (and we will in a moment) as all they have to do is type a URL with some particular parameters into a browser.
There are also other ways of working with API's that require one to write code, but the principle is the same: there is some little program written by party 1 that is now letting party 2 use that program. Example:  The “poke program” may also be accessed in some programming language by including the “facebook code library” and then calling the little poke program.
Include facebook_code_library;

call facebook_poker(123,234);
This piece of code has the same effect as going to the Facebook “Poke URL”,  we simply used a different protocol to work with the API.
So now you should have a good understanding of what an API is even how to work with one. In order to not dumb people down it's worth mentioning that not all API's are accessible over the web, some may only be accessible by using a particular programming language. The windows operation system for example has an API that is very confusing and only accessible through programming languages known by the uberist off Geeks.
REAL LIFE API EXAMPLES
And now the fun stuff - lets look at few Web API's so we can get a feel for how they are used.
First lets take look at this awesome “Zip Code Catcher API” built by some unknown stud developer.
Here is the documentation:
Name: Zip Code Catcher

Description: Lets a user download all the zip codes that lie within a given circle.

Url Parameters:
shape: circle (may be able to take in additional shapes in the future)
center: Is a [lat,lng] points on the earth radius: Is the radius of the circle given in meters.

API Urlhttp://www.woodstitch.com/rest/zip_codes.php?shape=circle&center=[34.08,-118.26]&radius=17455
If you hit that example URL the “Zip Code Catcher” will download all the zip codes within a 17,455m (ruffly 10 mile) radius of the center point [34.08,-118.26] which just so happens to be Los Angeles. You can change the center or the radius to get different results - pretty cool huh.
Here is another cool API that you could use, that allows a user to give a keyword topic as a parameter and then outputs a paragraph of text about that topic. If you want to build your own API just snag some web hosting from this list and start coding out.
Name: Keyword to Paragraph tool

Description: lets the user input a keywords and returns a unique paragraph of content about that keyword

URL Parameters:
pass: “allowme”
keyword: any keyword that the user want a topic on

API URL: http://assets.giverose.com/contentspinner/get_topic_content.php

Examplehttp://assets.giverose.com/contentspinner/get_topic_content.php?pass=openup&topic=big bird

So hit that url and you will see that it gives you a paragraph of unique content about big bird. Pretty Cool huh!
Note:  Some API's such as this one require a password, this gives  the person who owns the API control over how the want other to use their programs. 
I trust that no one will use this API for SPAM or any unethical and shady business practices... O wait thats the only things it's good for. What hack is building these tools anyway :)
I hope after reading this you have a better understanding of what an API is, how they work and are used in day to day business. Questions, comments, feedback and suggestions are welcomed.

Tuesday, March 4, 2014

What is the difference between Java APIs and Java Methods?

API refers to Application Programming Interface, what the rest of the world see and can use.
Method can be part of the public interface or not. But API is really set of methods.
The most common thing related to APIs in java would be Interface which is really set of public method declarations.
Another useful way how to look on API is to take it as contract. Lets take a List interface as an example. It tells you method signatures you can use in a List and in javadoc you see what is the contract (what you can expect and what you need to ensure so the List behaves as expected)

What's the difference between encoding and charset?

Every encoding has a particular charset associated with it, but there can be more than one encoding for a given charset. A charset is simply what it sounds like, a set of characters. There are a large number of charsets, including many that are intended for particular scripts or languages.
However, we are well along the way in the transition to Unicode, which includes a character set capable of representing almost all the world's scripts. However, there are multiple encodings for Unicode. An encoding is a way of mapping a string of characters to a string of bytes. Examples of Unicode encodings include UTF-8UTF-16 BE, and UTF-16 LE . Each of these has advantages for particular applications or machine architectures.

Thursday, February 27, 2014

What is the difference between Serialization and Marshaling?

Marshaling and serialization are loosely synonymous in the context of remote procedure call, but semantically different as a matter of intent.
In particular, marshaling is about getting parameters from here to there, while serialization is about copying structured data to or from a primitive form such as a byte stream. In this sense, serialization is one means to perform marshaling, usually implementing pass-by-value semantics.
It is also possible for an object to be marshaled by reference, in which case the data "on the wire" is simply location information for the original object. However, such an object may still be amenable to value serialization.
As @Bill mentions, there may be additional metadata such as code base location or even object implementation code.

Saturday, February 22, 2014

Understanding domain objects/services

Different people use these terms in somewhat different ways, but here's my take:
1) "Business" and "domain" are roughly synonyms. "Domain" is a bit more general in that it doesn't make the assumption that you're writing a business application. So if we were writing a scientific app or a game, we might prefer to refer to the relevant part of the code as "domain" code rather than "business" code. So in the remainder of this explanation I'll use "domain" since it's more general.
2) "Domain logic" comprehends both "domain objects" and "domain services". For various reasons (technical and otherwise) many architectures employ a design where the domain logic is divided into objects for storing data ("domain objects") and objects that manipulate those ("domain services"). Martin Fowler and others have pointed out that that's not very OO since a big part of the OO concept is to put functionality together with data, and that's right, but it is what it is. Domain objects are the data and domain services are the do-stuff-with-the-data part.
3) In domain-driven design, the idea is to get back to true OO design, and so the various service methods make their way back to the domain objects so that you have objects in the OO sense rather than what are sometimes called "anemic" objects. In a DDD the domain objects themselves are more robust and so they form the domain logic. In reality there may still be some domain services too, but this is typically smaller in a DDD than in a more traditional domain objects vs. services model.

Tuesday, August 6, 2013

What is a handler

A handler is a routine/function/method which is specialized in a certain type of data or focused on certain special tasks.
Examples:
Event handler - Receives and digests events and signals from the surrounding system (e.g. OS or GUI).
Memory handler - Performs certain special tasks on memory.
File input handler - A function receiving file input and performing special tasks on the data, all depending on context ofcourse.

Friday, July 26, 2013

Java EE Security Realms

A realm is a credential store that enables identity or role based access control.
What is a realm?
For a web application, a realm is a complete database of users and groups that identify valid users of a web application (or a set of web applications) and are controlled by the same authentication policy.
The Java EE server authentication service can govern users in multiple realms. In this release of the Application Server, the file, admin-realm, and certificate realms come preconfigured for the Application Server.
In the file realm, the server stores user credentials locally in a file named keyfile. You can use the Admin Console to manage users in the file realm.
When using the file realm, the server authentication service verifies user identity by checking the file realm. This realm is used for the authentication of all clients except for web browser clients that use the HTTPS protocol and certificates.
In the certificate realm, the server stores user credentials in a certificate database. When using the certificate realm, the server uses certificates with the HTTPS protocol to authenticate web clients. To verify the identity of a user in the certificate realm, the authentication service verifies an X.509 certificate. For step-by-step instructions for creating this type of certificate, see Working with Digital Certificates. The common name field of the X.509 certificate is used as the principal name.
The admin-realm is also a FileRealm and stores administrator user credentials locally in a file named admin-keyfile. You can use the Admin Console to manage users in this realm in the same way you manage users in the file realm. For more information, see Managing Users and Groups on the Application Server.
http://stackoverflow.com/questions/9311353/java-ee-security-realms

Tuesday, June 11, 2013

Fully qualified path Vs. Canonical Path

"Fully-qualified path" is synonymous with "absolute path"

  • "Fully-qualified" and "absolute path" mean the same thing - a path that is not relative to an implied or specified context.
  • Every path is either a fully-qualified path or else it is a relative path
  • Every location on a file system has a multitude of paths that could be used to refer to it, including numerous fully-qualified paths:
    • C:\temp.txt
    • C:\Program Files\..\temp.txt
    • C:\Program Files\Microsoft\..\..\temp.txt
    • etc.
  • Conceptually speaking, one of those fully-qualified paths is the simplest, most straightforward way of specifying that resource - that's your canonical path.
For a file or directory, does fully-qulified path exist only one thing? -like canonical path.
No, a fully-qualified path is any path which is not a relative path (not relative to the current directory of the implied or specified context). Multiple, but distinct, fully-qualified paths could refer to the same location on the filesystem. Reread:
but substitute "fully-qualified" everywhere it says "absolute".
To be clear, some people will also use the term "relative path" to also refer to a path with a "relative reference" (double dots ..) within it. For example, some might might called C:\Program Files\Microsoft\\..\temp.txt a "relative path" because of the double dots, but I would call it an fully-qualified path with a relative reference. Hopefully, it will be clear from the conversation what they mean when they say "relative path" (a path that is relative to a context or a path with a relative reference in it).
Are both of them totally same concepts?
No, as indicated in the other SO question, there are lots ways to specify a fully-qualified path (absolute path) to a location, but only one of those fully-qualified paths is considered to be the canonical path to that location.
One more thing, Is a UNC path belong to fully-qualified path too?
Yes, UNC paths are not relative paths; they are fully-qualified paths. - http://msdn.microsoft.com/en-us/library/aa365247(v=VS.85).aspx#fully_qualified_vs._relative_paths
Is a symbolic link or a hard link belong to Fully qualified path?
Its an independent concept. A path (regardless of whether it is relative or full-qualified) leads to a location in the filesystem. The entity at that location could be one of many things: a normal file, a directory, a symbolic link, a hard link, a device, a named pipe, etc. A symbolic links or a hard link has meta-data that leads to the data you were actually looking for at that location.

Analogy Time

You can think of paths and links in the terms of directions to someone's house:
  • relative path is directions from your current location
  • fully-qualified path is directions from town-hall, regardless of where you are
    • In our strange little town of Unixville, everyone agrees and understands implicitly that "fully-qualified directions" always start at town-hall, strangely enough, a buidling that everyone calls "/".
    • The next town over (Windowsville) has multiple town halls (one for each part of town), calledC:\D:\E:\, etc.
    • Different people might give you different directions (paths) to get to the same house, even if they all start from the same starting point (townhall) - some directions will be more direct than others.
  • canonical path is the fully-qualified directions that is the simplest, most straightforward means to get from townhall to the desired house
  • symbolic link is like a empty lot with a note that gives directions to a forwarding address
    • the type of directions that led you here (whether they were relative directions, fully-qualified directions, or even the canonical fully-qualified directions) has no bearing on whether it leads to a house or any empty lot with forwarding direction here
    • there's a strange case where one of the streets in your direction is actually a symbolic link (a detour? a portal?) - the analogy falls apart here if we look too closely at it, so lets just ignore it :-)
  • hard link is a house accessible from two or more different addresses.
    • Think of a house on the corner of Elm Street and Main Street. The post office mistakenly gave it two addresses : 10 Elm Str and 20 Main Str. No matter which address you go to, you end up at the same house.
    • In our strange little town, these hard-link houses can have multiple addresses and the addresses don't have to be anywhere near each other.
    • No matter which of its addresses you go to, its the same house. Its not a copy, its not a forwarding address. Just magically, once you go inside, you end up in the same house, regardless of which address you used to get there.
    • the directions that led you to the house (no matter which address was used or whether the directions were relative directions, fully-qualified directions, or even the canonical fully-qualified directions) has no bearing on whether the house at that address is a hard-link house or not
Addendum
Edit
I asked someone who maintains Naming Files, Paths, and Namespaces page to let me know this. And he replied me.
Is this also Fully-qualified path? C:\directory..\directory\file.txt
I wonder what terms the maintainer of that page would use to differentiate between ..\file.txt andC:\directory\..\directory\file.txtsince he calls them both relative path. I agree that double dots are a relative reference, but I wouldn't tag the whole path as relative because it has double dots in the middle of it. In his terminology, there doesn't seem to be a difference between fully-qualified and canonical. (Therein, I suppose, lies the source of your question).
I come from a Unix and Java background, so perhaps that makes the difference. As I learned it:
  • relative/partially-qualified - location cannot be determined without the associated context providing information, e.g. the current working directory, the current drive, the drive's current directory, the shell PATH setting, the Java CLASSPATH setting, or the referencing URL.
  • absolute/fully-qualified - location is independent of the the associated context, i.e. the location is the same regardless of the current working directory, the current drive, the drive's current directory, the shell PATH setting, the Java CLASSPATH setting, or the referencing URL.
  • canonical - the simplest fully-qualified, i.e. no double-dots
So
  • ..\file.txt - relative
  • C:\directory\..\directory\file.txt - fully-qualified
  • C:\directory\file.txt - fully-qualified and canonical
That section of the MSDN page isn't clear on C:\directory\..\directory\file.txt: IfC:\directory\..\directory\file.txt is considered relative and won't work with Windows API that say they need a fully-qualified (but not necessarily canonical?) path, I'd suggest that page needs to make that clearer.
Fully-qualfied vs Relative
A file name is relative to the current directory if it does not begin with one of the following:
... * A disk designator with a backslash, for example "C:\" or "d:\". ...
Since C:\directory\..\directory\file.txt starts with a disk designator with a blackslash, this path is fully-qualified, not relative.
A path is also said to be relative if it contains "double-dots"; that is, two periods together in one component of the path. This special specifier is used to denote the directory above the current directory, otherwise known as the "parent directory". Examples of this format are as follows:
  • "..\tmp.txt" specifies a file named tmp.txt located in the parent of the current directory.
  • "....\tmp.txt" specifies a file that is two directories above the current directory.
  • "..\tempdir\tmp.txt" specifies a file named tmp.txt located in a directory named tempdir that is a peer directory to the current directory.
I interpreted the phrase contains double dots to mean leading double dots. The examples show only leading double dots. The terminology "current directory" usually means process's current working directory or the drive's current directory, which has bearing only when talking about leading double dots. I can, however, see how the section could be interpreted the other way.
Regardless, everyone grows up different and context is king, so I guess everyone will need to be careful of the nuances when reading docs or discussing with engineers of different backgrounds on what they mean by "fully-qualified" vs "relative"

Wednesday, June 5, 2013

What is the difference between application server and web server?

Most of the times these terms Web Server and Application server are used interchangeably.
Following are some of the key differences in features of Web Server and Application Server:
  • Web Server is designed to serve HTTP Content. App Server can also serve HTTP Content but is not limited to just HTTP. It can be provided other protocol support such as RMI/RPC
  • Web Server is mostly designed to serve static content. Though most of the Web Servers are having plugins to support scripting languages like Perl, PHP, ASP, JSP etc. through which these servers can generate dynamic HTTP content.
  • Most of the application servers have Web Server as integral part of them, that means App Server can do whatever Web Server is capable of. Additionally App Server have components and features to support Application level services such as Connection Pooling, Object Pooling, Transaction Support, Messaging services etc.
  • As web servers are well suited for static content and app servers for dynamic content, most of the production environments have web server acting as reverse proxy to app server. That means while service a page request, static contents such as images/Static html is served by web server that interprets the request. Using some kind of filtering technique (mostly extension of requested resource) web server identifies dynamic content request and transparently forwards to app server
Example of such configuration is Apache HTTP Server and BEA WebLogic Server. Apache HTTP Server is Web Server and BEA WebLogic is Application Server.
In some cases the servers are tightly integrated such as IIS and .NET Runtime. IIS is web server. when equipped with .NET runtime environment IIS is capable of providing application services.