Relation Between Drupal Commerce Line items and Products I am making a website in Drupal 7 and Drupal Commerce with some custom modules. Now, I have a set of Products. 

The Products are, 
 - Product 1
 - Product 2
 - Product 3
I have two line items. Lets say Product Sizes. And product weight. 
Each have select or another module implemented. I have followed the concept of Randy Fay's Screencasts. 
http://www.commerceguys.com/resources/articles/237

http://www.commerceguys.com/resources/articles/238

Now with each line items the cost of the product changes. 
As per the screenscasts, the process will be, 


Create Line Items
Create Products
Create Product Display and add a Product Field Reference to it.
Then it will display the line item in the product display page.


But, I am not creating the Product display. This is going to be via the custom module. So can you tell me from the coding point of view, what is the relation between a line item and a product. So that I can list all the created line items for a displayed product.
It sounds like you are confused.

Short answer:
Line items has a reference to a product.

Explaination
Line items are only used when you add something to your order (cart), they have a relationship between the order and the product and hold data like price quantity, but can hold additional data, like the address (in case of subscriptions), which a unique each time you buy something.

If you have product attributes like size or weight, you probably want to store this on the product, since a products with different sizes and weight should be different products (A S size t-shirt is not the same as a L sized t-shirt).

So it really sounds like you are doing this the wrong way.