Online store. “Divide and conquer” or “OO already here”

    And why do not you, colleagues, join the online shopping?
    Fearfully? That's the same thing, and I'm scared. And here we talk about how to overcome our fears. Using ... an object-oriented approach.

    At the end of this annual congress, he spoke to the gathered, with a broad imperious, magnificent wave of his hand, pointing to the huge map of the United States, which covered the entire wall
    behind him, and said this:
    “Here it is, your market! Go and sell!
    Thomas Wolfe, “No Return Home”


    One of my acquaintances, the Internet creator, very cleverly makes money on all kinds of descendants of the banner system. Sites, advertising, citation ratings ... Once I asked him - why don't you make your own online store (hereinafter - “IM”)? Like, incomes are many times higher. In response, he was silent for a moment and said it was difficult.

    Blocks and Interfaces

    Yes, it's complicated. But in my opinion there is a way to solve problems on the path to becoming an online store. This is the classic "Divide and Conquer" - "Divide and Conquer", used, in particular, in object-oriented programming. We divide the circuit into weakly dependent blocks and connect via interfaces. The interface implementer can subsequently be changed at one’s discretion without affecting the process as a whole. So, look at the diagram below.

    Use Case online store diagram

    Here we see blocks on one side of the barricades: Promoter, Warehouse, Seller, Courier. On the other side is the Client. And, with an attempt to neutral Switzerland, - Payment system.

    What to do with these blocks?

    First, make them support certain interfaces. It was called a warehouse - please, implement support for the GetItemsList () and ReserveItem () methods. Yes guys, yes. Excel time I passed, I have to put a server, buy software and pull the dedicated. Otherwise they will buy from someone else.

    By the way, for each block this interfacing is quite feasible by the forces of one person . Even I personally take it.

    We construct

    IM Now we will try on one person the possibility of creating IM .

    So, a new future internet marketer is coming forward. Suppose he has already bought the domain RussianVegetables.com. Then he selects from the list of vegetable stores the most suitable for him. For example, at prices ( there is one small bonus here, but we will talk about it in the next article ).

    Let's go further. Will we unwind ourselves? If not, then we are looking for a promoter, explain the scheme to him and send him a promotion.

    So, the buyer came to us. He looked at the list of goods from the Warehouse. And ordered a bag of feed turnip. At the same time, he filled out the delivery form. By the way, it was not even written by us at all. We simply inserted the call form provided by the courier interface. The buyer made payment through an external Payment system. We booked a turnip bag in the Warehouse and kicked the Courier through the same interfaces. The courier went, picked up the goods in the warehouse and delivered it to the buyer. Note : we will unravel the complicated purchase processes in the following articles.

    And the buyer all this time thought that in front of him was a megacompany with its warehouse, courier service and other paraphernalia. Naive.
    Conclusions

    As we can see, each block is fully implemented by one person.

    And what - there are no minuses? Yes, any number! Responsibility is shared, so service temporarily unavailable cases will have to be entered into a contract with each interface implementer. And yes, - the most important minus - you still have to work :)

    Also popular now: