-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit e6f917c Merge: ea70b2f 3c6b84b Author: Robert Rachita <72192997+robertrachita@users.noreply.github.com> Date: Fri Mar 31 20:45:17 2023 +0200 Merge branch 'developing' commit 3c6b84b Author: Robert Rachita <72192997+robertrachita@users.noreply.github.com> Date: Fri Mar 31 20:43:08 2023 +0200 fixed merge conflits >plus fixed crash when no like was selected Co-Authored-By: stefanuntura <56734208+stefanuntura@users.noreply.github.com> commit 2430f8b Merge: 5de154f cfc046f Author: Robert Rachita <72192997+robertrachita@users.noreply.github.com> Date: Fri Mar 31 20:35:55 2023 +0200 Merge branch 'observorAndIterator' into merge_template commit 5de154f Merge: 2c6438b d87fa6f Author: Robert Rachita <72192997+robertrachita@users.noreply.github.com> Date: Fri Mar 31 20:33:15 2023 +0200 Merge branch 'decorator_final' into merge_template commit 2c6438b Author: Robert Rachita <72192997+robertrachita@users.noreply.github.com> Date: Fri Mar 31 19:09:40 2023 +0200 Readme Update (#5) commit cfc046f Author: Stefan Untura <u_stefan@mail.com> Date: Fri Mar 31 18:56:13 2023 +0200 Home and about improvements commit e045386 Author: Stefan Untura <u_stefan@mail.com> Date: Fri Mar 31 18:45:58 2023 +0200 Observer pattern functionality commit eccdb70 Author: Stefan Untura <u_stefan@mail.com> Date: Fri Mar 31 18:03:46 2023 +0200 Iterate over model and display posts list using iterator commit d87fa6f Author: christo_stevan <christostevan2501@gmail.com> Date: Fri Mar 31 18:03:28 2023 +0200 adding comment works commit ec210b3 Author: christo_stevan <christostevan2501@gmail.com> Date: Fri Mar 31 15:40:56 2023 +0200 Implementation finished
- Loading branch information
1 parent
8432506
commit 679eabf
Showing
14 changed files
with
191 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
namespace DesignPatterns_SocialMedia | ||
using DesignPatterns_SocialMedia.Models; | ||
|
||
namespace DesignPatterns_SocialMedia | ||
{ | ||
public interface Iterator | ||
{ | ||
public Boolean hasNext(); | ||
public Object next(); | ||
|
||
public Boolean isLast(); | ||
public Post next(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace DesignPatterns_SocialMedia | ||
{ | ||
public static class JavaScriptHandler | ||
{ | ||
public static string javaScriptAlert = ""; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace DesignPatterns_SocialMedia.Models | ||
{ | ||
public class EditButton : Button | ||
{ | ||
public override void Click() | ||
{ | ||
NotifySubscribers(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,32 @@ | ||
# Design-Patterns | ||
# Design-Patterns | ||
|
||
## Introduction | ||
This document serves as a start document and project planning for the practical group assignment, part of the “Design Patterns”course. The scope of the course is to enable students to understand various design patterns.Design patterns are a toolkit of solutions to common problems in software design. It specifically concerns with communication between objects. This group project will be created in accordance and requirementsof the “OIDP -Design Patterns” Module book version 5.0 of 2022. | ||
|
||
## Application description | ||
The group intends to create a Social Media Platform. Such a platform will allow users to create posts and comments, and to like said posts. Additionally, it can notify users of new posts, comments,or reactions to already existing posts. The application will be presented as a web application and will be written in C# ASP.NET. | ||
|
||
## Features | ||
- Creating a post via GUI | ||
- Displaying a list of posts | ||
- Liking a post (self-created or another users) | ||
- Commenting on a post (self-created or another users) | ||
|
||
## Technology& Patterns Applied | ||
The project will make use of different threading methods and techniques, as part of the course and required in implementing some of the features. These are as follows: | ||
- GitHub | ||
- C# ASP.NET | ||
- Iterator - For iterating over the list of possible posts, comments and for filteringthem by different criteria (for instance date or length of the post). This will be manually implemented. | ||
- Factory - For creating and managing the different types of objects (posts, comments, likes etc). The Factory pattern helps to encapsulate the creation and initialization of complex objects, and to provide a consistent interface for users to interact with them. | ||
- Observer - For notifying users of new posts, comments, and likes. The Observer pattern helps to decouple the different components of the social media platform, and to provide a flexible and extensible architecture for handling user interactions and updates.Another use caseis analytics – | ||
- Template - Different posts (image/text/video/hybrid) | ||
- MVC - Forseparation of Concerns and Logic, and to ease the GUI interaction from a coding point of view. | ||
|
||
The code can be found in the following public GitHub repository.The software used is Visual Studio 2022, and Figma for the UML. | ||
|
||
## Group | ||
The “Group” chapter provides an overview into the team responsible for the application development. | ||
|
||
Christopher Sulistiyo - christopher.sulistiyo@student.nhlstenden.com - 4850025 | ||
Stefan Untura - stefan.untura@student.nhlstenden.com - 4839161 | ||
Robert Răchită - robert.rachita@student.nhlstenden.com - 4859367 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,56 @@ | ||
@{ | ||
ViewData["Title"] = "View Posts"; | ||
} | ||
<script type="text/javascript" src="~/js/jquery.js"></script> | ||
<h1>@ViewData["Title"]</h1> | ||
<h1>@JavaScriptHandler.javaScriptAlert</h1> | ||
|
||
<script type="text/javascript"> | ||
@JavaScriptHandler.javaScriptAlert; | ||
</script> | ||
|
||
<p>posts go here</p> | ||
|
||
@model List<Post> | ||
|
||
@foreach (Post post in Model) | ||
{ | ||
@{ | ||
PostContainer postContainer = new PostContainer(Model); | ||
|
||
Iterator postIterator = postContainer.createIterator(); | ||
|
||
Post post; | ||
|
||
while (postIterator.hasNext()) | ||
{ | ||
post = postIterator.next(); | ||
|
||
<div class="post"> | ||
<p>Post number: @post.GetId()</p> | ||
<h2>@post.GetTitle()</h2> | ||
@if (post is ImagePost imagePost) | ||
<p>Post number: @post.GetId()</p> | ||
<h2>@post.GetTitle()</h2> | ||
@if (post is ImagePost imagePost) | ||
{ | ||
<img src="@imagePost.GetContent()" alt="image post" /> | ||
<img src="@imagePost.GetContent()" alt="image post" /> | ||
} | ||
else if (post is TextPost textPost) | ||
{ | ||
<p>@post.GetContent()</p> | ||
<p>@post.GetContent()</p> | ||
} | ||
else if (post is VideoPost videoPost) | ||
{ | ||
<iframe width="560" height="315" src="@videoPost.GetContent()" frameborder="0" allowfullscreen></iframe> | ||
<iframe width="560" height="315" src="@videoPost.GetContent()" frameborder="0" allowfullscreen></iframe> | ||
} | ||
else | ||
{ | ||
<p>Incorrect type post or source.</p> | ||
<p>Incorrect type post or source.</p> | ||
} | ||
<p>@post.GetDateOfCreation()</p> | ||
<div class="actions"> | ||
<button onclick="likePost(@post.GetId()">Like (@post.GetLikes())</button> | ||
<button onclick="showComments(@post.GetId())">Comments (@post.GetComments().Count)</button> | ||
@Html.ActionLink("Edit this post", "ViewPost", new {id = post.GetId()}) | ||
</div> | ||
<p>@post.GetDateOfCreation()</p> | ||
<div class="actions"> | ||
<button onclick="likePost(@post.GetId()">Like (@post.GetLikes())</button> | ||
<button onclick="showComments(@post.GetId())">Comments (@post.GetComments().Count)</button> | ||
@Html.ActionLink("Edit this post", "ViewPost", new {id = post.GetId()}) | ||
</div> | ||
</div> | ||
} | ||
} | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters