<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rafsan Jany on Medium]]></title>
        <description><![CDATA[Stories by Rafsan Jany on Medium]]></description>
        <link>https://medium.com/@rafsanjany?source=rss-1e343ffd3cc0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*rSZL8k2-AN-HEG56</url>
            <title>Stories by Rafsan Jany on Medium</title>
            <link>https://medium.com/@rafsanjany?source=rss-1e343ffd3cc0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 23:33:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rafsanjany/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Web-Based Content ( WebView ) Explain With Example (Browser with Activity instead of default…]]></title>
            <link>https://medium.com/@rafsanjany/web-based-content-webview-explain-with-example-browser-with-activity-instead-of-default-8a5de0032b5f?source=rss-1e343ffd3cc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a5de0032b5f</guid>
            <dc:creator><![CDATA[Rafsan Jany]]></dc:creator>
            <pubDate>Sat, 04 Apr 2020 16:27:27 GMT</pubDate>
            <atom:updated>2020-04-04T16:39:16.588Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Web-Based Content ( </strong>WebView<strong> ) Explain With Example (Browser with Activity instead of default Browser)</strong></p><p><strong>Scenario:</strong> When the user clicks a link from your android app’s activity, the default behavior is for Android to launch an app that handles URLs. Usually, the default web browser opens and loads the destination URL.</p><p>However, you can override this behavior for your android apps, so links open within your activity. You can then allow the user to navigate backward and forward through their web page history that&#39;s maintained by your user Interaction.</p><p>So, maintain this behavior for your android app, today we will discuss very magical widget from <strong>Android/webkit</strong> named <strong>WebView</strong>.</p><p><strong>Then what is WebView:</strong></p><p>Android WebView component is a full-fledged browser implemented as a View subclass to embed it into your android application. So WebView is a view that display web pages inside your application which gets from live URL or your own designed HTML page with CSS and JavaScript. WebView makes turns your application just like web application within your activity.</p><p>So, you can make your web content available to users in two ways: in a traditional web browser and in an Android application, by including a <a href="https://developer.android.com/reference/android/webkit/WebView">WebView</a> in the layout.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*TnmylRxoMj3VXzpCnUHV5w.png" /></figure><p><strong>In this state someone ask me,</strong> we can use<strong> fromHtml()</strong> that belongs to the HTML Utility class for parsing HTML-formatted string and displaying it in a TextView.So why we need <strong>WebView</strong>.</p><p>Then I have to replied that, TextView can render simple formatting like styles (bold, italic, etc.), font faces (serif, sans serif, etc.), colors, links, and so forth. When it comes to complex formatting and larger scope in terms of HTML, then TextView fails to handle it well.</p><p>For example browsing stackoverflow won’t be possible through a TextView.</p><p>In this case, we need web browser or something like that which can handle complex formatting HTML pages.</p><p>The WebView framework allows you to specify viewport and style properties that make your web pages appear at the proper size and scale on all screen configurations for all major web browsers. You can even define an interface between your Android app and your web pages that allows JavaScript in the web pages to call upon APIs in your app—providing Android APIs to your web-based application.</p><p>However, you shouldn’t develop an Android app simply as a means to view your website. Rather, the web pages you embed in your app should be designed especially for that environment.</p><p>How to Work With WebView:</p><p>We can use WebView for two different scenario. First load HTML page from live URL and others from our own assets resources. WebView provides us two methods</p><p>1. loadUrl ()</p><p>2. loadData ()</p><p>Here, loadUrl() works with:</p><p>· https:// and <a href="https://urls/">https://URLs</a></p><p>· file:// URLs pointing to the local filesystem</p><p>· file:///android_asset/ URLs pointing to one of your applications assets</p><p>· content:// URLs pointing to a ContentProvider that is publishing content<br> available for streaming</p><p>Instead of loadUrl () we can use loadData () by which we can display snippets or whole of the HTML code in the method. There are two flavors of loadData (). The simpler one allows us to provide the content, the MIME type, and the encoding, all as strings. Typically, MIME type will be text/html and the encoding will be UTF-8 for ordinary HTML as shown below:</p><blockquote>webView.loadData (“&lt;html&gt;&lt;body&gt;Hello, WebView! &lt;/body&gt;&lt;/html&gt;”,</blockquote><blockquote>“text/html”, “UTF-8”);</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*Y_3tNEKDIGIhJrV-bWkuog.png" /></figure><p><strong>That’s all for WebView Basics. It’s time to make something with this concepts.</strong></p><p><strong>Now we are going to load stackoverflow home page in our own activity instead of opening phone’s default browser. Cool!</strong></p><p><em>Let’s create an empty activity in your android studio.</em></p><p><strong>Step 1:</strong></p><p>Open your android studio and click <strong>File &gt;&gt; New &gt;&gt; New Project</strong>. Then take an <strong>Empty Activity</strong> and Click <strong>Next</strong> button then give your <strong>Application name</strong> whatever you want then just Click <strong>Finish</strong> button that’s all and Successfully your create your project.</p><p>So, we have to start our coding now. Therefore we want to load <em>stackoverflow </em>home page in our activity then we need internet permission for our Application.</p><p><strong>Step 2:</strong></p><p>Open your <strong>AndroidManifest.xml</strong> file and add the following line in your manifest.</p><p>&lt;uses-permission android: name=”android.permission.INTERNET” /&gt;</p><p><strong>Step 3: </strong>Open your <strong>activity_main.xml</strong> file from</p><p><strong>app &gt;&gt; res&gt;&gt; layout &gt;&gt; activity_main.xml</strong></p><p>Then take a TextView widget for making a clickable link with text. Your activity.xml file looks like,</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;</pre><pre>&lt;androidx.constraintlayout.widget.ConstraintLayout</pre><pre>    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;</pre><pre>    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;</pre><pre>    xmlns:tools=&quot;http://schemas.android.com/tools&quot;</pre><pre>    android:layout_width=&quot;match_parent&quot;</pre><pre>    android:layout_height=&quot;match_parent&quot;</pre><pre>    tools:context=&quot;.MainActivity&quot;&gt;</pre><pre>    &lt;TextView</pre><pre>        android:id=&quot;@+id/hyperlink&quot;</pre><pre>        android:layout_width=&quot;wrap_content&quot;</pre><pre>        android:layout_height=&quot;wrap_content&quot;</pre><pre>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;</pre><pre>        app:layout_constraintLeft_toLeftOf=&quot;parent&quot;</pre><pre>        app:layout_constraintRight_toRightOf=&quot;parent&quot;</pre><pre>        app:layout_constraintTop_toTopOf=&quot;parent&quot; /&gt;</pre><pre>&lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;</pre><p>We give the id (android:id=”@+id/hyperlink”) in our TextView for getting available in our java class.</p><p><strong>Step 4:</strong></p><p>Open your <strong>MainAcitvity.java</strong> file from</p><p><strong>app &gt;&gt; java &gt;&gt; com.example. &lt;Appname&gt; &gt;&gt; MainActivity.java</strong></p><p>Then add this line of code in your <strong>MainActivity.java</strong> class onCreate method:</p><pre>@Override</pre><pre>protected void onCreate(Bundle savedInstanceState) {</pre><pre>    super.onCreate(savedInstanceState);</pre><pre>    setContentView(R.layout.<em>activity_main</em>);</pre><pre>    /* Here we want to get out TextView</pre><pre>        and</pre><pre>        Set the text which contains our link*/</pre><pre>    // get the textView from our xml file using the id</pre><pre>    TextView link = findViewById(R.id.<em>hyperlink</em>);</pre><pre>    // make text for this TextView</pre><pre>    String linkText =</pre><pre>&quot;Visit the &lt;a href=&#39;http://stackoverflow.com&#39;&gt;StackOverflow&lt;/a&gt; web page.”;</pre><pre>    // set the text for this TextView</pre><pre>    link.setText(Html.<em>fromHtml</em>(linkText));</pre><pre>    // Set the Listener in our Text for click</pre><pre>    link.setOnClickListener(new View.OnClickListener() {</pre><pre>        @Override</pre><pre>        public void onClick(View v) {</pre><pre>            // Create intent for our Browser Activity which load our HTML page from stackoverflow</pre><pre>            Intent intent =</pre><pre>new Intent(MainActivity.this,BrowserActivity.class);</pre><pre>            startActivity(intent);</pre><pre>        }</pre><pre>    });</pre><pre>}</pre><p>Here I’m getting the TextView by id then set Text and ClickListener for making TextView Clickable.</p><p>One more new thing here is new activity in our intent named BrowserActivity for load the page which contains our magical WebView widget.</p><p>So let’s create new activity for Browser<strong>. Right Click java &gt;&gt; new &gt;&gt; activity &gt;&gt; Empty Activity with popup give the activity name BrowserActivity then click Finish.</strong></p><p><strong>Wow, create our browser with just Five Click, Cool!</strong></p><p><strong>Step 5:</strong></p><p>Now time to add our magic in our <strong>activity_browser</strong>.<strong>xml</strong> file. Open this file just like before with simple navigation <strong>app &gt;&gt; res&gt;&gt; layout &gt;&gt; activity_browser</strong>.<strong>xml</strong></p><p>Then add a WebView widget in your xml file and give an id for getting this WebView in your BrowserActivity java class. As like,</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;</pre><pre>&lt;androidx.constraintlayout.widget.ConstraintLayout </pre><pre>    xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;</pre><pre>    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;</pre><pre>    xmlns:tools=&quot;http://schemas.android.com/tools&quot;</pre><pre>    android:layout_width=&quot;match_parent&quot;</pre><pre>    android:layout_height=&quot;match_parent&quot;</pre><pre>    tools:context=&quot;.BrowserActivity&quot;&gt;</pre><pre>    &lt;WebView</pre><pre>        android:id=&quot;@+id/webLink&quot;</pre><pre>        android:layout_width=&quot;match_parent&quot;</pre><pre>        android:layout_height=&quot;match_parent&quot;</pre><pre>        app:layout_constraintBottom_toBottomOf=&quot;parent&quot;</pre><pre>        app:layout_constraintEnd_toEndOf=&quot;parent&quot;</pre><pre>        app:layout_constraintStart_toStartOf=&quot;parent&quot;</pre><pre>        app:layout_constraintTop_toBottomOf=&quot;@+id/hyperlink&quot; /&gt;</pre><pre>&lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;</pre><p><strong>Here I just skip how to constraint our WebView for make this Simple.</strong></p><p><strong>Say WOW! We are ready to load our webpage in our activity, Cool again!</strong></p><p>One more last step to go…</p><p><strong>Step 6:</strong></p><p>Again we have to move our java class as like before and Open our <strong>BrowserActivity.java</strong> file.</p><p><strong>app &gt;&gt; java &gt;&gt; com.example. &lt;Appname&gt; &gt;&gt; BrowserActivity.java</strong></p><p>Here, we want to get our WebView and make Ready to load stackoverflow home page. For that add this line of code in your <strong>Oncreate ()</strong> method. And then I’ll explain your every line of code with in line comment.</p><pre>//Create a variable for our webView</pre><pre>private WebView webView;</pre><pre>@Override</pre><pre>protected void onCreate (Bundle savedInstanceState) {</pre><pre>    super.onCreate (savedInstanceState);</pre><pre>    setContentView (R.layout.<em>activity_browser</em>);</pre><pre>// getting our WebView</pre><pre>    webView = findViewById (R.id.webLink<em>)</em>;</pre><pre>// URL that we want to load</pre><pre>    String URL = &quot;https://stackoverflow.com&quot;;</pre><pre>// Enable JavaScript for our webView</pre><pre>    webView.getSettings ().setJavaScriptEnabled (true);</pre><pre>// Enable Image Load for our webView</pre><pre>    webView.getSettings ().setLoadsImagesAutomatically (true);</pre><pre>// Set Scrollbar Style in Inside Scrollable Overlay</pre><pre>    webView.setScrollBarStyle (View.<em>SCROLLBARS_INSIDE_OVERLAY</em>);</pre><pre>// finally load our page</pre><pre>    webView.loadUrl (URL);</pre><pre>// that’s all Cool!</pre><pre>}</pre><p><strong>And now every looks ready and wait to see our page, for that we have to run our application. After run our application in our main activity shows a clickable link in the middle of our screen. Then after click this we just load stackoverflow page in our next browser activity. This make sure don’t open with our phone’s default browser.</strong></p><p><strong>Looks Like,</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/235/1*KIkM6qnjxfAci-AOeaEA3g.png" /><figcaption>HomeActivity</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*H167tY-gGIpwqQJNu3nkKg.jpeg" /><figcaption>BrowserActivity</figcaption></figure><p><strong>Thanks for Your Time! Next we will explain more advance we to control our WebView.</strong></p><p>For More details:</p><ul><li><a href="https://developer.android.com/guide/webapps">Web-based content | Android Developers</a></li><li><a href="https://www.journaldev.com/9333/android-webview-example-tutorial">Android WebView Example Tutorial - JournalDev</a></li><li><a href="https://www.androidhive.info/2016/12/android-working-with-webview-building-a-simple-in-app-browser/">Android Working with WebView - Building a Simple In-App Browser</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a5de0032b5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hands On Sequence Diagram]]></title>
            <link>https://medium.com/@rafsanjany/hands-on-sequence-diagram-1af4906d9484?source=rss-1e343ffd3cc0------2</link>
            <guid isPermaLink="false">https://medium.com/p/1af4906d9484</guid>
            <category><![CDATA[uml]]></category>
            <category><![CDATA[sequence-diagrams]]></category>
            <dc:creator><![CDATA[Rafsan Jany]]></dc:creator>
            <pubDate>Fri, 03 Apr 2020 15:06:04 GMT</pubDate>
            <atom:updated>2020-04-03T15:06:04.079Z</atom:updated>
            <content:encoded><![CDATA[<p>Attention: Here i’m try to summarized some great useful resources all together and describe the concept of Sequence Diagram more easy way with Example.</p><p><strong>Sequence Diagram : </strong>As most developers know,a sequence diagram can be defined as an interaction diagram.</p><p><strong>What we Need Basically :</strong></p><ul><li>Over time we need interaction among classes for exchange or communication using message/information.</li><li>Visualize and validate various run time scenarios for any system.</li><li>Class has responsibilities and Lifeline contribution for any System.</li><li>Understand the flow of code for refactor or improve the legacy code.</li><li>Transitioning a system to another person or organization.</li><li>Define event sequences that result in some desired outcome.</li><li>High-level interactions between user of the system and the system,between the system and other systems,or between subsystems (sometimes known as system sequence diagrams)</li><li>Plan and understand the detailed functionality of an existing or future scenario for a system.</li></ul><p><strong>Getting to Know the Basics :</strong></p><p>Sequence Diagrams(SD) will communicate what messages are sent and the order in which they tend to occur. SD are interaction diagrams that detail how operations are carried out.They capture the interaction between objects in the context of a collaboration. SDs are time focused and they show the order of the interaction visually by using the vertical axis of the diagram to represent time what messages are sent and when.</p><p><strong>Object Dimension :</strong>The horizontal axis shows the elements that are involved in the interaction</p><p><strong>Time Dimension:</strong>The vertical axis represents time proceedings (or progressing) down the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T1GXcqfwyQF-rX2kpNC3jQ.png" /></figure><p>Time in a sequence diagram is all about ordering, not duration.The vertical space in an interaction diagram is not relevant for the duration of the interaction.</p><p>So , In general, Sequence diagrams are organized according to time. The time progresses as you go down the page. The objects involved in the operation are listed from left to right according to when they take part in the message sequence.</p><h3>The Notations</h3><p><strong>Actor:</strong>A type of role played by an entity that interacts with the subject (e.g., by exchanging signals and data)external to the subject (i.e., in the sense that an instance of an actor is not a part of the instance of its corresponding subject).Represent roles played by human users, external hardware, or other subjects.</p><p>Note that:An actor does not necessarily represent a specific physical entity but merely a particular role of some entity.A person may play the role of several different actors and, conversely,a given actor may be played by multiple different persons.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/26/0*hCzq4M8qiPoUs-BR" /><figcaption>ref:<a href="https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/">https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/</a></figcaption></figure><p><strong>Frame:</strong></p><p>&lt; Diagram Level &gt; [ Diagram Type Diagram Name] Ex: Diagram type : Sequence Diagram</p><p>Diagram Name : Activity Diagram, Use Cases Diagram ]</p><p>&lt; Diagram Content area &gt; [ Diagram Flow contains in this area ]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/0*EA20eC5VqXdQFxvP" /><figcaption>ref:<a href="https://developer.ibm.com/articles/the-sequence-diagram/">https://developer.ibm.com/articles/the-sequence-diagram/</a></figcaption></figure><p><strong>Life Lines:</strong></p><p>Lifelines are representative of roles or object instances that partake in the sequence being modeled.</p><p>From a visual perspective, lifelines are shown as a box with a dashed line descending from the center of the bottom edge.The lifeline’s name is placed inside the box. Additionally, the lifeline name is underlined.What this means is that the lifeline represents a specific instance of a class in a sequence diagram.Lifelines level’s used underline then this lifeline represent for specific Instance not particular Instance.Instead a lifeline can be used to represent an anonymous or unnamed instance.</p><p>[Instance Name : Class Name] Ex: Instance Name : Cat | Class Name : Animal -&gt; [ Cat:Animal]</p><p>Alice, Bob is specific Instance of Customer Class</p><p>Buyer, Seller is a particular Instance of Customer Class which plays a role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/70/0*KsZ-3tD7seqdxR3T" /><figcaption>ref:<a href="https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/">https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/</a></figcaption></figure><p><strong>Activations:</strong></p><p>A thin rectangle on a lifeline) represents the period during which an element is performing an operation.The top and the bottom of the rectangle are aligned with the initiation and the completion time respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/90/0*hGSAbjvJK9rZaANr" /><figcaption>ref:<a href="https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/">https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/</a></figcaption></figure><p><strong>Messages:</strong></p><p>To show an object (i.e., lifeline) sending a message to another object,you draw a line to the receiving object with a solid arrowhead (if a synchronous call operation) or with a stick arrowhead (if an asynchronous signal). The message/method name is placed above the arrowed line.The message that is being sent to the receiving object represents an operation/method that the receiving object’s class implements.</p><p><strong>Call Message :</strong> A message defines a particular communication between Lifelines of an Interaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/229/0*VOnO94gFqjHxzB0-" /><figcaption>ref:<a href="https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/">https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/</a></figcaption></figure><p><strong>Return Message :</strong> Return message is a kind of message that represents the pass of information back to the caller of a corresponded former message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/229/0*hYavM_a_TP5_eOEZ" /><figcaption>ref:<a href="https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/">https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/</a></figcaption></figure><p><strong>Self Message :</strong> Self message is a kind of message that represents the invocation of a message of the same lifeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/103/0*H9JXkX18j8b1zm11" /><figcaption>ref:<a href="https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/">https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/</a></figcaption></figure><p><strong>Recursive Message :</strong> Recursive message is a kind of message that represents the invocation of a message of the same lifeline. It’s target points to an activation on top of the activation where the message was invoked from.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/107/0*rYVvwN-2VvZbdJP6" /><figcaption>ref:<a href="https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/">https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/</a></figcaption></figure><p><strong>Create Message :</strong> Create message is a kind of message that represents the instantiation of (target) lifeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/0*48l0EXHeZsmYiD4l" /><figcaption>ref:<a href="https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/">https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/</a></figcaption></figure><p><strong>Destroy Message :</strong> Destroy message is a kind of message that represents the request of destroying the lifecycle of target lifeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/233/0*2XGRhsxGalM-jQeS" /><figcaption>ref:<a href="https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/">https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/</a></figcaption></figure><p><strong>Duration Message :</strong> Duration message shows the distance between two time instants for a message invocation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/229/0*Up17C9Cqt6xomBhB" /><figcaption>ref:<a href="https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/">https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/</a></figcaption></figure><p><strong>Guards:</strong></p><p>When modeling object interactions, there will be times when a condition must be met for a message to be sent to the object.Guards are used throughout UML diagrams to control flow.Remember that a guard could only be assigned to a single message.</p><p><em>Example: [ balance &gt; 0 ] sendMoney</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/0*52bsgfNqy4ly3n0D" /><figcaption>ref:<a href="https://developer.ibm.com/articles/the-sequence-diagram/">https://developer.ibm.com/articles/the-sequence-diagram/</a></figcaption></figure><p><strong>Combined fragments (alternatives, options, and loops) :</strong></p><p>In most sequence diagrams ,guard is not sufficient to handle the logic required for a sequence being modeled. This lack of functionality was a problem in addressing this problem by removing the “in-line” guard and adding a notation element called a Combined Fragment. A combined fragment is used to group sets of messages together to show conditional flow in a sequence diagram.</p><p><strong>Alternatives :</strong></p><p>Alternatives are used to designate a mutually exclusive choice between two or more message sequences.</p><p><strong>Option :</strong></p><p>The option combination fragment is used to model a sequence that, given a certain condition, will occur; otherwise, the sequence does not occur.An option is used to model a simple “if then” statement</p><p>Example : if there are fewer than five donuts on the shelf, then make two dozen more donuts).</p><p>The option combination fragment notation is similar to the alternation combination fragment,except that it only has one operand and there never can be an “else” guard (it just does not make sense here).</p><p><strong>Loops :</strong></p><p>Occasionally you will need to model a repetitive sequence. Modeling a repeating sequence has been improved with the addition of the loop combination fragment.The loop combination fragment is very similar in appearance to the option combination fragment</p><p><strong>Break:</strong></p><p>The break combined fragment is almost identical in every way to the option combined fragment,with two exceptions. First, a break’s frame has a name box with the text “break” instead of “option.”Second, when a break combined fragment’s message is to be executed,the enclosing interaction’s remainder messages will not be executed because the sequence breaks out of the enclosing interaction.In this way the break combined fragment is much like the break keyword in a programming language like C++ or Java.</p><p><strong>Parallel:</strong></p><p>Today’s modern computer systems are advancing in complexity and at times perform concurrent tasks.When the processing time required to complete portions of a complex task is longer than desired, Some systems handle parts of the processing in parallel. The parallel combination fragment element needs to be used when creating a sequence diagram that shows parallel processing activities.The parallel combination fragment is drawn using a frame,and you place the text “par” in the frame’s name box.You then break up the frame’s content section into horizontal operands separated by a dashed line.Each operand in the frame represents a thread of execution done in parallel.</p><p><strong>N.B In the combined Fragment all the notation (Like:Alternatives/Option/Loops) all have Mostly Two part</strong></p><ol><li>leveling/header/statue</li><li>Content Area <em>For some their is a condition like Option or Loops</em></li></ol><h3>Advanced Notations :</h3><p><strong>1. Referencing another sequence diagram is Interaction Occurrence :</strong></p><p>We developers like to reuse our code so we introduced Methods or class,In this case developers like to functionally break down their diagrams more and design complex diagram.sometimes need to draw the same flow/code sequence multiple times.</p><p><em>Example: if We need to call the same methods multiple times then we have to write or draw the same sequence diagram each time.</em></p><p>Interaction occurrences add the ability to compose primitive sequence diagrams into complex sequence diagrams.With these you can combine (reuse) the simpler sequences to produce more complex sequences.This means that you can abstract out a complete, and possibly complex, sequence as a single conceptual unit.</p><p>An interaction occurrence element is drawn using a frame.The notation of the referenced sequence diagram’s name follows the pattern of:</p><p>[ sequence diagram name[(arguments)] [: return value] ]</p><p><em>Example 1: Retrieve Borrower Credit Report(user_Id, Area_Code) : borrower_Credit_Report</em></p><p><strong>sequence diagram name is Retrieve Borrower Credit Report</strong></p><p><strong>Arguments are user_Id, Area_Code</strong></p><p><strong>Return Value is borrower_Credit_Report (Optional)</strong></p><p><strong>2. Gates :</strong></p><p>Gates can be an easy way to model the passing of information between a sequence diagram and its context.A gate is merely a message that is illustrated with one end connected to the sequence diagram’s frame’s edge and the other end connected to a lifeline.</p><p><strong>Purpose of Sequence Diagram:</strong></p><p>1.Model high-level interaction between active objects in a system</p><p>2.Model the interaction between object instances within a collaboration that realizes a use case</p><p>3.Model the interaction between objects within a collaboration that realizes an operation</p><p>4.Either model generic interactions (showing all possible paths through the interaction)</p><p>5.specific instances of a interaction (showing just one path through the interaction)</p><p><strong>Sequence Diagram for Modeling Use Case Scenarios</strong></p><p>User requirements are captured as use cases that are refined into scenarios.A use case is a collection of interactions between external actors and a system.The specification of a sequence of actions, including variants, that a system (or entity) can perform, interacting with actors of the system.”A scenario is one path or flow through a use case that describes a sequence of events that occurs during one particular execution of a system which is often represented by a sequence diagram.</p><p><strong>Conclusion:</strong></p><p>The sequence diagram is a good diagram to use to document a system’s requirements and to flush out a system’s design. The reason the sequence diagram is so useful is because it shows the interaction logic between the objects in the system in the time order that the interactions take place.Time in a sequence diagram is all about ordering, not duration. The vertical space in an interaction diagram is not relevant for the duration of the interaction.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>All the Information Collected From These Resources which mention Bellow:</p><p><a href="https://developer.ibm.com/articles/the-sequence-diagram/">https://developer.ibm.com/articles/the-sequence-diagram/</a></p><p><a href="https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/">https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/</a></p><p><a href="https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/">https://www.lucidchart.com/pages/uml-sequence-diagram</a></p><p><a href="https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/">https://en.wikipedia.org/wiki/Sequence_diagram</a></p><p><a href="https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/">https://www.sciencedirect.com/topics/computer-science/sequence-diagram</a></p><p><a href="https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-sequence-diagram/">https://www.cs.odu.edu/~zeil/cs330/latest/Public/sequenceDiagrams/index.html</a></p><p><a href="https://www.youtube.com/watch?v=pCK6prSq8aw">https://www.youtube.com/watch?v=pCK6prSq8aw</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1af4906d9484" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>